Install
Enable server tools
Server tools are in early access. Ask Baseten to enable them for your workspace, then send thex-baseten-server-tools: true header with each request.
Name the tools in a request
Or use an SDK
The endpoint is the Anthropic Messages API, so an Anthropic SDK client reaches it by base URL. The SDK sends the key asx-api-key, which Baseten does not read, so set both headers yourself:
/v1/chat/completions and on /v1/responses. Messages is the one to prefer: mirroring the assistant, tool-call and tool-result blocks back byte for byte is straightforward there, and that is what keeps the KV cache warm across turns.
The two tools
They are the MCP server’s two tools, with the same names and the same arguments — the
baseten__keenable__ prefix is Baseten’s namespace for hosted tools. The model fills in every argument it sees.
What comes back
The whole loop is in one response. Each round the model ran is atool_use block — its name is the full tool type, its input is the arguments the model wrote — followed by the tool_result block Keenable answered with, and the final answer is the last text block. Tool calls the model emits together are executed together, so independent lookups overlap instead of running one after another.
Two things end a turn early and are worth handling:
- The iteration cap. Baseten limits how many tool rounds one request may run. A turn that hits the cap comes back with
stop_reason: "pause_turn", and it can stop on a tool result with no answer written. Send the message history back in a new request to continue with a fresh budget. - Failed tool calls. A call that fails is marked as an error for the model, which usually retries or works around it. It is not billed.
max_tokens. The budget covers the reasoning and commentary between the tool rounds, not the answer alone, so a grounded answer needs more of it than the same question asked without tools. Too low a value returnsstop_reason: "max_tokens"and a sentence that stops mid-word.
Reading your usage
Alongside the content, the response carries abaseten object with one entry per tool call: the provider and tool name, its status, whether it was billable, and the Keenable SKU and quantity it was metered as. Failed calls show billable: false and no SKU. Use it to attribute cost per call, and treat the shape as informational — it is Baseten’s extension field, not a stable protocol surface.