Skip to main content
Budget rules cap spend for a customer or pooled account over a daily, weekly, or monthly period.

Enforcement modes

For rollout guidance, see Controls Workflow.

TypeScript handling

Python handling

How the SDK stays current

The SDK keeps a local accumulator for active budget rules so it can make a fast pre-call decision. Pylva then reconciles that local view with backend totals. Backend totals are authoritative. If pricing data is unavailable or the backend cannot be reached, the SDK passes through rather than blocking the host application because of a Pylva outage. When a hard stop fires, return a product-specific fallback:
  • Cached answer.
  • Smaller model path.
  • Queued job.
  • “Try again later” response.
  • Human handoff.
Avoid retry loops that immediately reissue the same expensive call. Hard stops only block when the SDK has an active cached rule it can enforce safely. Pylva fails open when rule state, pricing, or backend access is unavailable, so Pylva does not become the reason your agent is down.