Skip to main content
Sudo exposes the OpenAI Responses API at the v1/responses endpoint.
If you’re already using OpenAI’s Responses API you can usually swap the base URL, provide a Sudo API key, and you’re done.
Base URL: https://sudoapp.dev/api
Responses endpoint: /v1/responses
This interface only supports OpenAI models (for example gpt-4.1, gpt-4.1-mini, o3-mini, etc.).
Sudo forwards requests directly to OpenAI’s Responses API with one-to-one parity, which makes it ideal for agent-style workflows, tools-heavy orchestration, and modern OpenAI-first features that go beyond classic chat completions.
As with /v1/chat/completions, rate limiting and error handling are managed by Sudo’s AI router – behavior is identical to the canonical /v1/chat/completions endpoint.

Requests

You POST to /v1/responses with the same shape OpenAI expects.
Below is an example condensed TypeScript definition (non-exhaustive) that highlights the most commonly used fields:
For a fully detailed schema (including the richer Item types for tools, MCP, computer use, etc.), see the official OpenAI Responses API reference.

Headers

Only two headers are required:

Minimal JSON example

The smallest useful request can be just a model and a string input:
Minimal Request
For richer agent-style prompts you typically send an array of input items:
Structured Input Request

Example: non‑streaming curl

curl

Responses

Sudo returns the same schema as the OpenAI Responses API, including the response object and output items.
Response Schema (simplified)

Example response

Example Response

Errors

Error envelopes are identical to the rest of the Sudo AI router (including /v1/chat/completions), for example:
Error
You can expect OpenAI-originated errors (for example invalid model, bad tools schema) to be surfaced through the same structure with appropriate HTTP status codes.

Streaming

When you set "stream": true in the request body, Sudo will stream Server‑Sent Events (SSE) that mirror the OpenAI Responses streaming format. Unlike /v1/chat/completions streaming, which sends delta chunks for choices[].delta, the Responses API streams typed events such as:
  • response.created: the response object has been created.
  • response.output_text.delta: incremental text tokens being generated.
  • response.output_text.done: the final text segment for an output item.
  • response.completed: the entire response has finished.
  • error: an error occurred while generating the response.
Each SSE event is a JSON object with a top-level type field. A typical stream might start like:
SSE events (truncated)

Example: streaming curl

curl (streaming)
The SSE stream can be consumed using any EventSource/SSE client or your own HTTP streaming logic.

Rate limiting & behavior

  • Rate limits: The Responses API is subject to the same Sudo-side rate limiting as /v1/chat/completions (per‑app, per‑developer, and provider‑level throttling).
  • Error handling: Errors are normalized and returned using the same ErrorResponse shape as the rest of the AI router.
Because Sudo simply forwards to OpenAI’s Responses API under the hood, you automatically benefit from the latest OpenAI agent and orchestration features, while keeping a single Sudo integration (API key, billing, and monitoring) across all your AI usage.