Skip to main content
POST /v1/responses Creates a response using OpenAI’s Responses API format. This is the endpoint Codex CLI targets when configured with wire_api = "responses". The endpoint is a thin proxy to Azure Government OpenAI’s native Responses API and is restricted to Azure-routed GPT models. For Claude, use /v1/messages. For multi-provider access via the OpenAI Chat shape, use /v1/chat/completions.

Request

Headers

Body Parameters

Other fields not listed here forward to Azure unchanged. Azure is the authoritative validator for shape correctness.

Response

Returns Azure’s full response payload unchanged, with an optional x_consus_governance field appended when tool-output governance flags are present.

Stateless Mode

Consus Gateway is stateless. The gateway does not store response payloads, conversation history, or any other state across requests. Two consequences:
  • store: true is rejected with 400 invalid_request_error. Omit store or set it to false.
  • previous_response_id is rejected with 400 invalid_request_error. Send the full input array each turn.
Codex CLI handles this automatically — it sets store: false on any base URL that doesn’t look like a direct Azure endpoint, and resends conversation context each turn. You don’t need to change anything in your Codex config; the rejection only matters if you’re using a custom client.

Reasoning

gpt-5.1 supports extended reasoning. Pass reasoning: {effort: "high"} in the request body, or set model_reasoning_effort = "high" in your Codex config. Effort defaults to the catalog’s per-model default if omitted. Reasoning output items (type: "reasoning") appear in the output array alongside message and function_call items. Encrypted reasoning content for stateful multi-turn is not exposed (the gateway is stateless — see Stateless Mode).

Streaming

Streaming is real and incremental. Setting stream: true relays the provider’s native OpenAI Responses event sequence (response.createdresponse.output_item.addedresponse.output_text.deltaresponse.output_item.doneresponse.completed) to your client as the model generates output — tokens arrive over time, not all at once. Streaming requests are not bound by the 5-minute non-streaming ceiling; they run up to ~15 minutes (see Request Timeout), which is what lets long reasoning turns complete.
Each event is event: <type>\ndata: <json>\n\n. For a typical text response Codex sees:
  1. response.created
  2. response.in_progress
  3. response.output_item.added (for each output item)
  4. response.content_part.addedresponse.output_text.deltaresponse.output_text.doneresponse.content_part.done (for message items)
  5. response.function_call_arguments.deltaresponse.function_call_arguments.done (for function_call items)
  6. response.output_item.done
  7. response.completed — terminal event, carries the full response payload (including usage and x_consus_governance if applicable)

Tool Use

Tool definitions use the Responses-shape (flat, not nested under function):
When the model calls a tool, the response includes a function_call item in output:
To send the result back, include a function_call_output item in the next request’s input array referencing the same call_id. The same destination-bearing parameter screener used by /v1/chat/completions runs on tool definitions — schemas with property names like destination_url, webhook_url, etc., are rejected with 400. See the Chat Completions doc for the full list.

Governance Metadata

When a function_call item’s arguments contains an outbound destination (URL, IPv4), the response body includes an advisory x_consus_governance.flags field alongside the standard Responses payload. The function call itself is not modified.
This is advisory — the gateway does not block or redact the call. Compliant clients check the field before executing the tool. The streaming endpoint embeds x_consus_governance in the final response.completed event’s response payload.

Examples

Basic completion

With reasoning

Streaming

Multi-turn (stateless)

Send the full input array each turn — previous_response_id is not supported.