Skip to main content
Tool definitions use a flat schema ({type, name, parameters}) and tool results are function_call_output input items with a call_id and output string.

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)

Define tools

Define a tool with the flat schema format:
Chat Completions wraps these fields under a nested function key.

Call tools

Send a request with tools and inspect the function_call output item:

Submit tool results

Match the call_id from the function call output to link your result back to the original request:
Submitting tool results requires state from a previous response. For single-request examples, see Call tools.

Use parallel tool calls

Set parallel_tool_calls: true to let the model call multiple functions in one response:

Control tool choice

Set tool_choice to control when the model calls tools:
"auto" (default) lets the model decide. "required" forces a tool call. "none" prevents tool calls. {"type": "function", "name": "get_weather"} forces a specific function. See Tool Calling guide for provider-specific behavior.

Stream tool calls

Stream function call arguments as they’re generated:
The .done event includes the complete arguments string, so you don’t need to reassemble delta chunks.