v4

latestOpenAPI 3.1.02026-08-0143190206.8 KB
v1

Retrieve a previously generated response.

get/v1/responses/{response_id}

Path parameters

response_idstring required

The response id returned by a previous create response request.

Response

Success

backgroundboolean required

OpenResponses compatibility fields. Not used at the moment. Just for OpenResponses compatibility. Whether to process the response asynchronously in the background.

completed_atinteger nullable

The Unix timestamp (in seconds) for the response completion time. Only set when the response is completed.

created_atinteger required

The Unix timestamp (in seconds) for the response creation time.

{"stackTrail":"components:schemas:ModelResponse:properties:error","oasType":"schema","type":"unknown","description":"An error object returned when the model fails to generate a response."}
frequency_penaltynumber float required

(NOT SUPPORTED in Responses API) Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.

idstring required

Unique ID of the response.

instructionsstring nullable

A system (or developer) message inserted into the model's context.

max_output_tokensinteger nullable

Max number of tokens that can be generated in a response. This includes both output and reasoning tokens.

max_tool_callsinteger nullable

The maximum number of tool calls allowed for this response.

{"stackTrail":"components:schemas:ModelResponse:properties:metadata","oasType":"schema","type":"unknown","description":"Only included for compatibility."}
modelstring required

Model name used to generate the response.

objectstring required

The object type of this resource. Always set to response.

parallel_tool_callsboolean required

Whether to allow the model to run parallel tool calls.

presence_penaltynumber float required

(NOT SUPPORTED in Responses API) Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.

previous_response_idstring nullable

The ID of the previous response from the model.

prompt_cache_keystring nullable

The cache key used for the prompt for routing to the correct engine.

safety_identifierstring nullable

A stable identifier used to help detect users of your application that may be violating xAI's usage policies.

service_tier'default' | 'priority' required

Processing tier for a request. Determines scheduling priority and billing.

statusstring required

Status of the response. One of completed, in_progress or incomplete.

storeboolean required

Whether to store the input message(s) and model response for later retrieval.

temperaturenumber float nullable

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.

top_logprobsinteger required

An integer between 0 and 8 specifying the number of most likely tokens to return at each token position.

top_pnumber float nullable

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 recommended to alter this or temperature but not both.

truncationstring required

The truncation strategy to use for the model response.

userstring nullable

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