openai_responses_format

Classifies AI API request bodies and promotes routing facts to headers, metadata, and filter results without mutating the body.
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

FieldTypeRequiredDescription
on_invalidcontinue | reject | errornoBehavior when the body cannot be classified.
headersResponsesFormatHeadersnoHeader 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.formatstringnoHeader 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.modelstringnoHeader 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.streamstringnoHeader 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.modestringnoHeader 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