Governed Responses and Codex
Send text and local tool calls to POST /v1/responses or POST /v1/openai/responses. The gateway runs the same plan, rate, cost, budget, PII, safety, model and approval checks as Chat Completions before contacting OpenAI. Streaming uses Responses events, including response.completed.
Your organization needs a gateway key and its own OpenAI API key in Settings. A customer gateway key cannot use a platform subscription or provider key. Provider selection is limited to OpenAI on this route.
Connect Codex
Use a separate Codex home and a custom provider. Keep your gateway key in an environment variable; do not put it in a repository file.
model_provider = "curate"
[model_providers.curate]
name = "Curate-Me"
base_url = "https://api.curate-me.ai/v1/openai"
wire_api = "responses"
env_key = "CM_GATEWAY_API_KEY"
requires_openai_auth = falseSet CM_GATEWAY_API_KEY to your org gateway key, then run codex exec in your hardened runner. OPENAI_BASE_URL is the same gateway URL for SDK clients. The server launch profile sets CM_CODEX_AUTH_MODE=gateway and uses a fresh Codex home. The shared worker hookup follows in the tool-restriction package; this transport does not change existing workers.
The gateway scans the complete text input, instructions, tool definitions, tool arguments and tool results. Send conversation history in input. Stored conversation references, hosted tools, file/image inputs, saved prompt references and background jobs are refused because this route cannot inspect or price them completely. Storage is disabled upstream. Encrypted reasoning may return only through the same org and gateway key that received it from this endpoint, for up to 24 hours. Only hashes are stored. Missing provenance returns 404; a verification outage refuses the request. The default output limit is 4,096 tokens; supply max_output_tokens when you need another limit within your policy.
Costs, approvals and caching
Input, output, cached-input and reasoning token counts come from upstream usage. Reasoning is already part of output tokens and is not charged twice. If a stream ends without usage, partial text counts stay marked as estimates and the admitted cost estimate is retained conservatively; they are not presented as provider receipts. Local tool calls are counted; their arguments consume output tokens. Hosted tool charges are unsupported, so hosted tools are refused.
Usage goes through the existing Redis and Mongo accounting path. Responses keep the gateway request, trace, governance and rate-limit headers. If approval is needed, the gateway returns a pending approval response instead of contacting OpenAI. If a stream ends without a terminal response, it is recorded as incomplete; it is not a successful completion.
Responses bypass both response caches, as toolful Chat Completions do. Replaying a saved response identifier could attach the wrong conversation state. OpenAI’s provider-side prompt-cache usage is still recorded.
See the Responses guide and Codex provider configuration for the upstream protocol. Unit fixtures verify transport and accounting; a live customer Codex smoke remains an owner-run check before activation.