OpenAI Responses API
This platform provides a unified endpoint compatible with the OpenAI Responses API.
This document is intended for client-side integrators and focuses on the public request path, authentication method, request parameters, and example payloads. Aside from the differences in request and response protocol compared with Chat Completions, the supported model range is the same as /docs/api-reference/text/openai-chat-api.
Overview:
- Endpoint:
POST /v1/responses - Capability type: unified text generation / multi-turn input orchestration
- Response modes:
- When
stream = falseor omitted: standard JSON response - When
stream = true:text/event-streamSSE response
- When
- Protocol style: the request body uses
inputas the primary field instead of the Chat Completionsmessagestop-level structure
Current scope:
- Covers only
POST /v1/responses - Compared with
/docs/api-reference/text/openai-chat-api, the main difference is protocol structure, not model availability - Does not cover other OpenAI endpoints such as embeddings, images, or audio
1. API Overview
- HTTP method:
POST - Request path:
/v1/responses - Content-Type:
application/json - Response type:
- Non-streaming:
application/json - Streaming:
text/event-stream
- Non-streaming:
2. Authentication and Headers
Example headers:
Authorization: Bearer YOUR_REACH_API_KEY
Content-Type: application/jsonAt least one of Authorization or x-api-key must be provided.
Header details:
| Header | Required | Description |
|---|---|---|
Authorization | No | Platform API key in the format Bearer sk-xxxxxx |
x-api-key | No | You can also pass the platform API key directly in this header |
Content-Type | Yes | Must be application/json |
3. Request Body
The request body follows the common OpenAI Responses API object structure:
{
"model": "YOUR_MODEL_ID",
"input": "Please introduce yourself in one sentence.",
"instructions": "You are a professional technical assistant.",
"temperature": 0.2,
"stream": false
}3.1 Top-Level Parameters
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID |
input | string or array<object> | Yes | Input content. Can be plain text or an array of structured content blocks |
instructions | string | No | System instructions |
temperature | number | No | Sampling temperature |
top_p | number | No | Nucleus sampling parameter |
max_output_tokens | integer | No | Maximum number of output tokens |
stream | boolean | No | Whether to return SSE streaming output |
tools | array<object> | No | Tool definitions |
tool_choice | string or object | No | Tool calling strategy |
parallel_tool_calls | boolean | No | Whether parallel tool calls are allowed |
response_format | object | No | Structured output configuration |
user | string | No | End-user identifier |
3.2 input Parameter
input can be passed either as a plain string or as a structured array. Common forms include:
Text example:
"Please summarize the main idea of this document in one sentence."Structured input example:
[
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "Please describe the image."
},
{
"type": "input_image",
"image_url": "https://cdn.example.com/demo.png"
}
]
}
]4. Request Examples
4.1 Standard Non-Streaming Request
curl -X POST "https://direct.reachapi.ai/v1/responses" \
-H "Authorization: Bearer YOUR_REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"input": "Introduce ReachAPI in one sentence.",
"temperature": 0.2
}'4.2 Streaming Request
curl -X POST "https://direct.reachapi.ai/v1/responses" \
-H "Authorization: Bearer YOUR_REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"input": "Summarize today'\''s priorities in three lines.",
"stream": true
}'4.3 Request with Tool Definitions
curl -X POST "https://direct.reachapi.ai/v1/responses" \
-H "Authorization: Bearer YOUR_REACH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL_ID",
"input": "Help me check the weather in Shanghai.",
"tools": [
{
"type": "function",
"name": "get_weather",
"description": "Get weather information for a city",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": ["city"]
}
}
],
"tool_choice": "auto"
}'5. Successful Response
Example non-streaming response:
{
"id": "resp_123",
"object": "response",
"created_at": 1710000000,
"model": "YOUR_MODEL_ID",
"status": "completed",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "ReachAPI is a unified AI API platform for enterprise use."
}
]
}
],
"usage": {
"input_tokens": 25,
"output_tokens": 20,
"total_tokens": 45
}
}Streaming response (SSE) example:
event: response.created
data: {"id":"resp_123","object":"response","status":"in_progress"}
event: response.output_text.delta
data: {"delta":"ReachAPI is a unified"}
event: response.output_text.delta
data: {"delta":" AI API platform for enterprise use."}
event: response.completed
data: {"id":"resp_123","status":"completed"}6. Error Response
OpenAI-style error example:
{
"error": {
"message": "Field `input` is required",
"type": "invalid_request_error",
"param": null,
"code": "MISSING_REQUIRED_FIELD"
}
}Common scenarios:
- Missing
modelin the request body - Missing
inputin the request body - Invalid JSON payload
- Authentication failure
7. Compatibility Notes
- This document lists commonly used fields and example payloads. Actual field names and structures follow the OpenAI Responses API.
- Compared with Chat Completions, the main differences in the Responses API are the input protocol (
input/instructions) and the response structure. - If you use newer or experimental official fields, validate them against the actual capabilities available on your gateway.
8. Main Differences from Chat Completions
| Category | Chat Completions | Responses |
|---|---|---|
| Path | /v1/chat/completions | /v1/responses |
| Main input fields | messages | input + instructions |
| Main output structure | choices[].message | output[] |
| Streaming events | chat.completion.chunk | response.* event stream |
9. Supported Models and Reference Pricing
The following prices are summarized from the unified pricing document. Aside from protocol differences, this endpoint supports the same model range as /docs/api-reference/text/openai-chat-api. Pricing was checked on 2026-04-17. For detailed pricing rules, refer to gpt.md.
| Model | Input | Cached input | Output |
|---|---|---|---|
gpt-5.4 | $2.50 / 1M tokens | $0.25 / 1M tokens | $15.00 / 1M tokens |
gpt-5.3-codex | $1.75 / 1M tokens | $0.175 / 1M tokens | $14.00 / 1M tokens |
gpt-5.2 | $1.75 / 1M tokens | $0.175 / 1M tokens | $14.00 / 1M tokens |
gpt-5.1-codex | $1.25 / 1M tokens | $0.125 / 1M tokens | $10.00 / 1M tokens |
gpt-5.1 | $1.25 / 1M tokens | $0.125 / 1M tokens | $10.00 / 1M tokens |
gpt-5 | $1.25 / 1M tokens | $0.125 / 1M tokens | $10.00 / 1M tokens |
gpt-5.4-mini | $0.75 / 1M tokens | $0.075 / 1M tokens | $4.50 / 1M tokens |
gpt-5-mini | $0.25 / 1M tokens | $0.025 / 1M tokens | $2.00 / 1M tokens |
Notes:
Cached inputrefers to the unit price for cache-hit input tokens- If the model list changes over time, use the dashboard or product configuration as the source of truth for currently enabled models
10. References
- OpenAI Responses API: https://platform.openai.com/docs/api-reference/responses/create
- OpenAI text generation guide: https://platform.openai.com/docs/guides/text
- OpenAI API errors: https://platform.openai.com/docs/guides/error-codes/api-errors
- Unified platform pricing document:
gpt.md