Developer Docs › Responses API

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

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)

GET /v1/responses/{id} retrieval, file uploads (/v1/files) and background mode (background) are not supported. Continuations that rely on previous_response_id may break across routes; if they fail, switch to the full-history style above.