Pass function schemas in your request and Auriko returns structured tool calls you can execute locally.Documentation Index
Fetch the complete documentation index at: https://docs.auriko.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- An Auriko API key
- Python 3.10+ with the OpenAI SDK (
pip install openai) or the auriko SDK (pip install auriko)- OR Node.js 18+ with the OpenAI SDK (
npm install openai) or@auriko/sdk(npm install @auriko/sdk)
- OR Node.js 18+ with the OpenAI SDK (
Define tools
Define tools as JSON schemas describing the function signature:Call tools
Send a request with tools and check the response:Execute tool calls
After receiving tool calls, execute them and send the results back:model_dump(exclude_none=True) preserves all tool call fields while stripping None fields that some providers reject. Some providers attach a cryptographic signature to tool calls for multi-turn verification. Using model_dump(exclude_none=True) ensures the signature is echoed back correctly.
Use multiple tools
Define multiple tools in the same request:Use parallel tool calls
Models can request multiple tool calls in parallel:Control tool choice
Control which tools the model can use:tool_choice controls whether the model calls tools:
"auto"(default): The model decides whether to call a tool based on the conversation."required": The model must call at least one tool. Most providers support this; see below for exceptions.{"type": "function", "function": {"name": "..."}}: The model must call the specified tool."none": The model won’t call any tools. Auriko ensures no tool calls are produced, even on providers that don’t respect"none". These requests can route to more providers, improving availability.
Provider-specific behavior
tool_choice with reasoning models
Some providers activate reasoning by default for certain models. When reasoning is active, these providers don’t fully support tool_choice="required" or named tool_choice. Auriko handles this automatically:
| Provider | Affected models | Behavior |
|---|---|---|
| DeepSeek | deepseek-v4-flash, deepseek-v4-pro | Auriko routes "required" requests to other providers that honor the constraint. Use tool_choice: "auto" directly to avoid routing constraints. |
| Moonshot | kimi-k2.5, kimi-k2.6 | Auriko suppresses default thinking to honor tool_choice="required". If you explicitly enable thinking (reasoning_effort > "off"), Auriko routes to alternative providers; if none are available, you receive a routing error. |
tool_choice="auto". The constraint only affects forcing tool use.
See Extensions and Thinking for details on reasoning_effort and how Auriko translates it per provider.
These constraints originate from the providers’ APIs. Third-party hosts (e.g., Fireworks) serving the same model weights typically don’t have this restriction.
tool_choice="required" provider support
Auriko filters out providers known not to honor tool_choice="required" when routing these requests.
| Provider | Affected models | Reason |
|---|---|---|
| DeepSeek | deepseek-v4-flash, deepseek-v4-pro | Reasoning models reject "required" with a 400 error |
| MiniMax | All models | Models silently ignore "required" and behave as "auto" |
| SiliconFlow | All models | Models return malformed tool calls or errors with "required" on SiliconFlow |
| Z.AI | All models | Models ignore the "required" constraint and may respond with text |
| DeepInfra | llama-3.1 | Model returns text instead of honoring the "required" constraint |
| DeepInfra | qwen-3.5 | Model rejects "required" with a 400 error |
| Together AI | glm-5.1 | Model ignores the "required" constraint and may respond with text |
tool_choice_required_not_supported error. To resolve this:
- Use
tool_choice: "auto". Models still call tools when prompted appropriately. - Remove the provider constraint to allow routing to a capable provider.
tool_choice: "auto", models still call tools when the prompt makes it appropriate. The model isn’t forced to call a tool and may respond with text instead. In practice, well-prompted requests still produce tool calls reliably.
Named tool_choice ({type: "function", function: {name: "..."}}) isn’t affected by this filtering. Only the string value "required" triggers provider filtering.
If you need guaranteed forced tool use, exclude affected providers using
exclude_providers to route to a provider that fully supports tool_choice: "required".Stream tool calls
Reassemble streamed tool call chunks into complete function calls:Convert legacy functions
Auriko auto-converts the deprecatedfunctions/function_call parameters to the modern tools/tool_choice format:
| Legacy parameter | Converted to | Condition |
|---|---|---|
functions | tools | Only if tools is absent |
function_call: "auto" | tool_choice: "auto" | Only if tool_choice is absent |
function_call: "none" | tool_choice: "none" | Only if tool_choice is absent |
function_call: {name: "fn"} | tool_choice: {type: "function", function: {name: "fn"}} | Only if tool_choice is absent |
tools/tool_choice for new code. Auriko supports the legacy format for backward compatibility.
Auriko also normalizes legacy message formats in chat history:
| Legacy message format | Converted to | Notes |
|---|---|---|
role: "function" message | role: "tool" message | name replaced with synthesized tool_call_id |
assistant.function_call | assistant.tool_calls entry | Original function_call field removed |
Most providers support tool calling, but subfeatures like
parallel_tool_calls vary. Check /v1/directory/models for current capability details.Best practices
Clear Descriptions
Write clear, specific function descriptions so the model knows when to use them.
Validate Arguments
Always validate tool call arguments before executing.
Error Handling
Return helpful error messages in tool results when execution fails.
Limit Tools
Only include relevant tools to reduce confusion and latency.