Parameters & tools

Function calls, JSON output and reasoning settings.

Draft format · Execution not enabled

Check the model first

This describes the current draft request format. Paid chat is not enabled; these examples do not generate a completion today. Check supported_parameters as well as the uRouter schema. seed, penalties, logprobs, provider selection and arbitrary extra fields are not in the current draft.

Function tools

Use OpenAI-style function tools with an explicit type: "function". The draft accepts up to 100 definitions. Your application executes the function; the model only requests it. Validate arguments and apply your own authorization before executing a tool.

{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Read the weather for a city.",
        "parameters": {
          "type": "object",
          "properties": {
            "city": {
              "type": "string"
            }
          },
          "required": [
            "city"
          ],
          "additionalProperties": false
        },
        "strict": true
      }
    }
  ],
  "tool_choice": "auto"
}

Return a tool result

Append the assistant tool-call message, then a tool message referencing its ID. Function arguments and results are JSON-encoded strings. tool_choice accepts auto, none, required, or an object selecting a named function.

{
  "messages": [
    {
      "role": "assistant",
      "content": null,
      "tool_calls": [
        {
          "id": "call_weather",
          "type": "function",
          "function": {
            "name": "get_weather",
            "arguments": "{\"city\":\"Paris\"}"
          }
        }
      ]
    },
    {
      "role": "tool",
      "tool_call_id": "call_weather",
      "content": "{\"temperature_c\":18}"
    }
  ]
}

Structured output

response_format accepts text, json_object or json_schema. Use a model that advertises this option. JSON mode is not the same as schema validation; validate the returned value in your application.

{
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "answer",
      "strict": true,
      "schema": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string"
          }
        },
        "required": [
          "answer"
        ],
        "additionalProperties": false
      }
    }
  }
}

Reasoning

Use the spelling reported by the model. reasoning_effort and reasoning are different fields; do not assume they are interchangeable or send both. The catalog does not enumerate supported effort values per model.

Reasoning
FieldDraft shape
reasoning_effortOne of none, minimal, low, medium, high, xhigh, max. Model support may be narrower.
reasoningObject with optional effort (string, ≤30 characters), max_tokens (positive integer), exclude (boolean).