Examples
Messages Protocol
Routes Anthropic Messages API requests to a native /v1/messages backend
Switching projects opens that project’s default documentation release.
Category: Setup-dependent integration
Task: Routes Anthropic Messages API requests to a native /v1/messages backend
Prerequisites: The external service, credentials, or certificates referenced by this configuration.
Run it: Use ghcr.io/praxis-proxy/ai:0.11.0 and follow the container quickstart to mount and start the configuration.
This configuration comes from the selected release. The example has not been run here; external services are not bundled.
Download the source file.
# Anthropic Messages Protocol Headers
#
# Routes Anthropic Messages API requests to a native `/v1/messages`
# backend. The `anthropic_messages_protocol` filter provides a
# centralized default `anthropic-version` header for internal or
# non-SDK callers when the header is absent.
#
# No request or response body transformation. Use this when the
# backend natively supports `/v1/messages`.
#
# API version: `default_version: "2023-06-01"` applies only when the caller
# sends no `anthropic-version`. A caller's version passes through unchanged,
# so Anthropic SDK v1 clients reach the backend with `2023-06-01` and SDK v2
# clients with `2026-10-21`. Praxis does not enforce version-specific body
# rules. Under `2026-10-21`, the backend rejects sampling fields, assistant
# `document` blocks, and non-empty citations on user text blocks.
#
# Credentials: this chain forwards the caller's credential unchanged:
# `x-api-key` from SDK v1 or `Authorization: Bearer` from SDK v2. Use it when
# each client brings its own backend key. When the gateway owns the upstream
# credential, remove both headers and inject the gateway's key (see
# `docs/anthropic-messages.md`, "SDK credentials and gateway authentication").
listeners:
- name: anthropic-gateway
address: "127.0.0.1:8080"
filter_chains: [anthropic-native]
filter_chains:
- name: anthropic-native
filters:
- filter: anthropic_messages_request
on_invalid: continue
- filter: anthropic_messages_protocol
default_version: "2023-06-01"
- filter: router
routes:
- path_prefix: "/"
cluster: "anthropic-backend"
- filter: load_balancer
clusters:
- name: "anthropic-backend"
endpoints:
- "127.0.0.1:3001"
insecure_options:
allow_private_endpoints: true # example proxies to local backends