GET
/v1/schemas/grok/chat/v1%2Fresponses
Accept:
Request body
29 properties · 1 required · 45 $defs| property | type | description | constraints |
|---|---|---|---|
| input* | string | ModelInputPart[] | The input passed to the model. Can be text, image or file. | |
| background | any | (Unsupported) Whether to process the response asynchronously in the background. | default: false |
| context_management | any | Optional context-management directives (e.g. compaction). Parsed but not yet executed. | |
| include | any | What additional output data to include in the response. Supported values include `reasoning.encrypted_content` (encrypted reasoning tokens) and tool-output options. OpenAI's `message.output_text.logprobs` is accepted for compatibility but silently ignored. | |
| instructions | any | An alternate way to specify the system prompt. Note that this cannot be used alongside `previous_response_id`, where the system prompt of the previous message will be used. | |
| logprobs | any | Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message. Not supported by models `grok-4.20` and newer; the field will be silently ignored if set. | default: false |
| max_output_tokens | any | Max number of tokens that can be generated in a response. This includes both output and reasoning tokens. Defaults to 128,000 when unset; set a larger value to allow longer generations. | format: int32 |
| max_turns | any | Maximum number of agentic tool calling turns allowed for this request. If not set, defaults to the server's global cap. This parameter will be ignored for any non-agentic requests. | format: int32 |
| metadata | any | Not supported. Only maintained for compatibility reasons. | |
| min_p | any | Min-p sampling: tokens whose probability is below `min_p` times the probability of the most likely token are excluded from sampling. Disabled when unset. | 0 ≤ n ≤ 1 · format: float |
| model | string | Model name for the model to use. Obtainable from <https://console.x.ai/team/default/models> or <https://docs.x.ai/docs/models>. | |
| parallel_tool_calls | any | Whether to allow the model to run parallel tool calls. | default: true |
| previous_response_id | any | The ID of the previous response from the model. | |
| prompt_cache_key | any | Plumbed to x-grok-conv-id for Open Responses compatibility, used for routing. | |
| reasoning | ReasoningConfiguration | Reasoning configuration. Only for reasoning models. | nullable |
| reasoning_effort | any | reasoning_effort alternative to reasoning configuration. This is a non-standard field meant to ease user experience. We only look at this if the reasoning field is unset. | |
| search_parameters | SearchParameters | Set the parameters to be used for searched data. Takes precedence over `web_search_preview` tool if specified in the tools. | nullable |
| service_tier | enum | Specifies the processing tier for this request. Set to `"priority"` for higher scheduling priority at a higher token price. Valid values: `"auto"` (default), `"priority"`. | default | priority · nullable |
| store | any | Whether to store the input message(s) and model response for later retrieval. | default: true |
| 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. | default: false |
| 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. | 0 ≤ n ≤ 2 · format: float · default: 1 |
| text | ModelResponseConfiguration | Settings for customizing a text response from the model. | nullable |
| tool_choice | string | 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. required means the model must call one … | nullable |
| tools | any | A list of tools the model may call in JSON-schema. Currently, only functions and web search are supported as tools. A max of 128 tools are supported.`web_search_preview` tool, if specified, will be overridden by `search_parameters`. | items ≤ 128 |
| top_k | any | Top-k sampling: only the `top_k` most probable tokens are considered at each sampling step. Disabled when unset. | n ≥ 1 · format: int32 |
| top_logprobs | any | An integer between 0 and 8 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used. Not supported by models `grok-4.20` and newer; the field w… | 0 ≤ n ≤ 8 · 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 |
| truncation | any | Not supported. Only maintained for compatibility reasons. | |
| user | any | A unique identifier representing your end-user, which can help xAI to monitor and detect abuse. |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"grok","endpointId":"v1/responses","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}