openai_responses_format
On this page
Classifies AI API request bodies and promotes routing facts to headers, metadata, and filter results without mutating the body.
Configuration Notes
Classification formats: openai_responses, openai_chat_completions, unknown_json, invalid_json, non_json.
POST /v1/responses (create) is authoritative: a valid create body may omit every discriminator the body heuristics key on (input, prompt object, previous_response_id, conversation) — for example {"model":"gpt-5"} — and would otherwise classify as unknown_json. On this endpoint such a body is classified as openai_responses instead, while body-derived facts (model, stream, store, …) are preserved. Bodies carrying positive signals for another format (openai_chat_completions, anthropic_messages) and genuine parse failures (invalid_json, non_json) are left untouched, so on_invalid: reject still rejects real errors.
A GET /v1/responses request with valid HTTP WebSocket upgrade headers is classified as openai_responses without inspecting a body. This handshake classification promotes only the format: model, stream, store, and mode facts remain absent. An ordinary bodyless GET /v1/responses remains unclassified.
Requests with background=true are rejected because Praxis does not implement the asynchronous Responses lifecycle.
Routing mode for supported Responses API requests: stateful when the request contains previous_response_id, non-empty tools, store=true (default when omitted), conversation, or prompt.id; stateless when store=false with no other stateful markers.
Use with branch chains to route stateful and stateless requests to different clusters.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
on_invalid | continue | reject | error | no | Behavior when the body cannot be classified. |
headers | ResponsesFormatHeaders | no | Header names for promoted classification facts. Must not be hop-by-hop, framing, Host, credential, API-key, or other internal x-praxis-* names. Dedicated defaults remain allowed. |
headers.format | string | no | Header name for the detected format (e.g. openai_responses, openai_chat_completions). Must not be a hop-by-hop, framing, Host, credential, API-key, or other internal x-praxis-* header. Dedicated default x-praxis-ai-format remains allowed. |
headers.model | string | no | Header name for the extracted model value. Must not be a hop-by-hop, framing, Host, credential, API-key, or other internal x-praxis-* header. Dedicated default x-praxis-ai-model remains allowed. Must not overwrite other classification facts such as x-praxis-ai-format. |
headers.stream | string | no | Header name for the extracted stream flag. Must not be a hop-by-hop, framing, Host, credential, API-key, or other internal x-praxis-* header. Dedicated default x-praxis-ai-stream remains allowed. |
headers.mode | string | no | Header name for the computed mode (stateless or stateful). Must not be a hop-by-hop, framing, Host, credential, API-key, or other internal x-praxis-* header. Dedicated default x-praxis-responses-mode remains allowed. |
Examples
Example 1
filter: openai_responses_format
Example 2
filter: openai_responses_format
on_invalid: continue
headers:
format: x-praxis-ai-format
model: x-praxis-ai-model
stream: x-praxis-ai-stream
mode: x-praxis-responses-mode