Create response endpoint - OpenResponses API
const url = 'https://example.com/v1/responses';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"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 '{ "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
Whether 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 created