// I want to solve · Developers / Small teams & business / Enterprise IT / Individuals
💸 Control AI costs and usage limits
See what Claude Code, Codex and API calls actually use, set budgets and rate limits for a team, and route requests to cheaper models when it makes sense.
5 steps3 alternatives1 stacks · 2 problemschecked 2026-10-22
How to do it
- 01See where money goes: ccusage for coding-agent subscriptions, vendor consoles or a gateway dashboard for APIs
- 02Individuals: compare your real usage under a subscription versus pay-as-you-go API and pick the cheaper
- 03Teams: deploy LiteLLM or use OpenRouter, issue keys per person/project with budgets and limits
- 04Route simple tasks to cheap models and reserve flagships for hard ones
- 05Turn on prompt caching to avoid paying repeatedly for long context
What it costs
Free start
ccusage, LiteLLM and Portkey open source are free
Pay as you go
Model prices differ by tens of times; see the pricing page
Team / enterprise
Hosted gateway and observability team plans per vendor sites
Prices change; the vendor’s official page wins. Subscriptions compared · API prices
Alternatives: which to pick
| Option | Choose it when |
|---|---|
| LiteLLM | Self-hosted gateway with the fullest budgets and limits |
| OpenRouter | No ops, one key for many vendors |
| ccusage | Track Claude Code usage |
✓ Good fit
- Opaque bills and frequent rate limits
✗ Not a good fit
- Occasional individual users
Ready-made stacks
All stacksSoftware that helps
All software🔀 Model gateways, routing & usage
Problems & solutions
All problems- How-toHow much have Claude Code / Codex used and cost?Usage windows and limits on subscription tools are opaque, and API calls are scattered. Local log analysers and a unified gateway are the two main approaches.
- How-toSet budgets and rate limits for a team’s LLM usageRoute every model call through one gateway, issue virtual keys per person or project, and enforce budgets, rate limits and model allow-lists there.
Needs in this scenario
-
DEV-01Usage limits and costs are invisible and hard to estimate
Developers · People search for: claude code usage limit; track llm token cost; ccusage
-
IND-02Keeping total subscription cost down (self-paying users)
Individual developers & researchers · People search for: cursor vs claude pro worth it; cheapest ai coding setup
-
ENT-04Transparent TCO and residency matrix
Enterprise IT · People search for: llm observability pricing; ai gateway tco
Learn
All tutorials- 阿里云百炼 文档
阿里云 · Using AI tools · Chinese