Responses API

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.

POSThttps://api.oxyy.ai/v1/responses
POSThttps://api.oxyy.ai/v1/responses/input_tokensfree; does not spend your rate limit
GEThttps://api.oxyy.ai/v1/responses/{id}a stored response
DELETEhttps://api.oxyy.ai/v1/responses/{id}
GEThttps://api.oxyy.ai/v1/responses/{id}/input_items

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}.

Responses are stored unless you send store: false. As on OpenAI, a response is kept so the next turn can name it with 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

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 responsesDetail
What is keptThe input items you sent with that request and the response object returned to you, encrypted at rest.
Who can read itYour 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 long24 hours after the latest stored turn of its conversation. Continuing a conversation keeps all of its turns for another 24 hours.
Removing itDELETE /v1/responses/{id} removes one response at once. A conversation that continues from a deleted turn is then a 404.
Not keptNothing 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 accountUp 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 turnsAt 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

FeatureStatusNotes
input as a string or a list of itemsSupportedmessage, function_call, function_call_output and reasoning items
instructions, max_output_tokens, temperature, top_pSupported
streamSupportedServer-sent events such as response.output_text.delta and response.completed
Function tools, tool_choice, parallel_tool_callsSupportedtool_choice accepts none, auto, required, a function or allowed_tools
text.formatSupportedtext, json_object and json_schema
reasoning.effortSupported
input_image and input_file partsSupportedImages 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_generationSupportedIts 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_previewSupportedBecomes 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.
storeSupportedOn 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, metadataSupportedAccepted; metadata is echoed on the response object
previous_response_idSupportedContinues 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).
conversationNot supportedRefused with a 400. Use previous_response_id.
background, stored prompt templates, item_reference itemsNot supportedRefused with a 400
Other hosted tools: file_search, code_interpreter, computer_use, mcp, shellNot supportedRefused with a 400. Declare a function tool and run it in your application.
POST /v1/responses/input_tokensSupportedThe 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}SupportedRetrieve or delete a stored response of your account. Retrieving with stream=true is refused with a 400.
GET /v1/responses/{id}/input_itemsSupportedThat 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}/cancelNot supportedBackground responses are not supported, so there is nothing to cancel