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

idstring

The answer’s ID.

textstring

The answer’s text. Often empty when the model asked for tools.

reasoningstring

What a reasoning model thought before it answered. Empty when it did not reason.

toolCallsToolCall[]

The tools the model asked for.

toolCalls[].idstring

The call’s ID, which its result names.

toolCalls[].namestring

The tool’s name, its key in tools.

toolCalls[].inputunknown

The 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 run has no result.

toolResults[].callIdstring

The call it answers.

toolResults[].outputunknown

What run returned. Sent to the model as JSON, or as it is when it is a string.

toolResults[].errorstring

In place of output, why the call failed: there is no tool with that name, the input did not match its schema, or run threw. The model gets it too.

stopReasonstring

Why the answer stopped: end, max_tokens, tool_calls, or refused.

usageobject or null

What the step used, in the same shape as a chat reply’s.

requestIdstring or undefined

The step’s ID with us.

Found in

Last updated