Step
One answer from the model in a chat call, with the tools it asked for and what they gave back.
One answer from the model in a chat call. A call with tools can take several steps: the model asks for tools, they run, and the model answers again with their results.
{
"id": "chatcmpl-a1",
"text": "",
"reasoning": "I need the weather for both cities.",
"toolCalls": [
{ "id": "call_1", "name": "weather", "input": { "city": "Dar es Salaam" } }
],
"toolResults": [
{ "callId": "call_1", "name": "weather", "input": { "city": "Dar es Salaam" }, "output": { "tempC": 31 } }
],
"stopReason": "tool_calls",
"usage": { "inputTokens": 900, "outputTokens": 400, "totalTokens": 1300, "units": 50 },
"requestId": "01m3c081dbf3j55x7hsa7wc1yj"
}Fields
idstringThe answer’s ID.
textstringThe answer’s text. Often empty when the model asked for tools.
reasoningstringWhat a reasoning model thought before it answered. Empty when it did not reason.
toolCallsToolCall[]The tools the model asked for.
toolCalls[].idstringThe call’s ID, which its result names.
toolCalls[].namestringThe tool’s name, its key in
tools.toolCalls[].inputunknownThe input, checked against the tool’s schema. When it did not match, the input as the model wrote it.
toolResultsToolResult[]What each tool that ran gave back. A tool with no
runhas no result.toolResults[].callIdstringThe call it answers.
toolResults[].outputunknownWhat
runreturned. Sent to the model as JSON, or as it is when it is a string.toolResults[].errorstringIn place of
output, why the call failed: there is no tool with that name, the input did not match its schema, orrunthrew. The model gets it too.stopReasonstringWhy the answer stopped:
end,max_tokens,tool_calls, orrefused.usageobject or nullWhat the step used, in the same shape as a chat reply’s.
requestIdstring or undefinedThe step’s ID with us.
Found in
- A chat reply’s
steps - A chat stream’s
stepevents
Last updated