Skip to main content

POST /v1/responses

The OpenAI Responses API, translated onto the same lineup, keys, and billing as chat completions. Use it when your SDK or agent loop (Codex, OpenAI SDK responses, assistants-style tooling) speaks Responses instead of chat.
A response is built from one chat generation. Billing, model ids, and error codes match /v1/chat/completions.

Request

Stateless: every call stands alone. previous_response_id and server-side conversation state are not stored — send the history you need in input.

Non-streamed response

  • status is incomplete when the output limit cut the generation short.
  • Tool calls appear as { "type": "function_call", "call_id": "…", "name": "…", "arguments": "…" } items.
  • Reasoning models attach a reasoning item with the thinking summary.

Streaming

Set stream: true for server-sent data: {…} frames with a type field: response.created → response.in_progress → response.output_text.delta (×N) → response.output_text.done → response.output_item.done → response.completed (carries the full object including usage). The stream closes after response.completed — there is no [DONE] sentinel.

Example

With the OpenAI SDK, point baseURL at https://api.refuseless.com/v1 and call client.responses.create(...) as usual.

Errors

Same codes as chat completions: 400 missing model/input · 401 bad key · 402 out of credits · 404 unknown model · 429 busy/warming (honor retry-after) · 503 model unavailable.