Documentation
Responses
/v1/responses
The /v1/responses endpoint is an advanced API for interacting with models that support structured, multi-step, and agentic behaviors. Unlike the standard /v1/chat/completions endpoint which is designed for conversational interactions, /v1/responses provides a more powerful interface for tasks that may involve complex instructions, tool usage, and observable reasoning steps from the model.
This endpoint is ideal for building applications that require a model to "think" or follow a chain of thought before producing a final answer, making it suitable for complex problem-solving, data analysis, and agent-like functionalities.
When to Use This Endpoint
/v1/responses when you need observable reasoning steps, structured outputs, or when building agentic systems that require the model to "think through" complex problems before providing a final answer.Supported Models
Only models specifically designed for the "responses" API type can be used with this endpoint. Using a model of type chat/completion or any other type will result in an error.
| Model ID | Provider | Description | Available Plans |
|---|---|---|---|
| provider-5/gpt-5-codex | OpenAI | Advanced model with reasoning and multimodal support, ideal for complex tasks like coding and analysis. | ultra |
Model Availability
Headers
Authorization
stringBearer ddc-a4f-xxxxxxxx. See Authentication.Content-Type
stringDefault: application/json
Request Body
This endpoint expects a JSON object in the request body with the following fields:
model
stringprovider-5/gpt-5-codex. See Models.input
string | array of objectsrole
stringcontent
string | array | nullname
stringtool_calls
array of objectstool_call_id
stringinstructions
stringtools
array of objectstool_choice
string | object"auto").stream
booleanDefault: false
store
booleanprevious_response_id
stringtemperature
numberDefault: 1
top_p
numbermax_tokens
integertext
objectStreaming Not Yet Supported
stream: true) is not yet supported for this endpoint and will result in an error.Example Request & Response
Here's a complete example showing how the endpoint works:
Example Request:
{
"model": "provider-5/gpt-5-codex",
"input": [
{
"role": "user",
"content": "Analyze the correlation between user engagement and feature adoption."
}
],
"instructions": "You are a data analyst. Provide step-by-step reasoning before your final answer.",
"max_tokens": 1024,
"temperature": 0.5
}Example Response:
{
"id": "resp_abc123def456",
"object": "response",
"created_at": 1729584251,
"model": "provider-5/gpt-5-codex",
"output": [
{
"id": "reasoning_1",
"type": "reasoning",
"content": [
"Step 1: Acknowledge the user's request to find a correlation.",
"Step 2: Formulate a plan to analyze the data.",
"Step 3: Perform the correlation calculation.",
"Step 4: Structure the final answer as a JSON object."
],
"summary": [
"User wants correlation analysis. I will outline steps and provide final JSON output."
]
},
{
"id": "msg_xyz789",
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "{\"correlation_factor\": 0.82, \"summary\": \"Strong positive correlation found...\"}",
"annotations": [],
"logprobs": []
}
],
"status": "completed"
}
],
"usage": {
"prompt_tokens": 56,
"completion_tokens": 121,
"total_tokens": 177
}
}Response Body (200 OK)
A successful request returns a JSON object with a structured output array that separates the model's reasoning from its final message:
id
stringresp_.object
string"response".created_at
integermodel
stringoutput
array of objectsid
stringtype
string"message".role
string"assistant".content
array of objectsstatus
stringid
stringtype
string"reasoning".content
arraysummary
arraytype
string"output_text".text
stringannotations
arraylogprobs
arrayusage
objectprompt_tokens
integercompletion_tokens
integertotal_tokens
integerRate Limiting
This endpoint is rate-limited. Your current limits are returned in the following response headers on every successful request:
X-RateLimit-Limit-Minute: Your RPM (Requests Per Minute) limitX-RateLimit-Remaining-Minute: Requests remaining in the current minuteX-RateLimit-Reset-Minute: The UTC timestamp when your minute limit will resetX-RateLimit-Limit-Day: Your RPD (Requests Per Day) limitX-RateLimit-Remaining-Day: Requests remaining in the current dayX-RateLimit-Reset-Day: The UTC timestamp when your daily limit will reset
Error Handling
The endpoint uses standard HTTP status codes to indicate the success or failure of a request:
- 400 Bad Request: The request payload is invalid. This can be due to malformed JSON, missing required fields like
modelorinput, or using a model that is not of typeresponses. - 401 Unauthorized: Your API key is missing, invalid, or expired.
- 403 Forbidden: Your API key is valid but does not have permission to perform the request. This can occur if the model is disabled by an administrator, not available for your current subscription plan, on your API key's blacklist, or your API key has a whitelist and the model is not on it.
- 404 Not Found: The requested model ID does not exist.
- 429 Too Many Requests: You have exceeded your rate limit (RPM or RPD).
- 500 Internal Server Error: An unexpected error occurred on the server.
- 501 Not Implemented: The provider for the requested model does not support the
/v1/responsesendpoint.
Key Differences from /v1/chat/completions
While both endpoints generate text, they are designed for different purposes:
| Feature | /v1/chat/completions | /v1/responses |
|---|---|---|
| Primary Input | messages | input |
| System Prompt | ChatMessage with role: "system" | Dedicated instructions field |
| Primary Output | choices | output |
| Output Structure | Single message object | Sequence of reasoning + message items |
| Primary Use Case | Conversational AI, chatbots | Agentic workflows, chain-of-thought |
Was this page helpful?