Examples
External Metering Model Policy
Same preflight as external-metering.yaml, with model-policy enforcement enabled: the entitlement response's modelAllowed verdict decides whether the tenant may use the requested public model, independently of budget
Category: Setup-dependent integration
Task: Same preflight as external-metering.yaml, with model-policy enforcement enabled: the entitlement response’s modelAllowed verdict decides whether the tenant may use the requested public model, independently of budget
Prerequisites: The external service, credentials, or certificates referenced by this configuration.
Run it: Use ghcr.io/praxis-proxy/ai:0.13.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.
Companion resources from the same snapshot:
# External Metering — Model Policy
#
# Same preflight as external-metering.yaml, with model-policy enforcement
# enabled: the entitlement response's `modelAllowed` verdict decides whether
# the tenant may use the requested public model, independently of budget.
#
# Prerequisites (not started by this config): a metering service answering
# the balance check on 127.0.0.1:9090 and an inference backend on
# 127.0.0.1:3000. Without the metering service the preflight rejects with
# 503 — the model gate is always fail-closed, regardless of fail_open.
#
listeners:
- name: default
address: "127.0.0.1:8080"
filter_chains:
- main
filter_chains:
- name: main
filters:
- filter: router
routes:
- path_prefix: "/"
cluster: backend
- filter: external_metering
metering_url: "http://127.0.0.1:9090"
# The metering service in this example listens on loopback, a
# non-public address, so callouts must be explicitly opted in.
allow_private_endpoint: true
timeout_seconds: 5
feature_key: "inference-tokens"
source: "ai-gateway"
provider: "openai"
# Billing gate availability: admit when the metering service is
# unreachable or returns an unusable budget verdict.
fail_open: true
identity_header_prefix: "x-tenant-"
# Model-policy gate: enforce the modelAllowed verdict. Disabled by
# default; enabling it requires a trusted tenant identity and a
# resolvable public model on every metered request. The gate is
# always fail-closed: an unavailable model verdict rejects with 503
# regardless of billing fail_open above.
model_policy_check: true
- filter: token_count
provider: openai
- filter: load_balancer
clusters:
- name: backend
endpoints:
- "127.0.0.1:3000"
insecure_options:
allow_private_endpoints: true # example proxies to local backends