Docs / API reference
Function Calling
Tool definitions, parallel calls, and result messages are all passed through untouched — no rewriting needed.
JSON
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {
"type": "object",
"properties": { "city": { "type": "string" } },
"required": ["city"]
}
}
}]Call flow
- The model returns tool_calls, with finish_reason set to tool_calls.
- You execute the function locally and append the result as a message with role tool.
- Send the request again; the model produces its final reply based on the tool result.
Not every model supports parallel tool calls — the capability tags on each model's detail page say which do.