GET

/v1/schemas/grok/chat/v1/chat/completions?kind=output

kind outputactivity chathash 00ee0577…extracted Sep 24, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
9d3bba5a4bc352e14d619266f397ca689140f67989db997818ba2747dfb0765b
{
  "fetchedAt": 1790226635,
  "extractorVersion": "1",
  "verifiedAt": null
}

Response body

10 properties · 6 required · 13 $defs
propertytypedescriptionconstraints
choices*Choice[]A list of response choices from the model. The length corresponds to the `n` in request body (default to 1).
created*integerThe chat completion creation time in Unix timestamp.format: int64
id*stringA unique ID for the chat response.
model*stringModel ID used to create chat completion.
object*stringThe object type, which is always `"chat.completion"`.
service_tier*enumThe processing tier used for this request.default | priority | fast
citationsanyList of all the external pages used by the model to answer.
output_filesanyFiles generated during the response (e.g., by the code execution tool). Only populated when `code_execution_files_output` is included.
system_fingerprintanySystem fingerprint, used to indicate xAI system configuration changes.
usageUsageToken usage information.nullable

Types

13 $defs

Choiceobject

finish_reasonanyFinish reason. `"stop"` means the inference has reached a model-defined or user-supplied stop sequence in `stop`. `"length"` means the inference result has reached models' maximum allowed token length or user defined value in `max_tokens`. `"end_turn"` or `nul…
index*integerIndex of the choice within the response choices, starting from 0.format: int32
logprobsLogProbsThe log probabilities of each output token returned in the content of message.nullable
message*ChoiceMessageThe generated chat completion message.

ChoiceMessageobject

contentanyThe content of the message.
reasoning_contentanyThe reasoning trace generated by the model.
refusalanyThe reason given by model if the model is unable to generate a response. null if model is able to generate.
role*stringThe role that the message belongs to, the response from model is always `"assistant"`.
tool_callsanyA list of tool calls asked by model for user to perform.

CompletionUsageDetailobject

Details of completion usage.

accepted_prediction_tokens*integerThe number of tokens in the prediction that appeared in the completion.format: int32
audio_tokens*integerAudio input tokens generated by the model.format: int32
reasoning_tokens*integerTokens generated by the model for reasoning.format: int32
rejected_prediction_tokens*integerThe number of tokens in the prediction that did not appear in the completion.format: int32

Functionobject

arguments*string
name*string

LogProbsobject

contentanyAn array the log probabilities of each output token returned.

OutputFileobject

A file generated during the model's response (e.g., by the code execution tool).

file_id*stringThe file ID from the Files API. Use this to download the file.
name*stringThe display name of the file.

PromptUsageDetailobject

Details of prompt usage.

audio_tokens*integerAudio prompt token used.format: int32
cached_tokens*integerToken cached by xAI from previous requests and reused for this request.format: int32
image_tokens*integerImage prompt token used.format: int32
text_tokens*integerTotal text prompt token used (cached + non-cached text tokens).format: int32

ServerSideToolUsageDetailsobject

code_interpreter_calls*integerNumber of code interpreter calls.format: int32
document_search_calls*integerNumber of document search calls.format: int32
file_search_calls*integerNumber of file search calls.format: int32
image_generation_calls*integerNumber of image generation calls.format: int32
mcp_calls*integerNumber of MCP calls.format: int32
web_search_calls*integerNumber of web search calls.format: int32
x_posts_fetched*integerNumber of X posts fetched across all X search calls, including nested parent/quote posts and every post of a fetched thread, without de-duplication. X search is billed per fetched item.format: int32
x_search_calls*integerNumber of X search calls.format: int32
x_users_fetched*integerNumber of X user profiles fetched across all X search calls, without de-duplication. X search is billed per fetched item.format: int32

ServiceTierenum

Processing tier for a request. `Fast` and `Priority` are interchangeable: the model's fast deployment and its rates where configured, else higher scheduling priority at a higher price.

default | priority | fast

TokenLogProbobject

bytesanyThe ASCII encoding of the output character.
logprob*numberThe log probability of returning this token.format: float
token*stringThe token.
top_logprobs*TopLogProb[]An array of the most likely tokens to return at this token position.

ToolCallobject

function*FunctionFunction to call for the tool call.
id*stringA unique ID of the tool call generated by xAI. After performing tool call's function, user provides this ID with tool call's result in the subsequent request to xAI. xAI can then match the tool call result sent with tool call request.
indexanyIndex of the tool call.format: int32
typeanyType of tool call, should be `"function"` or `"web_search_call"` or `"x_search_call"` or `"code_interpreter_call"` or `"mcp_call"`

TopLogProbobject

bytesanyThe ASCII encoding of the output character.
logprob*numberThe log probability of returning this token.format: float
token*stringThe token.

Usageobject

completion_tokens*integerTotal completion token used.format: int32
completion_tokens_details*CompletionUsageDetailBreakdown of completion token usage of different types.
cost_in_usd_ticks*integerAccurate cost of this request in USD ticks, where "tick" is defined as follows: TICKS_IN_USD_CENT: i64 = 100_000_000 which means there is 10'000'000'000 ticks in one *dollar*.format: int64
num_sources_used*integerNumber of individual live search source used.format: int32
prompt_tokens*integerTotal prompt token used.format: int32
prompt_tokens_details*PromptUsageDetailBreakdown of prompt token usage of different types.
server_side_tool_usage_detailsServerSideToolUsageDetailsDetails about the server side tool usage.nullable
total_tokens*integerTotal token used, the sum of prompt token and completion token amount.format: int32

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"grok","endpointId":"v1/chat/completions","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}