GET
/v1/schemas/grok/chat/v1%2Fmessages
Accept:
Request body
12 properties · 0 required · 12 $defs| property | type | description | constraints |
|---|---|---|---|
| max_tokens | integer | The maximum number of tokens to generate before stopping. The model may stop before the max_tokens when it reaches the stop sequence. | format: int32 |
| messages | MessageBody[] | Input messages. | |
| metadata | MessageMetadata | An object describing metadata about the request. | nullable |
| model | string | Model name for the model to use. | |
| stop_sequences | any | (Not supported by reasoning models) Up to 4 sequences where the API will stop generating further tokens. | |
| stream | any | If 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. | |
| system | string | SystemMessagePart[] | System prompt message for the model, defining how the model should behave to user messages. | nullable |
| temperature | any | What sampling temperature to use, between 0 and 2. 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_choice | object | object | object | Controls 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 |
| tools | any | A 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 128 functions are supported. | |
| top_k | any | (Unsupported) When generating next tokens, randomly selecting the next token from the k most likely options. | format: int32 |
| top_p | any | An 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: 1 |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"grok","endpointId":"v1/messages","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}