Chat reply
A model’s whole answer to a chat call, with every step, the tools it used, and what it used.
A model’s whole answer to a chat call: the last answer, every step it took to get there, the tools it called and their results, why it stopped, and what it used in all.
{
"id": "chatcmpl-b2",
"model": "openai/gpt-oss-120b",
"text": "Dar es Salaam is 31°C and sunny; Arusha is 22°C.",
"reasoning": "",
"json": undefined,
"toolCalls": [
{ "id": "call_1", "name": "weather", "input": { "city": "Dar es Salaam" } },
{ "id": "call_2", "name": "weather", "input": { "city": "Arusha" } }
],
"toolResults": [
{ "callId": "call_1", "name": "weather", "input": { "city": "Dar es Salaam" }, "output": { "tempC": 31 } },
{ "callId": "call_2", "name": "weather", "input": { "city": "Arusha" }, "output": { "tempC": 22 } }
],
"stopReason": "end",
"steps": [],
"usage": { "inputTokens": 2000, "outputTokens": 900, "totalTokens": 2900, "units": 111 },
"messages": [],
"requestId": "01m3c081dbf3j55x7hsa7wc1yj",
"processedIn": "Germany"
}Fields
idstringThe last answer’s ID.
modelstringThe model that answered, by the name you sent.
textstringThe last answer’s text. Empty when the call ended because the model asked for tools.
reasoningstringWhat a reasoning model thought before the last answer, kept apart from
text. Empty when it did not reason.jsonobject or undefinedWith
schema, the answer checked against it and typed. Withjson: true, the answer parsed.undefinedotherwise, or when the call ended because the model asked for tools.toolCallsToolCall[]Every tool the model asked for, in every step, each
{ id, name, input }, withinputchecked against the tool’s schema. See Step.toolResultsToolResult[]What each tool that ran gave back, each
{ callId, name, input, output }, orerrorin place ofoutputwhen it failed.stopReasonstringWhy the last answer stopped:
endwhen the model finished,max_tokenswhen it reachedmaxTokens,tool_callswhen it asked for tools, orrefusedwhen it would not answer.stepsStep[]Each answer in order, with its text, reasoning, tool calls, results, and usage. See Step.
usageobject or nullWhat every step used together, or
nullwhen none was reported.usage.inputTokensnumberThe tokens the model read.
usage.outputTokensnumberThe tokens the model wrote, reasoning included.
usage.totalTokensnumberThe two together.
usage.unitsnumberThe AI units the call used. See AI units.
messagesMessage[]The messages this call added to the conversation: each answer, and a
toolmessage for each result. Add them to your messages to carry on, such as after answering a tool with norun.requestIdstring or undefinedThe last answer’s ID with us. Quote it when you contact us. Each step has its own.
processedInstring or undefinedThe country where the model ran, such as
GermanyorUnited States.
Returned by
space.ai.chat(), withoutstream: truedone()on a chat stream
Last updated