Guardrails and usage

token_usage_headers

Injects Praxis-Token-Input, Praxis-Token-Output, and Praxis-Token-Total headers into downstream responses when token usage data is present in [filter_metadata].

Praxis AI v0.5.0 (alpha) 1 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

Injects Praxis-Token-Input, Praxis-Token-Output, and Praxis-Token-Total headers into downstream responses when token usage data is present in [filter_metadata]. Also injects Praxis-Token-Status when usage capture failed (e.g. overflow), so an unavailable count is never silently indistinguishable from a genuine zero.

Configuration Notes

Reads token counts written by upstream filters and exposes them as HTTP response headers for infrastructure-level consumption (billing, monitoring, logging).

When no token metadata is present the filter is a no-op.

Example

filter: token_usage_headers