Responses API
The OpenAI Responses API, for clients built on client.responses.create such as the OpenAI Agents SDK. It runs on the same models, routing and billing as chat completions, and every chat model is available through it. Use the OpenAI SDK with base_url set to https://api.oxyy.ai/v1.
The count endpoint (client.responses.input_tokens.count in Python, client.responses.inputTokens.count in JavaScript) takes the same body and answers {"object": "response.input_tokens", "input_tokens": N}.
previous_response_id instead of resending the conversation; see multi-turn conversations. The hosted tools that need a service this gateway does not run (file_search, code_interpreter,computer_use, mcp) are refused with a 400; web_search andimage_generation are served.Code examples
# pip install openai import os from openai import OpenAI client = OpenAI( api_key=os.environ["OXYY_API_KEY"], base_url="https://api.oxyy.ai/v1" ) response = client.responses.create( model="gpt-5.5", instructions="Answer in one sentence.", input="What is the capital of France?" ) print(response.output_text)
// npm install openai import OpenAI from 'openai'; const client = new OpenAI({ apiKey: process.env.OXYY_API_KEY, baseURL: 'https://api.oxyy.ai/v1' }); const response = await client.responses.create({ model: 'gpt-5.5', instructions: 'Answer in one sentence.', input: 'What is the capital of France?' }); console.log(response.output_text);
curl https://api.oxyy.ai/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OXYY_API_KEY" \ -d '{"model": "gpt-5.5", "instructions": "Answer in one sentence.", "input": "What is the capital of France?"}'
Example response
{
"id": "resp_abc123def456",
"object": "response",
"created_at": 1700000000,
"status": "completed",
"model": "gpt-5.5",
"output": [
{
"id": "msg_abc123def456",
"type": "message",
"status": "completed",
"role": "assistant",
"content": [
{ "type": "output_text", "text": "The capital of France is Paris.", "annotations": [] }
]
}
],
"output_text": "The capital of France is Paris.",
"previous_response_id": null,
"store": false,
"usage": {
"input_tokens": 21,
"input_tokens_details": { "cached_tokens": 0, "cache_write_tokens": 0 },
"output_tokens": 8,
"output_tokens_details": { "reasoning_tokens": 0 },
"total_tokens": 29,
"cost": 0.000106
}
}Multi-turn conversations
The simplest way is to let the gateway keep the conversation: send only the next message in input and name the previous answer, as in client.responses.create(model=..., previous_response_id=response.id, input="Now double it."). The stored input and output items of every earlier turn are put ahead of your input, so the request is billed for the whole conversation, exactly as if you had sent it. instructions are not carried over: send them again on each turn that needs them.
| Stored responses | Detail |
|---|---|
| What is kept | The input items you sent with that request and the response object returned to you, encrypted at rest. |
| Who can read it | Your account only: any of its API keys, or you when signed in to the dashboard; no other account. Another account's id answers 404, as an unknown one does. |
| How long | 24 hours after the latest stored turn of its conversation. Continuing a conversation keeps all of its turns for another 24 hours. |
| Removing it | DELETE /v1/responses/{id} removes one response at once. A conversation that continues from a deleted turn is then a 404. |
| Not kept | Nothing is kept with store: false, for a model marked zero data retention in the catalogue, for a response that failed, for one over 4 MB (measured encrypted), or while the gateway's store is full. The returned store is then false. |
| Per account | Up to 16 MB of stored responses, measured encrypted. Past it the responses closest to expiry are removed first, never the conversation being continued; a conversation that alone outgrows it is no longer stored. |
| Earlier turns | At most 100 stored responses behind one previous_response_id. |
You can also keep the conversation in your application, and must with store: false: append the previous output items and the next user message to input, then send all of it again. Reasoning and function-call items from output can be sent back as they are.
history = [{"role": "user", "content": "Name a prime number."}]
response = client.responses.create(model="gpt-5.5", input=history, store=False)
print(response.output_text)
# With store=False nothing is kept: append the reply and the next
# question, then send the whole conversation again.
history += [item.model_dump(exclude_none=True) for item in response.output]
history.append({"role": "user", "content": "Now double it."})
response = client.responses.create(model="gpt-5.5", input=history, store=False)
print(response.output_text)const input = [{ role: 'user', content: 'Name a prime number.' }]; let response = await client.responses.create({ model: 'gpt-5.5', input, store: false }); console.log(response.output_text); // With store: false nothing is kept: append the reply and the next // question, then send the whole conversation again. input.push(...response.output, { role: 'user', content: 'Now double it.' }); response = await client.responses.create({ model: 'gpt-5.5', input, store: false }); console.log(response.output_text);
Supported features
| Feature | Status | Notes |
|---|---|---|
input as a string or a list of items | Supported | message, function_call, function_call_output and reasoning items |
instructions, max_output_tokens, temperature, top_p | Supported | |
stream | Supported | Server-sent events such as response.output_text.delta and response.completed |
Function tools, tool_choice, parallel_tool_calls | Supported | tool_choice accepts none, auto, required, a function or allowed_tools |
text.format | Supported | text, json_object and json_schema |
reasoning.effort | Supported | |
input_image and input_file parts | Supported | Images as a URL or a data URL; files as file_data (a data URL) or a file_id from this gateway's POST /v1/files. file_url is refused. |
Hosted tool: image_generation | Supported | Its size, quality, background and output_format drive an image model; other fields on the tool are reported as dropped. |
Hosted tool: web_search / web_search_preview | Supported | Becomes web_search_options on the chat request, so the model answers from the live web and cites its sources as url_citation annotations. search_context_size and user_location are honoured; other fields on the tool are reported as dropped. The provider bills the search on top of the tokens. |
store | Supported | On by default, as on OpenAI: the response is kept, encrypted, for 24 hours after the latest stored turn of its conversation. store: false keeps nothing. The returned store says whether it was kept; see stored responses for when it is not. |
include, truncation, metadata | Supported | Accepted; metadata is echoed on the response object |
previous_response_id | Supported | Continues a stored conversation: its earlier input and output items are put ahead of input, and the request is billed for all of them. instructions are not carried over. An id that is unknown, expired, deleted or another account's is a 404 (previous_response_not_found); a conversation longer than 100 stored responses is a 400 (previous_response_chain_too_long). |
conversation | Not supported | Refused with a 400. Use previous_response_id. |
background, stored prompt templates, item_reference items | Not supported | Refused with a 400 |
Other hosted tools: file_search, code_interpreter, computer_use, mcp, shell | Not supported | Refused with a 400. Declare a function tool and run it in your application. |
POST /v1/responses/input_tokens | Supported | The same body, answered with {object: "response.input_tokens", input_tokens}. A previous_response_id is counted with its stored conversation. Counted by the serving provider's own count endpoint where it has one, else estimated by this gateway; the X-Oxyy-Token-Count header says which (provider or estimate). Free, and it does not spend your rate limit: counting has its own budget per key, ten times your tier's requests per minute and at least 600 a minute. |
GET /v1/responses/{id}, DELETE /v1/responses/{id} | Supported | Retrieve or delete a stored response of your account. Retrieving with stream=true is refused with a 400. |
GET /v1/responses/{id}/input_items | Supported | That request's own input items (not the earlier turns it continued), as a list with limit (1 to 100, default 20), order (asc or desc, default desc) and after |
POST /v1/responses/{id}/cancel | Not supported | Background responses are not supported, so there is nothing to cancel |
