Compatibility Matrix
Detailed SDK compatibility and optional extras for Backstop.
0.6.0 is published (PyPI
backstop-ai, npmbackstop-ai, GitHub Releasev0.6.0; MIT licensed). The npm package of the same name is a partial TypeScript port, not the Python distribution — see the note below. The SDK ranges below are the tested ranges from.github/workflows/ci.yml— not a claim of universal support. Wrapping an SDK outside these ranges emits a loudUserWarningnaming the tested range and proceeds unverified. Enforcement-error propagation (BudgetExceededErrorcatchable by user code, notAPIConnectionError) is verified on openai 3.14.0 + anthropic 1.5.0 (current) and openai 2.37.0 + anthropic 0.99.0 (legacy matrix) viatests/test_guardrail_visibility.py. See installation guide for installation limitations.
Python
| Python | Status |
|---|---|
| 3.10 | Tested in CI |
| 3.11 | Tested in CI |
| 3.12 | Tested in CI |
Providers
| Provider | Client | Tested SDK range | Verified | Status | Notes |
|---|---|---|---|---|---|
| OpenAI | openai.OpenAI | >=2.37,<4 | 2.37.0, 3.14.0, latest | Supported | Sync wrap; httpx/httpx2 family auto-detected per client |
| OpenAI | openai.AsyncOpenAI | >=2.37,<4 | 2.37.0, 3.14.0, latest | Supported | Async wrap; same family detection |
| Anthropic | anthropic.Anthropic | >=0.98,<2 | 0.99.0, 1.5.0, 1.6.0, latest | Supported | Optional dependency via backstop-ai[anthropic]; httpx2 client on >=1.0 |
| Anthropic | anthropic.AsyncAnthropic | >=0.98,<2 | 0.99.0, 1.5.0, 1.6.0, latest | Supported | Same as sync |
Unsupported: SDKs below the floors (openai<2.37, anthropic<0.98) — their
request loop catches every transport exception, including Backstop's
BudgetExceededError, and re-raises it as APIConnectionError, so budget
enforcement is invisible to user code. The propagate-as-is guard first ships in
openai 2.37.0 / anthropic 0.98.0. Older SDKs (openai<1.90,
anthropic<0.40) additionally crash against httpx>=0.28, which removed the
proxies kwarg. Also unsupported: future majors at/above the ceilings
(openai>=4, anthropic>=2 — none released as of 2026-09-18).
Backstop.wrap() warns on these but does not refuse; verify with
backstop doctor before relying on them.
Optional Extras
| Extra | Purpose |
|---|---|
backstop-ai[metrics] | Prometheus metrics export |
backstop-ai[anthropic] | Anthropic SDK support |
backstop-ai[redis] | Shared/distributed budget across replicas |
backstop-ai[otel] | OpenTelemetry metrics export |
backstop-ai[fastapi] | Gateway/sidecar mode |
backstop-ai[tokenizers] | Optional token counting support |
TypeScript
backstop-ai on npm is a partial TypeScript port, not a mirror of the Python
package. It is published and it is divergent, and the divergence is documented
upstream in docs/planning/05-expansion-roadmap.md.
| Python | npm backstop-ai | |
|---|---|---|
| Providers | OpenAI + Anthropic | OpenAI only (peerDependencies: { "openai": ">=4" }) |
| Interception | transport injection (BackstopTransport) | patches client.chat.completions.create |
| Priorities | 3: critical, default, background | 5: critical, high, default, low, bulk |
| Budget semantics | no priority bypass in the budget path | critical and high bypass the ceiling |
| Ledger, price catalog, detector | shipped | none |
| Metrics / OTel / Redis / hierarchical budgets | shipped | none |
| Audit chain | HMAC chain + verify() + four sinks | HMAC chain + verify(), no sinks |
| CI | full matrix | none — npm test runs only by hand |
Use the Python package when you need the full feature set or Anthropic.
— Edit this page on GitHub