# 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`.

listeners:
  - name: anthropic-gateway
    address: "127.0.0.1:8080"
    filter_chains: [anthropic-native]

filter_chains:
  - name: anthropic-native
    filters:
      - filter: anthropic_messages_format
        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
