Responses Format
OpenAI Responses API for creating model responses. Supports multi-turn chat, tool calls, and reasoning.
Note: Full path: POST /v1/responses. input may be a string or message array; use previous_response_id for multi-turn chats.Also supports usage.include, models and provider.sort; see the request body below.
Example model
Examples below use gpt-4o (GPT-4o). Replace model and adjust size, quality, etc. per console docs when switching models.
Create response
POST
https://token.easyapi.com/v1/responsesCreate a model response with the OpenAI Responses API. Supports multi-turn chat, tool calls, and reasoning.
Request parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Authorization | header | string | Yes | EasyAPI API Key. Format: Bearer `API_KEY` |
Content-Type | header | string | Yes | Request body format |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID |
input | string | array<object> | No | Input content as a string or message array |
instructions | string | No | System-level instructions for model behavior |
max_output_tokens | integer | No | Maximum output tokens |
temperature | number | No | Sampling temperature |
top_p | number | No | Nucleus sampling parameter |
stream | boolean | No | Enable streaming responses |
tools | array<object> | No | Tool definitions the model may call |
tool_choice | string | object | No | Tool choice strategy, string or object |
reasoning | object | No | Reasoning configuration |
previous_response_id | string | No | Previous response ID for multi-turn chat |
truncation | string | No | Truncation strategy: auto |
usage | object | No | Set usage.include = true to add a cost field (USD for this request) to the usage object; for streaming it arrives in the final chunk that carries usage. The final charge is reported by GET /v1/generation |
models | array<string> | No | Fallback model sequence (up to 5). When the primary model has no available channel, or the upstream fails before any output is sent, the next model is tried in order; limited to models this key may use |
provider | object | No | Routing preference within the same priority tier: provider.sort = price picks the cheapest channel; latency picks the lowest measured time-to-first-token (end-to-end latency for non-streaming); throughput picks the highest measured output tokens/s. latency and throughput use live measurements of this model on each channel and fall back to channel health-check timing when no measurements exist. The model suffix :floor equals sort=price and :nitro equals sort=throughput |
Example
{
"model": "gpt-4o",
"input": "Hello!",
"instructions": "You are a helpful assistant.",
"max_output_tokens": 1024,
"usage": {
"include": true
}
}Response example
{
"id": "resp_abc123",
"object": "response",
"created_at": 1718452800,
"status": "completed",
"model": "gpt-4o",
"output": [
{
"type": "message",
"id": "msg_abc123",
"status": "completed",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "Hello! How can I help you today?"
}
]
}
],
"usage": {
"prompt_tokens": 15,
"completion_tokens": 12,
"total_tokens": 27,
"prompt_tokens_details": {
"cached_tokens": 0,
"text_tokens": 15,
"audio_tokens": 0,
"image_tokens": 0
},
"completion_tokens_details": {
"text_tokens": 12,
"audio_tokens": 0,
"reasoning_tokens": 0
},
"cost": 0.0000875
}
}