Guides

Limit token usage

Bound the size of provider-bound requests and reserve token budgets before inference. These controls are separate from usage extraction, which only observes what the provider reports.

Praxis AI Development (bcdcfdbcf963) 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

Bound the size of provider-bound requests and reserve token budgets before inference. These controls are separate from usage extraction, which only observes what the provider reports.

Choose a control

Usage extraction does not enforce token limits. Experimental token_rate_limit reserves estimated budgets and reconciles them; token_ceiling constrains the final provider-bound body. Both require their own features and policies.

GoalFilterComplete example
Reject oversized input or unbounded outputtoken_ceilingtoken-ceiling.yaml
Reserve and reconcile token budgetstoken_rate_limittoken-rate-limit.yaml
Track live requests and reserved tokens per modelinflight_trackerinflight-tracking.yaml
Weight cache and reasoning tokens in a quotaPPE token quota plugintoken-quota.yaml

The ceiling evaluates the final provider-bound body; rate limiting needs its configured budget backend and trusted key dimensions. Check the build features each filter requires before selecting a binary, and run praxis-ai --validate -c FILE with that binary.