Tools
1 operation under /v1/tools/search (POST): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.
Tools
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
POST /v1/tools/search
https://api.codespar.dev/v1/tools/searchFind tools by intent, in words
Descreve o que você quer fazer e recebe as ferramentas que servem, com uma confiança e o porquê de cada uma.
Esta rota não falha por causa do classificador. Quando a chave do modelo não está configurada, ou a chamada ao classificador dá errado, ela DEGRADA para uma busca heurística e responde 200 assim mesmo — e diz qual caminho usou em source. Um chamador que trata source: "fallback" como sucesso silencioso está lendo um resultado mais fraco sem saber; o campo existe para isso ser visível.
O teto de limit é 5.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
intent | string | yes | O que você quer fazer, em palavras. |
limit | integer | no | — |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
400 | object | O corpo não casou com o schema. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
elapsed_ms | integer | yes | — |
hits | array of object | yes | — |
intent | string | yes | Ecoa o que foi pedido. |
source | "llm" | "fallback" | yes | llm quando o classificador respondeu; fallback quando a busca heurística respondeu no lugar dele. |
curl -X POST https://api.codespar.dev/v1/tools/search \
-H "Authorization: Bearer $CODESPAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"intent": "string",
"limit": 1000
}'POST /v1/tools/search HTTP/1.1
Host: api.codespar.dev
Authorization: Bearer $CODESPAR_API_KEY
Content-Type: application/json
{
"intent": "string",
"limit": 1000
}import os
import requests
res = requests.post(
"https://api.codespar.dev/v1/tools/search",
headers={"Authorization": f"Bearer {os.environ['CODESPAR_API_KEY']}"},
json={
"intent": "string",
"limit": 1000
},
)
res.raise_for_status()
data = res.json()const res = await fetch("https://api.codespar.dev/v1/tools/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"intent": "string",
"limit": 1000
}),
});
const data = await res.json();const result = await cs.api.post("/v1/tools/search", {
body: {
intent: "string",
limit: 1000
}
});{
"intent": "string",
"hits": [
{
"tool_name": "Example",
"confidence": "high",
"rationale": "string"
}
],
"elapsed_ms": 0,
"source": "llm"
}Meta Tools
1 operation under /v1/meta-tools/discover (POST): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.
Tool Calls
6 operations under /v1/tool-calls (GET): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.