Ratel Docs
Hosted APIs

Tool Picker

Send what the agent wants to do. Get back the tools to call from your own catalog, ranked and scored.

POST https://cloud.ratel.sh/v1/tools/pick answers which of your project's tools an agent should call for a query.

You send only the query. Tool Picker reads the catalog your SDK already syncs to Cloud, so there is nothing to upload.

Pick a tool

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}'
const res = await fetch("https://cloud.ratel.sh/v1/tools/pick", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RATEL_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "leave a progress note on the task", top_k: 3 }),
});
const { tools, confident } = await res.json();
import os, requests

res = requests.post(
    "https://cloud.ratel.sh/v1/tools/pick",
    headers={"Authorization": f"Bearer {os.environ['RATEL_API_KEY']}"},
    json={"query": "leave a progress note on the task", "top_k": 3},
)
best = res.json()["tools"][0]
{
  "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 }
}

Modes

ModeHow it decidesSpeedPrice
instantKeyword relevance against each tool's searchable descriptionA few msFree
precise (default)A decision model reads your catalog and scores every toolAbout 300 msTool Picker credit
exhaustiveThe decision model reads every tool, in rounds, at any catalog size1 to a few sTool Picker credit
  • Precise reads the whole catalog up to about 150 tools. Above that it reads the 25 most relevant.
  • Exhaustive reads every tool, up to 2,000. On a catalog that fits one read, it is the same as Precise.
  • Instant has no model in the loop. Use it for high-volume routing or a first pass.

On a real 99-tool production catalog, Precise matched the reference answer for 93.5% of queries, and had it in the top 5 for 98.4%.

Request

  • query (required): what the agent wants to do, up to 2,000 characters.
  • mode: instant, precise (default), or exhaustive.
  • top_k: how many tools to return, 1 to 20 (default 5).

Response

  • tools: best first. Each has the agent-facing description and a score.
  • score: for Precise and Exhaustive, the model's probability that this is the tool to call next. For Instant, keyword relevance where the best match is 1.
  • confident: true when the top pick clears the confidence bar calibrated against expert judges. Below it, treat tools as a shortlist. null for Instant.
  • usage: tools considered, model questions asked, and input tokens read.

An empty tools list means nothing in the catalog matched.

Pricing

Precise and Exhaustive are billed by the tokens the model reads: €0.0441 per 1M tokens. A pick on a 100-tool catalog reads about 9,600 tokens; smaller catalogs cost less. Instant is free.

They spend your Tool Picker balance, separate from Embeddings.

PlanIncluded each monthAbout
Free€12,300 picks
Plus€512,000 picks
Pro€4095,000 picks
Enterprise€100, or custom235,000 picks

Rate limits

Limits are per project, per minute.

PlanInstantPrecise and Exhaustive
Free6010
Plus, Pro, Enterprise1,200300

A 429 carries Retry-After in seconds.

Errors

Errors use the same envelope as Embeddings.

StatusMeaning
400Bad body: missing query, unknown mode, or top_k out of range.
401Missing, invalid, or revoked API key.
402Out of Tool Picker credit. Top up, or use instant.
409The project has no synced tools. Sync your catalog with the Ratel SDK first.
429Rate limit reached. Wait Retry-After seconds.
502 / 503Temporarily unavailable. Retry, or fall back to instant.
504The pick took over 45 s. Retry, or use precise on a large catalog.

Earlier endpoint

POST /v1/pick still works with its original request and response shape. It answers with a Deprecation header. Move to /v1/tools/pick.

On this page