Tool Picker
Rank the project's own tools for a query.
For modes, accuracy and credit, see Tool Picker.
POST /v1/tools/pick
Returns the project's tools that best fit a query, ranked and scored.
- Method and path:
POST /v1/tools/pick(alias/api/v1/tools/pick) - Auth: bearer API key with
tool_picker
Request
Content-Type: application/json, up to 16 KB.
| Field | Type | Notes |
|---|---|---|
query | string | Required. What the agent wants to do, up to 2,000 characters. |
mode | string | instant, precise (default) or exhaustive. |
top_k | integer | 1 to 20. Default 5. |
The candidates are the tools in the project's runtime catalog, which the Ratel SDK syncs.
curl -s https://cloud.ratel.sh/v1/tools/pick \
-H "Authorization: Bearer $RATEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "leave a progress note on the task", "mode": "precise", "top_k": 3}'Response
200:
{
"mode": "precise",
"tools": [
{ "id": "add_task_comment", "name": "add_task_comment", "description": "Comment on a task.", "score": 0.94 },
{ "id": "update_task", "name": "update_task", "description": "Update a task.", "score": 0.04 }
],
"confident": true,
"usage": { "candidates": 99, "questions": 1, "input_tokens": 9580 }
}tools: best first, at mosttop_k. Empty when nothing matched.score: inpreciseandexhaustive, the probability that this is the tool to call next. Ininstant, keyword relevance where the best match is 1.confident:truewhen the top pick clears the calibrated confidence bar.nullininstant, and when only one tool matched.usage: tools the decision was made between, model questions asked, and input tokens read.
precise and exhaustive spend Tool Picker credit. instant is free.
Rate limits
Per project, not per key. Requests a minute, with the burst in brackets:
| Plan | instant | precise and exhaustive |
|---|---|---|
| Free | 60 (20) | 10 (5) |
| Paid plans | 1,200 (200) | 300 (60) |
Errors
The OpenAI envelope: { "error": { "message", "type" } }.
| Status | type | Cause |
|---|---|---|
400 | invalid_request_error | Bad body: no query, unknown mode, top_k out of range, or more than 2,000 tools in exhaustive. |
401 | invalid_request_error | Missing, invalid, revoked or expired key. |
402 | insufficient_quota | Out of Tool Picker credit in precise or exhaustive, or the key's workspace no longer exists. |
403 | permission_error | The key does not have tool_picker. |
409 | invalid_request_error | The project has no tools in its runtime catalog. Sync it with the Ratel SDK first. |
413 | invalid_request_error | Body over 16 KB. |
422 | invalid_request_error | The model could not decide the query. Rephrase it, or use instant. |
429 | rate_limit_error | The project's rate limit, with Retry-After. Or the decision model is busy, without it. |
502 | api_error | The decision model failed. Retry. |
503 | api_error | The decision model is not configured on this server. Use instant. |
504 | api_error | The pick ran past 45 seconds. Retry, or use precise. |
A pick that fails after the model answered some questions still spends credit for them.
POST /v1/pick (deprecated)
Deprecated
/v1/pick is the first release of Tool Picker. It stays for existing callers. New code uses /v1/tools/pick.
- Method and path:
POST /v1/pick(alias/api/v1/pick) - Auth: bearer API key with
tool_picker
Same engine, credit, limits and errors as /v1/tools/pick. The request takes query, an optional model and an optional exhaustive:
model | exhaustive | Runs as |
|---|---|---|
ratel-pick-1 or omitted | false or omitted | precise |
ratel-pick-1 or omitted | true | exhaustive |
ratel-search-1 | false or omitted | instant |
curl -s https://cloud.ratel.sh/v1/pick \
-H "Authorization: Bearer $RATEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "leave a progress note on the task"}'{
"model": "ratel-pick-1",
"tool": { "id": "add_task_comment", "name": "add_task_comment", "description": "Comment on a task." },
"confidence": 0.94,
"confident": true,
"alternatives": [
{ "id": "update_task", "name": "update_task", "description": "Update a task.", "score": 0.04 }
],
"usage": { "candidates": 99, "questions": 1, "input_tokens": 9580 }
}A successful response carries Deprecation: true and Link: </v1/tools/pick>; rel="successor-version".