GET

/v1/schemas/grok/chat/v1/messages

kind inputactivity chathash 8e6f9a77…extracted Oct 21, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
6910c22b5fda89bcef4649f7f3798b75198027b07a3553f7ad05ec62a3b2b210
{
  "fetchedAt": 1792559435,
  "extractorVersion": "1",
  "verifiedAt": null
}

Request body

12 properties · 0 required · 12 $defs
propertytypedescriptionconstraints
max_tokensintegerThe maximum number of tokens to generate before stopping. The model may stop before the max_tokens when it reaches the stop sequence.format: int32
messagesMessageBody[]Input messages.
metadataMessageMetadataAn object describing metadata about the request.nullable
modelstringModel name for the model to use.
stop_sequencesany(Not supported by reasoning models) Up to 4 sequences where the API will stop generating further tokens.
streamanyIf set, partial message deltas will be sent. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a `data: [DONE]` message.
systemstring | SystemMessagePart[]System prompt message for the model, defining how the model should behave to user messages.nullable
temperatureanyWhat sampling temperature to use, between 0 and 2. Values above 1 are sampled at 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. It may not work well with reasoning models.0 ≤ n ≤ 2 · format: float · default: 1
tool_choiceobject | object | objectControls which (if any) tool is called by the model. `"none"` means the model will not call any tool and instead generates a message. `"auto"` means the model can pick between generating a message or calling one or more tools. `"any"` means the model must call…nullable
toolsanyA list of tools the model may call in JSON-schema. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 1000 functions are supported.
top_kany(Unsupported) When generating next tokens, randomly selecting the next token from the k most likely options.format: int32
top_panyAn alternative to sampling with `temperature`, called nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. It is generally reco…0 < n ≤ 1 · format: float · default: 0.95

Types

12 $defs

MessageBodyobject

Anthropic compatible message body

content*string | MessageContentPart[]The content message.
role*stringThe role that the message belongs to, `"system"` for system prompt, `"user"` for user prompt, and `"assistant"` for response from the model.

MessageContentstring | MessageContentPart[]

MessageContentPartobject | object | object | …

MessageImageContentobject | object

MessageMetadataobject

user_idanyA unique identifier representing your end-user, which can help xAI to monitor and detect abuse.

MessageToolChoiceobject | object | object

Tool choice option.

MessageToolInputSchemaobject

properties*anyJSON-object of the tool input schema.
requiredanyRequired properties of the tool input schema, if any.
type*stringType of the schema. This is always `"object"`.

MessageToolsobject

cache_controlany(Unsupported) Cache control.
description*stringDescription of the tool.
input_schema*MessageToolInputSchemaInput schema allowed by the tool.
name*stringName of the tool.

SystemMessageContentstring | SystemMessagePart[]

SystemMessagePartobject

cache_controlany(Unsupported) Cache control.
text*stringSystem prompt text.
type*stringType of the object. This is always `"text"`.

ToolResultContentstring | ToolResultContentBlock[]

Content of a tool_result block. The Anthropic SDK may send this as either a plain string or an array of typed content blocks (e.g. `[{"type": "text", "text": "..."}]`).

ToolResultContentBlockobject | object

A single content block within a tool_result's array content.

Validate a payload

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