Skip to main content
/v1/responses is OpenAI’s current flagship native endpoint. In OpenAI’s own words: “While Chat Completions remains supported, Responses is recommended for all new projects.” APIYI fully supports this endpoint — just point base_url at https://api.apiyi.com/v1. This page is based on the official OpenAI documentation (developers.openai.com/api/docs, as of June 2026). All examples are copy-paste ready.

Why Responses

Compared with Chat Completions, OpenAI cites three hard numbers:
  • Better reasoning: the same reasoning model scores about 3% higher on SWE-bench via Responses (reasoning state persists across turns)
  • Cheaper input: cache utilization is 40%–80% higher than Chat Completions (OpenAI internal testing), which directly cuts your input bill
  • More tools: built-in tools like web_search and code_interpreter are Responses-only
When Chat Completions is still the right choice: you rely on existing frameworks (LangChain and most clients default to /v1/chat/completions), or you want one codebase that also calls Claude, Gemini, and other non-OpenAI models — see Compatible Mode.
What is deprecated is the Assistants API (scheduled to shut down on August 26, 2026 (UTC)), not Chat Completions. Both endpoints remain supported long-term; new features simply land on Responses first.

Quick Start

Prefer response.output_text over hand-written output[0].content[0].text — for reasoning models, the first item in output is often a reasoning item, not a message, so hard-coded indexing breaks.

Request Parameters

gpt-5 series reasoning models do not support temperature / top_p — passing them raises an error. Use reasoning.effort and text.verbosity instead.

Response Structure

output is an array of items. The three common types: reasoning (reasoning summary), message (text reply), and function_call (a function call request). A trimmed example:
Two usage fields worth watching:
  • input_tokens_details.cached_tokens: input that hit the cache (billed at 0.1×)
  • output_tokens_details.reasoning_tokens: reasoning spend (billed at the output rate; tune with reasoning.effort)

Multi-turn: maintain history yourself

When calling the Responses API through APIYI, pass the full history as the input array (each entry with role / content), the same approach as Chat Completions:
Server-side state is unavailable on APIYI — do not rely on it. Tested through the gateway (multiple models, with retry delays):
  • previous_response_id: accepted without error (returns 200), but the next turn does not remember the previous one (input_tokens reflects only the current turn, no history loaded);
  • GET /v1/responses/{id}: returns 400 — stored responses cannot be retrieved;
  • conversation objects (/v1/conversations): return 404 — not supported.
So store / previous_response_id / conversation should not be used on APIYI; always use the “input array with self-managed history” approach above. Full cross-format guidance: Multi-Turn Conversation Guide.
Multi-turn does not reduce input billing: every turn resends the full history, all billed as input tokens. Long conversations save money through cache discounts (the historical prefix auto-hits the 0.1× cache rate) — see Cache Billing.

Reasoning and Output Controls

Choosing reasoning.effort

text.verbosity

low / medium (default) / high controls answer length. Responses-only:

Streaming

Responses streams semantic events, not the generic choices[0].delta chunks of Chat Completions. Core events:

Built-in Tools

Built-in tools are a Responses-only capability — declare them in tools and OpenAI executes them server-side: Minimal web_search example:
Built-in tools execute on OpenAI’s side; pass-through support per tool on the APIYI channel should be confirmed by testing. Custom function calling is fully supported — see Function Calling.

Pro Models and Background Mode

gpt-5.4-pro and gpt-5.5-pro are deep-reasoning models for professional workloads ($30 / $180 per million tokens, svip group only) and are, in practice, available via /v1/responses only. A single request can take minutes — pair them with background: true:
Pro models are expensive and slow — the trade is “minutes of waiting for a more reliable answer”. For everyday development use gpt-5.4 / gpt-5.5; don’t reach for Pro without a clear deep-reasoning need.

Supported Models and Pricing

Pinned date versions (e.g. gpt-5.4-2026-03-05) are also available at the same price. Full list: Models & Pricing.

Mapping from Chat Completions

Starting with GPT-5.4 (including gpt-5.6-sol / gpt-5.6-terra / gpt-5.6-luna), tool calling combined with an explicit reasoning effort can be rejected on /v1/chat/completions: a request that carries tools while explicitly sending a non-none reasoning_effort fails with a 400 — Function tools with reasoning_effort are not supported for ... in /v1/chat/completions. This is an official OpenAI restriction; the /v1/responses endpoint covered on this page has no such limit — use Responses for tool calling with these models.Whether it fires depends on which upstream route the request lands on, so the same model can return 200 now and 400 later. Never treat “it worked last time” as proof you are safe. Measurements, the trade-off between the two remedies, and full migration steps: Endpoint & Migration.
Field mapping when migrating from /v1/chat/completions:

Client Support Status

Why do most VS Code-family IDEs and plugins (Cline, Trae, etc.) only support /v1/chat/completions and not the Responses endpoint covered on this page?
  • chat/completions is the de facto industry standard: third-party gateways, local inference runtimes (Ollama / vLLM / LM Studio), and non-OpenAI vendors all implement it, so one handler covers hundreds of providers — while /v1/responses is still essentially an OpenAI-only dialect
  • Responses is not a URL swap: semantic event streaming (not delta concatenation), item-based output, and reasoning-state passing are all fundamentally different from chat/completions — clients have to rewrite their entire agent loop
  • Chicken-and-egg: clients don’t implement it because most custom endpoints (gateways) don’t serve responses, and gateways aren’t in a hurry for the same reason. APIYI already hosts /v1/responses (this page), so there is no gateway-side blocker
Mainstream client support as of July 2026: For GPT-5.4+ “reasoning plus tool calling” workloads, Codex CLI / opencode are the first choice — point the Base URL at https://api.apiyi.com/v1. If gpt-5.4 is enough and you want to stay in a VS Code-family IDE (including Trae), install the Roo Code plugin and pick its OpenAI provider.

Troubleshooting