Backstop

Backstop Documentation

In-process reliability layer for AI SDKs. Wrap your OpenAI and Anthropic Python clients with token budgets, circuit breaking, concurrency control, and an opt-in priced spend ledger.

Welcome to Backstop

Backstop is an in-process reliability layer for AI SDKs. It wraps your existing OpenAI and Anthropic Python clients with token budgets, circuit breaking, and concurrency control — all without routing prompts through third-party servers.

Prefer to watch first? The 132-second walkthrough covers the whole product end to end: the problem, the one wrap() call, a live dashboard watching a budget drain, the guardrail firing, per-agent ceilings, the spend ledger, and reconciling that ledger against a provider statement. Every frame is the product running — the dashboard shots are captures of backstop dashboard --demo as a real workload drains a real budget, and the terminal shots are verbatim output of the real commands.

It also produces, opt-in, a durable, priced, attributed spend ledger that a finance team can charge back. See What The Ledger Is for why that lives in an enforcement library, and Export a Chargeback for the recipe.

Version status. 0.6.0 is published — on PyPI as backstop-ai, on npm as backstop-ai, and as the v0.6.0 GitHub Release — and the project is MIT licensed. The default branch carries unreleased work past that tag, including the spend ledger, so pip install -e ".[anthropic]" tracks main rather than the release.

The npm package of the same name is a partial TypeScript port, not the Python distribution: OpenAI only, it patches the client rather than injecting a transport, it has five priorities against Python's three, and it has no metrics, OpenTelemetry, Redis, hierarchical budgets, audit sinks or ledger. Use the Python package for the full feature set or for Anthropic.

Get started

Learn how it works

Guides & references


— Suggest an edit on GitHub

On this page