Client APIs

anthropic_messages_request

Read the release-matched anthropic messages request documentation and its scope.

Praxis AI v0.9.0 (alpha) 2 min read

Switching projects opens that project’s default documentation release.

Versions marked “overview” do not contain this page. Selecting one opens that version’s documentation overview.

On this page

Processes an Anthropic create-message body once and publishes its facts.

Configuration Notes

The registry decides which operation this filter owns, so only POST /v1/messages has its body processed. Every other Anthropic Messages operation — token counting, the batch family — is released without body work but still gets the Anthropic error shape, because those are supported endpoints and a chain may carry no other formatter. Traffic outside the Messages surface is left entirely alone.

on_invalid governs the envelope: a missing, malformed, or non-object body is refused with an Anthropic-compatible client error under reject, or forwarded for the backend to answer under continue.

Configuration

FieldTypeRequiredDescription
on_invalidcontinue | reject | errornoBehavior when the body cannot be classified.
max_body_bytesintegernoMaximum body size in bytes for StreamBuffer mode.
headersobjectnoHeader 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. 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.

Examples

Example 1

filter: anthropic_messages_request

Example 2

filter: anthropic_messages_request
on_invalid: reject
max_body_bytes: 1048576
headers:
  format: x-praxis-ai-format
  model: x-praxis-ai-model
  stream: x-praxis-ai-stream