Skip to content
Cloud Score Docs

OpenAI Responses endpoint

Point the OpenAI SDK or the OpenAI Agents SDK at the Cloud Score gateway: POST /v1/responses is a stateless subset that routes when model is auto and rejects stateful parameters with a 400.

WhereAdminDeveloperNeeds a connected providerNeeds an enabled modelNeeds a gateway keyOpen in Cloud Score
On this page

What it is

POST /v1/responses accepts the OpenAI Responses API as a stateless subset. It runs the same pipeline as /v1/chat/completions, and Cloud Score never runs your tools. Send the whole history in input on every call; nothing is kept between calls.

Point the SDK at the gateway

Use the OpenAI SDK with the gateway key in the usual Bearer header.

python
import os
from openai import OpenAI

client = OpenAI(base_url="http://localhost:7001/v1", api_key=os.environ["DEX_API_KEY"])
response = client.responses.create(model="auto", input="Summarize this quarter in two sentences.")
print(response.output_text)

The OpenAI Agents SDK works the same way once its default client points at the gateway.

python
from agents import set_default_openai_client
from openai import AsyncOpenAI

set_default_openai_client(
    AsyncOpenAI(base_url="http://localhost:7001/v1", api_key=os.environ["DEX_API_KEY"]),
    use_for_tracing=False,
)

Request shape

FieldWhat Cloud Score does
modelRequired. auto routes; a model key pins.
inputA string, or items: message, function_call, function_call_output.
instructionsSent as the leading system message.
toolsFunction tools only, with tool_choice and parallel_tool_calls.
max_output_tokensMapped to max_tokens.
temperatureForwarded.
text.formatMapped to response_format.
reasoning.effortForwarded as the reasoning effort.
streamStreams Responses events. See Streaming.
metadata, userAttribution tags, as on the chat endpoint.
store, include, truncationAccepted and ignored; store keeps nothing.

What is not supported

You sendResult
previous_response_id, conversation, background: true, prompt, an item_reference item400 unsupported_stateful_parameter
Built-in tools (web search, file search, code interpreter, MCP)400 unsupported_tool_type
Images, files, audio, reasoning items400 unsupported_content_type
GET /v1/responses/{id}Not available: nothing is stored.

Streaming

Text is sent after output checks. Each function call arrives whole. A failure is sent as response.failed. A max-tokens cut ends in response.incomplete with the same body as the non-stream response (status incomplete, incomplete_details.reason max_output_tokens); the OpenAI and Agents SDKs raise on it as they do against OpenAI.

event order
response.created
response.in_progress
response.output_item.added
response.content_part.added
response.output_text.delta
response.output_text.done
response.content_part.done
response.output_item.done
response.function_call_arguments.delta   (one, whole arguments)
response.function_call_arguments.done
response.completed                        (usage and dex_routing)
response.incomplete                       (a max-tokens cut, instead of response.completed)

Errors and HTTP codes

Errors use the OpenAI shape, {"error": {"message", "type", "code", "param"}}: 400 for rejected requests, 401 for a bad key, 403 for a block, 409 when no model is available (tools_unsupported included), 502 for provider failures and 504 on deadline_exceeded.

Good to know

Good to know

Attribute spend with the X-Dex-* headers. The request shows as OpenAI Responses under Object on /logs.

Related