Responses API
OpenAI's next-generation Responses endpoint, used by default by Codex CLI and similar tools.
Endpoint
POST https://api.onefast.ai/v1/responses
Authorization: Bearer sk-xxx
The Responses API is OpenAI's recommended new endpoint, with reasoning summaries, built-in tools, multi-turn state and more. It is the endpoint Codex CLI uses (see Codex CLI). It works with GPT models.
Basic request
cURL
curl https://api.onefast.ai/v1/responses \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"input": "Write a haiku about the sea.",
"max_output_tokens": 200
}'
Python
from openai import OpenAI
client = OpenAI(api_key="sk-xxx", base_url="https://api.onefast.ai/v1")
resp = client.responses.create(model="gpt-5.5", input="Write a haiku about the sea.")
print(resp.output_text)
Node.js
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "sk-xxx", baseURL: "https://api.onefast.ai/v1" });
const resp = await client.responses.create({ model: "gpt-5.5", input: "Write a haiku about the sea." });
console.log(resp.output_text);
Common parameters
| Parameter | Description |
|---|---|
model |
Required. A GPT model |
input |
Required. A string, or an array of messages [{"role": "user", "content": "..."}] |
instructions |
System instructions |
max_output_tokens |
Maximum output tokens (including reasoning tokens) |
reasoning |
Reasoning settings, e.g. {"effort": "high", "summary": "auto"} |
tools |
Function tools and more |
stream |
Stream the response; event types include response.output_text.delta and response.completed |
previous_response_id |
Optional. Continue from a previous turn; see "Multi-turn conversations" below |
store |
Optional. With false this turn is not saved and cannot be referenced later; an explicit value is forwarded to the model as is |
Multi-turn conversations
We recommend sending the full history in input on every turn (stateless style) — it's the most reliable on every route:
Python
history = [{"role": "user", "content": "My name is Alex"}]
r1 = client.responses.create(model="gpt-5.5", input=history)
history += [{"role": "assistant", "content": r1.output_text}, {"role": "user", "content": "What's my name?"}]
r2 = client.responses.create(model="gpt-5.5", input=history)
print(r2.output_text)
Continuing with previous_response_idAlpha
Most users do not need this. Sending the full history every turn (the style above) is the most reliable on every route and is recommended.
Some GPT routes are backed by Azure OpenAI resources spread across several regions, so two turns of the same conversation can land on resources in different regions. Conversation records and encrypted reasoning stored by the upstream cannot be read across resources, so relying on upstream continuation directly can fail with errors such as "previous response not found" or encrypted content that cannot be decrypted. On these routes the gateway therefore keeps the conversation history itself: when it receives previous_response_id it expands the history before sending; when encrypted reasoning sent by your client cannot be decrypted on the current resource, the gateway removes that reasoning and retries once automatically. This handling is still in Alpha, and information that existed only in the previous turn's reasoning may not carry over across resources.
You can also send only the new input and point previous_response_id at the previous response ID:
Python
r1 = client.responses.create(model="gpt-5.5", input="My name is Alex")
r2 = client.responses.create(model="gpt-5.5", previous_response_id=r1.id, input="What's my name?")
- Continuation relies on temporarily stored conversation records, which expire after the conversation has been inactive for a while.
- The previous turn's
instructionsandtoolsare not inherited; pass them again on each turn if you need them. - Turns sent with
"store": falseare not saved and cannot be referenced byprevious_response_idlater. - If the previous turn cannot be found, you get a 400 error such as
Previous response with id ... not found; switch to the full-history style above.
For conversations that must persist long-term or across days, keep the history in your own system and use the full-history style.
Unsupported endpoints
The following endpoints always return 404 with error.code set to unsupported_endpoint:
| Endpoint | Purpose |
|---|---|
GET /v1/responses/{id} |
Retrieve a stored response |
DELETE /v1/responses/{id} |
Delete a response |
GET /v1/responses/{id}/input_items |
List a response's input items |
POST /v1/responses/{id}/cancel |
Cancel a background response |
{"error": {"message": "Retrieving, deleting, listing input items of, or cancelling stored responses is not supported on this endpoint. To continue a conversation, send POST /v1/responses with previous_response_id.", "type": "invalid_request_error", "param": "response_id", "code": "unsupported_endpoint"}}
File uploads (
/v1/files) and background mode (background) are not supported either.