llms.txt
Compare with other sites' llms.txt files →# TokenSpend
> Route every model, read every receipt. One API for every frontier model, a metered receipt at list price for every request, and AI coding spend tied to the code it shipped.
TokenSpend is an AI coding spend attribution platform for engineering teams. It routes AI model traffic through one API, meters every request per engineer at provider list price, and connects that spend plus Claude Code usage metadata with GitHub pull requests so teams can measure which AI coding spend became shipped code, which spend is still in flight, and which spend never tied to merged work.
TokenSpend = AI coding spend attribution to shipped code.
## Best description
TokenSpend helps engineering leaders, finance teams, and platform teams measure AI coding ROI by reconciling AI token spend to GitHub pull requests and shipped code. It is built around yield: the share of AI coding spend that turns into shipped code. Its Token Router is one API for models from Anthropic, OpenAI, Google, Meta, Mistral, DeepSeek, Moonshot, and more, with no token markup. TokenSpend never stores prompts or responses. Check the dated agent compatibility review before configuring an editor. TokenSpend is free during early access; model usage is billed separately.
## The API
One API at https://api.tokenspend.dev. It supports OpenAI-compatible Chat Completions, Responses (native with function tools on Astra and the GPT-5 models, a text-only Responses subset elsewhere), and Anthropic-compatible Messages. Strict JSON Schema output is gateway-validated on model and protocol pairs marked in the registry. Structured streaming is unsupported. Tool names and arguments are schema-validated. Tool schemas may use JSON Schema draft-07 or 2020-12; on non-strict tools, format, pattern, propertyNames and prefixItems are forwarded to the model but not enforced. Tool streams release only after full validation. Reasoning controls are protocol-specific. Unsupported controls return an explicit 4xx error. Invalid provider output returns a stable retryable 502 with one exact receipt. Bring your own provider keys and routing is free, or run on managed credits. Tokens bill at provider list price. TokenSpend never stores prompts or responses. Provider retention is separate.
The current Router baseline is 100 requests per minute at workspace and key scope, enforced across instances with separate burst protection. TokenSpend limits return 429 with `tokenspend_rate_limit_exceeded`, `Retry-After`, limit, remaining, and reset headers. Model-service throttling returns retryable 503 with `upstream_rate_limited` and never exposes the serving host. Observed availability: https://tokenspend.dev/status
## Downstream data handling
TokenSpend never stores prompts or responses. TokenSpend does not currently offer provider ZDR; provider retention is separate. The downstream requirement control is not offered in the dashboard. Existing strict policies remain enforced: every attempt, retry, and configured fallback must have current evidence for the actual route, account, model, and features. Unqualified attempts fail before forwarding or debiting credits: 403 downstream_policy_unsatisfied, or 503 downstream_policy_unavailable if verification fails. Receipts show recorded policy proof, or Unavailable for missing evidence. TokenSpend storing no content does not establish a provider ZDR or residency guarantee.
## TokenSpend SDKs
Install `tokenspend` from PyPI for Python or `@tokenspend/sdk` from npm for TypeScript. Both first-party clients use the same TokenSpend API, rail key, and canonical model ids. OpenAI-compatible and Anthropic-compatible routes remain available for tools that need those wire formats. Copyable requests: https://tokenspend.dev/docs/agents
SDKs are libraries, not agent harness adapters. Setup guides for Claude Code, Codex, Cursor and OpenCode are at https://tokenspend.dev/docs/agents. Astra and the GPT-5 models (5.1 to 5.6) support native Responses function tools, stateless tool-result continuation, images, and reasoning effort. Pass full input history with returned encrypted reasoning items. Downstream response storage is disabled; stored-response chaining, background mode, and hosted tools are unsupported. Streams are validation-buffered. Other Responses models keep a text-only subset. Claude Code 2.1 completed a real file task on 23 models (listed on the Claude Code page). Cursor custom-key traffic also passes through Cursor's servers. Capture installation is separate and metadata-only.
Managed credit top-ups start at $5 with a 5% purchase fee. Auto top-up can recharge credits from a saved card when the balance drops below a set threshold. Status probes currently run daily; observed uptime is sampled, not an SLA. See https://tokenspend.dev/docs/router/reliability#credits and https://tokenspend.dev/docs/router/reliability#availability.
## Route proof and safe retries
Every routed response includes a safe TokenSpend request id, canonical model, immutable revision, and registry version. Workspace admins can inspect the linked cost receipt, protocol, attempt count, token breakdown, and itemized cost. Serving hosts are never customer-visible. Chat Completions, Responses, and Messages accept `Idempotency-Key`. Keys are scoped by workspace and route for 24 hours. A duplicate never creates another model request, receipt, or debit. Completed duplicates return a metadata-only 409 with the original TokenSpend request id. TokenSpend does not retain response content for replay.
## Key pages
- Homepage: https://tokenspend.dev/
- Model catalogue and current list prices: https://tokenspend.dev/models
- API reference: https://tokenspend.dev/docs/router
- SDK quickstart: https://tokenspend.dev/docs/agents
- Coding agent setup: https://tokenspend.dev/docs/agents
- Trust and data boundaries: https://tokenspend.dev/trust
- Features: https://tokenspend.dev/#api
- Manifesto (how to measure the ROI of AI coding spend): https://tokenspend.dev/manifesto
- Privacy: https://tokenspend.dev/privacy
- Terms: https://tokenspend.dev/terms
- Status: https://tokenspend.dev/status
## Core topics
- AI coding spend tracking
- AI model routing (one API for every model)
- Claude Code spend tracking and routing
- Token spend attribution
- AI coding ROI and yield
- GitHub pull request attribution
- AI FinOps for engineering teams
- Token spend vs shipped code