Create response endpoint - OpenResponses API
const url = 'https://example.com/v1/responses';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"adapter":{"generation":"5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a"},"background":true,"dry_allowed_length":1,"dry_base":1,"dry_multiplier":1,"dry_sequence_breakers":["example"],"files":["example"],"frequency_penalty":1,"grammar":{"type":"regex","value":"example"},"include":["file_search_call.results"],"input":[{"content":[{"annotations":[{"end_index":1,"file_citation":{"file_id":"example","quote":"example"},"start_index":1,"text":"example","type":"file_citation"}],"text":"example","type":"input_text"}],"role":"example","type":"message"}],"instructions":"example","logit_bias":"example","logprobs":true,"max_output_tokens":1,"max_tool_calls":1,"max_tool_rounds":1,"metadata":"example","min_p":1,"model":"example","n":1,"parallel_tool_calls":true,"presence_penalty":1,"previous_response_id":"example","reasoning":{"effort":"none","summary":"concise"},"repetition_penalty":1,"response_format":{"type":"text"},"stop":"example","store":true,"stream":true,"stream_options":{"include_usage":true},"temperature":1,"text":{"format":{"type":"text"}},"tool_choice":"none","tools":[{"function":{"description":"example","name":"example","parameters":"example","strict":true},"type":"function"}],"top_k":1,"top_logprobs":1,"top_p":1,"truncation":"auto"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/responses \ --header 'Content-Type: application/json' \ --data '{ "adapter": { "generation": "5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a" }, "background": true, "dry_allowed_length": 1, "dry_base": 1, "dry_multiplier": 1, "dry_sequence_breakers": [ "example" ], "files": [ "example" ], "frequency_penalty": 1, "grammar": { "type": "regex", "value": "example" }, "include": [ "file_search_call.results" ], "input": [ { "content": [ { "annotations": [ { "end_index": 1, "file_citation": { "file_id": "example", "quote": "example" }, "start_index": 1, "text": "example", "type": "file_citation" } ], "text": "example", "type": "input_text" } ], "role": "example", "type": "message" } ], "instructions": "example", "logit_bias": "example", "logprobs": true, "max_output_tokens": 1, "max_tool_calls": 1, "max_tool_rounds": 1, "metadata": "example", "min_p": 1, "model": "example", "n": 1, "parallel_tool_calls": true, "presence_penalty": 1, "previous_response_id": "example", "reasoning": { "effort": "none", "summary": "concise" }, "repetition_penalty": 1, "response_format": { "type": "text" }, "stop": "example", "store": true, "stream": true, "stream_options": { "include_usage": true }, "temperature": 1, "text": { "format": { "type": "text" } }, "tool_choice": "none", "tools": [ { "function": { "description": "example", "name": "example", "parameters": "example", "strict": true }, "type": "function" } ], "top_k": 1, "top_logprobs": 1, "top_p": 1, "truncation": "auto" }'Request Body required
Section titled “Request Body required ”OpenResponses API create request
object
Resolve this alias when the request is admitted.
Pin this exact resident generation.
object
The 64-character hexadecimal generation ID returned by the adapter management API.
Example
5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5aWhether to run the request in background (async)
DRY allowed length (mistral.rs extension)
DRY base (mistral.rs extension)
DRY multiplier (mistral.rs extension)
DRY sequence breakers (mistral.rs extension)
Required output files to surface from tool calls (mistral.rs extension)
Frequency penalty (-2.0 to 2.0)
object
object
object
object
Top-level grammar configuration for LLGuidance
object
List of grammar configurations
Grammar configuration with lexer settings
object
The JSON schema that the grammar should generate
The Lark grammar that the grammar should generate
The name of this grammar, can be used in GenGrammar nodes
Maximum number of tokens to generate
object
Specifies additional content to include in the response
Simple text input
Array of input items (OpenResponses format)
object
object
File citation annotation
object
End index in the text
File citation details
object
File ID
Quote from the file
Start index in the text
The text that is annotated
URL citation annotation
object
End index in the text
Start index in the text
The text that is annotated
URL citation details
object
Title of the page
The URL
File path annotation
object
End index in the text
File path details
object
File ID
Start index in the text
The text that is annotated
Container file citation annotation
object
Container ID
End index in the text
File ID
Filename
Optional annotation index
Start index in the text
object
object
object
object
object
object
Additional instructions that guide the model’s behavior
Logit bias for token manipulation
Whether to return log probabilities
Maximum number of output tokens to generate
Maximum number of tool calls allowed.
NOTE: This parameter is not supported. Setting any value will return an error as mistral.rs does not support limiting the number of tool calls.
Maximum number of agentic tool rounds (mistral.rs extension)
User-provided metadata (up to 16 key-value pairs)
Min-p sampling (mistral.rs extension)
The model to use for this request
Number of completions to generate
Whether to allow parallel tool calls.
NOTE: Only true (default) or None is supported. Setting this to false
will return an error as mistral.rs does not support disabling parallel tool calls.
Presence penalty (-2.0 to 2.0)
ID of a previous response for multi-turn conversations
Repetition penalty (mistral.rs extension)
Free-form text response
object
Structured response as any JSON object
object
Structured response following a JSON schema
object
JSON Schema for structured responses
object
Multiple possible stop sequences
Single stop sequence
Whether to store the response for later retrieval
Whether to stream the response using server-sent events
Temperature for sampling (0-2)
Text output configuration
object
Plain text output
object
JSON output with optional schema
object
Name for the schema
JSON Schema definition
Whether to use strict schema validation
JSON object output
object
Disallow selection of tools.
Allow automatic selection of any given tool, or none.
Require at least one tool call.
object
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
Type of tool
Tool definitions available for the model to call
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
object
object
object
object
Top-k sampling (mistral.rs extension)
Number of top log probabilities to return
Top-p (nucleus) sampling parameter (0-1)
Responses
Section titled “ Responses ”Response resource or server-sent response events
The main response resource returned by the OpenResponses API
object
Exact LoRA generation used for this response.
Whether request runs in background
Unix timestamp when the response was completed (if completed)
Unix timestamp when the response was created
Frequency penalty from the request
Unique identifier for this response
System instructions (if provided)
Max output tokens from the request
Max tool calls from the request (even if unsupported)
User-provided metadata
The model used for this response
Object type (always “response”)
Output items generated by the model
object
object
object
object
object
Concatenated text from all text output content
Whether parallel tool calls are enabled
Presence penalty from the request
Previous response ID (for multi-turn conversations)
Reasoning/chain-of-thought content from the model
Current status of the response
Whether to store the response
Temperature from the request
Text configuration from the request
object
Plain text output
object
JSON output with optional schema
object
Name for the schema
JSON Schema definition
Whether to use strict schema validation
JSON object output
object
Disallow selection of tools.
Allow automatic selection of any given tool, or none.
Require at least one tool call.
object
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
Type of tool
Tool definitions from the request
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
object
object
object
object
Top logprobs from the request
Top-p from the request
Token usage information
object
Number of input tokens
Number of output tokens
Total number of tokens
Example
{ "incomplete_details": { "reason": "max_output_tokens" }, "output": [ { "content": [ { "type": "output_text" } ], "type": "message" } ], "status": "queued", "text": { "format": { "type": "text" } }, "tool_choice": "none", "tools": [ { "type": "function" } ], "truncation": "auto"}Response created event
object
The main response resource returned by the OpenResponses API
object
Exact LoRA generation used for this response.
Whether request runs in background
Unix timestamp when the response was completed (if completed)
Unix timestamp when the response was created
Frequency penalty from the request
Unique identifier for this response
System instructions (if provided)
Max output tokens from the request
Max tool calls from the request (even if unsupported)
User-provided metadata
The model used for this response
Object type (always “response”)
Output items generated by the model
object
object
object
object
object
Concatenated text from all text output content
Whether parallel tool calls are enabled
Presence penalty from the request
Previous response ID (for multi-turn conversations)
Reasoning/chain-of-thought content from the model
Current status of the response
Whether to store the response
Temperature from the request
Text configuration from the request
object
Plain text output
object
JSON output with optional schema
object
Name for the schema
JSON Schema definition
Whether to use strict schema validation
JSON object output
object
Disallow selection of tools.
Allow automatic selection of any given tool, or none.
Require at least one tool call.
object
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
Type of tool
Tool definitions from the request
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
object
object
object
object
Top logprobs from the request
Top-p from the request
Token usage information
object
Number of input tokens
Number of output tokens
Total number of tokens
Response in progress event
object
The main response resource returned by the OpenResponses API
object
Exact LoRA generation used for this response.
Whether request runs in background
Unix timestamp when the response was completed (if completed)
Unix timestamp when the response was created
Frequency penalty from the request
Unique identifier for this response
System instructions (if provided)
Max output tokens from the request
Max tool calls from the request (even if unsupported)
User-provided metadata
The model used for this response
Object type (always “response”)
Output items generated by the model
object
object
object
object
object
Concatenated text from all text output content
Whether parallel tool calls are enabled
Presence penalty from the request
Previous response ID (for multi-turn conversations)
Reasoning/chain-of-thought content from the model
Current status of the response
Whether to store the response
Temperature from the request
Text configuration from the request
object
Plain text output
object
JSON output with optional schema
object
Name for the schema
JSON Schema definition
Whether to use strict schema validation
JSON object output
object
Disallow selection of tools.
Allow automatic selection of any given tool, or none.
Require at least one tool call.
object
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
Type of tool
Tool definitions from the request
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
object
object
object
object
Top logprobs from the request
Top-p from the request
Token usage information
object
Number of input tokens
Number of output tokens
Total number of tokens
Output item added event
object
object
object
object
object
object
Content part added event
Text delta event
object
Content part done event
Output item done event
object
object
object
object
object
object
Function call arguments delta
object
Function call arguments done
object
Response completed event
object
The main response resource returned by the OpenResponses API
object
Exact LoRA generation used for this response.
Whether request runs in background
Unix timestamp when the response was completed (if completed)
Unix timestamp when the response was created
Frequency penalty from the request
Unique identifier for this response
System instructions (if provided)
Max output tokens from the request
Max tool calls from the request (even if unsupported)
User-provided metadata
The model used for this response
Object type (always “response”)
Output items generated by the model
object
object
object
object
object
Concatenated text from all text output content
Whether parallel tool calls are enabled
Presence penalty from the request
Previous response ID (for multi-turn conversations)
Reasoning/chain-of-thought content from the model
Current status of the response
Whether to store the response
Temperature from the request
Text configuration from the request
object
Plain text output
object
JSON output with optional schema
object
Name for the schema
JSON Schema definition
Whether to use strict schema validation
JSON object output
object
Disallow selection of tools.
Allow automatic selection of any given tool, or none.
Require at least one tool call.
object
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
Type of tool
Tool definitions from the request
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
object
object
object
object
Top logprobs from the request
Top-p from the request
Token usage information
object
Number of input tokens
Number of output tokens
Total number of tokens
Response failed event
object
The main response resource returned by the OpenResponses API
object
Exact LoRA generation used for this response.
Whether request runs in background
Unix timestamp when the response was completed (if completed)
Unix timestamp when the response was created
Frequency penalty from the request
Unique identifier for this response
System instructions (if provided)
Max output tokens from the request
Max tool calls from the request (even if unsupported)
User-provided metadata
The model used for this response
Object type (always “response”)
Output items generated by the model
object
object
object
object
object
Concatenated text from all text output content
Whether parallel tool calls are enabled
Presence penalty from the request
Previous response ID (for multi-turn conversations)
Reasoning/chain-of-thought content from the model
Current status of the response
Whether to store the response
Temperature from the request
Text configuration from the request
object
Plain text output
object
JSON output with optional schema
object
Name for the schema
JSON Schema definition
Whether to use strict schema validation
JSON object output
object
Disallow selection of tools.
Allow automatic selection of any given tool, or none.
Require at least one tool call.
object
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
Type of tool
Tool definitions from the request
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
object
object
object
object
Top logprobs from the request
Top-p from the request
Token usage information
object
Number of input tokens
Number of output tokens
Total number of tokens
Response incomplete event
object
The main response resource returned by the OpenResponses API
object
Exact LoRA generation used for this response.
Whether request runs in background
Unix timestamp when the response was completed (if completed)
Unix timestamp when the response was created
Frequency penalty from the request
Unique identifier for this response
System instructions (if provided)
Max output tokens from the request
Max tool calls from the request (even if unsupported)
User-provided metadata
The model used for this response
Object type (always “response”)
Output items generated by the model
object
object
object
object
object
Concatenated text from all text output content
Whether parallel tool calls are enabled
Presence penalty from the request
Previous response ID (for multi-turn conversations)
Reasoning/chain-of-thought content from the model
Current status of the response
Whether to store the response
Temperature from the request
Text configuration from the request
object
Plain text output
object
JSON output with optional schema
object
Name for the schema
JSON Schema definition
Whether to use strict schema validation
JSON object output
object
Disallow selection of tools.
Allow automatic selection of any given tool, or none.
Require at least one tool call.
object
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
Type of tool
Tool definitions from the request
Tool definition
object
Function definition for a tool
object
When true, the tool’s parameters JSON schema is enforced on the
generated arguments via constrained decoding (llguidance).
Type of tool
object
object
object
object
object
Top logprobs from the request
Top-p from the request
Token usage information
object
Number of input tokens
Number of output tokens
Total number of tokens
Error event
object
Error information for a response
object
Error code
Error message
Error type