Create a model response
OpenAI-compatible Responses API. Provide text or structured input to generate a response with optional tool calling, reasoning, and streaming.
Storage: A response is stored when data store is enabled on the model and store is not false. Continue that chain with previous_response_id, or pass history yourself with previous_input_messages. Retrieve and delete stored responses with GET and DELETE /v1/responses/{response_id}.
Unsupported: background: true is rejected. This endpoint does not support batch requests.
curl --request POST \
--url https://api.synapsai.cloud/v1/responses \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"max_tool_calls": 123,
"metadata": {},
"logit_bias": {},
"parallel_tool_calls": true,
"prompt": {},
"reasoning": {},
"service_tier": "auto",
"store": false,
"stream": false,
"temperature": 123,
"text": {},
"tool_choice": "auto",
"tools": [
{}
],
"top_logprobs": 0,
"top_p": 123,
"top_k": 123,
"truncation": "disabled",
"skip_special_tokens": true,
"presence_penalty": 123,
"frequency_penalty": 123,
"cache_salt": "<string>",
"repetition_penalty": 123,
"seed": 123,
"stop": "<string>",
"structured_outputs": {},
"chat_template_kwargs": {},
"include": [
"<string>"
],
"previous_input_messages": [
{}
],
"previous_response_id": "<string>",
"background": false
}
'import requests
url = "https://api.synapsai.cloud/v1/responses"
payload = {
"model": "<string>",
"input": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"max_tool_calls": 123,
"metadata": {},
"logit_bias": {},
"parallel_tool_calls": True,
"prompt": {},
"reasoning": {},
"service_tier": "auto",
"store": False,
"stream": False,
"temperature": 123,
"text": {},
"tool_choice": "auto",
"tools": [{}],
"top_logprobs": 0,
"top_p": 123,
"top_k": 123,
"truncation": "disabled",
"skip_special_tokens": True,
"presence_penalty": 123,
"frequency_penalty": 123,
"cache_salt": "<string>",
"repetition_penalty": 123,
"seed": 123,
"stop": "<string>",
"structured_outputs": {},
"chat_template_kwargs": {},
"include": ["<string>"],
"previous_input_messages": [{}],
"previous_response_id": "<string>",
"background": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "response",
"created_at": 123,
"model": "<string>",
"status": "completed",
"output": [
{
"id": "<string>",
"type": "<string>",
"role": "<string>",
"status": "in_progress",
"content": [
{}
],
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>"
}
],
"output_text": "<string>",
"instructions": "<string>",
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"error": {
"code": "<string>",
"message": "<string>"
},
"incomplete_details": {
"reason": "max_output_tokens"
}
}Body
Request body for the OpenAI-compatible Responses API. The primary input field is input.
Model ID to use for this request. Required.
Text or structured input to the model. Required.
System or developer instructions inserted into the model context, separate from input.
Maximum number of tokens the model may generate in the response.
Maximum number of tool calls the model may make during generation.
Optional key-value metadata attached to the request.
Mapping from token ID to a bias value added to the token logits.
Show child attributes
Show child attributes
Whether the model may call multiple tools in parallel.
Optional prompt template configuration.
Optional reasoning configuration for supported models.
Service tier hint for request scheduling.
auto, default, flex, scale, priority When data store is enabled on the model, omit this or set it to true to persist the response. false skips storage. When data store is disabled, the response is not stored.
If true, stream partial response events as Server-Sent Events (SSE).
Sampling temperature; higher values increase randomness.
Text output configuration, including structured output format via text.format.
Controls which tool the model calls. Accepts a string (for example, auto, none, required) or an object specifying a function.
Optional list of tool definitions the model may call.
Return the top N token logprobs at each position when logprobs are enabled.
Nucleus sampling cumulative probability threshold.
Keep only the top_k tokens by probability at each generation step.
Truncation strategy for inputs that exceed the model context window.
auto, disabled Whether to skip special tokens in the generated output.
Penalty applied to discourage new token presence.
Penalty applied based on token frequency to reduce repetition.
Optional salt for prefix caching.
Additional repetition control for generation.
Optional random seed for reproducibility.
Stop sequence or list of sequences where generation should halt.
Structured output schema configuration.
Additional keyword arguments passed to the model chat template.
Additional output fields to include in the response.
Prior conversation messages to include when continuing a multi-turn exchange without server-side response storage.
Id of a stored response to continue. The stored input and output are prepended to input. The id must belong to the caller.
Not supported. Requests with background: true are rejected with a validation error because responses are not stored.
Response
Model response
OpenAI-compatible response object returned by the Responses API.
Unique identifier for this response.
Object type. Always response.
Unix timestamp (seconds) when the response was created.
Model identifier used to generate the response.
Status of the response generation.
completed, failed, in_progress, incomplete, cancelled Typed output items produced by the model (for example, messages, function calls, or reasoning items).
Show child attributes
Show child attributes
Convenience field containing concatenated text output from the response.
System or developer instructions used for this response.
Token usage details for the request.
Show child attributes
Show child attributes
Error details when generation fails.
Show child attributes
Show child attributes
Details about why the response ended before completion.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.synapsai.cloud/v1/responses \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"input": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"max_tool_calls": 123,
"metadata": {},
"logit_bias": {},
"parallel_tool_calls": true,
"prompt": {},
"reasoning": {},
"service_tier": "auto",
"store": false,
"stream": false,
"temperature": 123,
"text": {},
"tool_choice": "auto",
"tools": [
{}
],
"top_logprobs": 0,
"top_p": 123,
"top_k": 123,
"truncation": "disabled",
"skip_special_tokens": true,
"presence_penalty": 123,
"frequency_penalty": 123,
"cache_salt": "<string>",
"repetition_penalty": 123,
"seed": 123,
"stop": "<string>",
"structured_outputs": {},
"chat_template_kwargs": {},
"include": [
"<string>"
],
"previous_input_messages": [
{}
],
"previous_response_id": "<string>",
"background": false
}
'import requests
url = "https://api.synapsai.cloud/v1/responses"
payload = {
"model": "<string>",
"input": "<string>",
"instructions": "<string>",
"max_output_tokens": 123,
"max_tool_calls": 123,
"metadata": {},
"logit_bias": {},
"parallel_tool_calls": True,
"prompt": {},
"reasoning": {},
"service_tier": "auto",
"store": False,
"stream": False,
"temperature": 123,
"text": {},
"tool_choice": "auto",
"tools": [{}],
"top_logprobs": 0,
"top_p": 123,
"top_k": 123,
"truncation": "disabled",
"skip_special_tokens": True,
"presence_penalty": 123,
"frequency_penalty": 123,
"cache_salt": "<string>",
"repetition_penalty": 123,
"seed": 123,
"stop": "<string>",
"structured_outputs": {},
"chat_template_kwargs": {},
"include": ["<string>"],
"previous_input_messages": [{}],
"previous_response_id": "<string>",
"background": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "response",
"created_at": 123,
"model": "<string>",
"status": "completed",
"output": [
{
"id": "<string>",
"type": "<string>",
"role": "<string>",
"status": "in_progress",
"content": [
{}
],
"call_id": "<string>",
"name": "<string>",
"arguments": "<string>"
}
],
"output_text": "<string>",
"instructions": "<string>",
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
},
"error": {
"code": "<string>",
"message": "<string>"
},
"incomplete_details": {
"reason": "max_output_tokens"
}
}