Issue authentication keys with spending caps
Project description
Budget per-agent, per-provider, as little or as much as you want
Ever been sticker shocked with a high inference bill only to find that the agent got stuck in some unproductive loop?
You need to manage the spending independent of the broken tool and broken agent.
capit, part of the DAY50 suite of open-source tools for AI workflows, allows for managing application-based key management with cost capping.
GUI
$ uvx capit serve
TUI
$ uvx capit openrouter 5.00 --agent openclaw
$5.00 openrouter key installed into openclaw
Old configuration backed up to /tmp/capit-openclaw-no22x7b1
That's it. Openclaw now has a capped API key. If it goes rogue, it can only cost you $5.
Everything is stored local-only or, optionally, not at all.
There are no capit servers and nothing is sent to us.
Supported Agents
| Agent | Config File | Command |
|---|---|---|
| Claude Code | ~/.claude/.credentials.json |
capit openrouter 5.00 --agent claude |
| Cursor | ~/.config/Cursor/User/settings.json |
capit openrouter 5.00 --agent cursor |
| Windsurf | ~/.config/Windsurf/User/settings.json |
capit openrouter 5.00 --agent windsurf |
| Hermes | ~/.hermes/.env |
capit openrouter 5.00 --agent hermes |
| OpenClaw | ~/.openclaw/secrets.json + openclaw.json |
capit openrouter 5.00 --agent openclaw |
| Opencode | ~/.local/share/opencode/auth.json |
capit openrouter 5.00 --agent opencode |
Run capit --agents to list all agents, or see agents/README.md for adding custom agents.
Install
uv tool install capit
Usage
Give an agent a budget
# Claude Code - $5 cap
capit openrouter 5.00 --agent claude
# Cursor - $10 cap
capit openrouter 10.00 --agent cursor
# Windsurf - $5 cap
capit openrouter 5.00 --agent windsurf
# Hermes - $5 cap
capit openrouter 5.00 --agent hermes
# OpenClaw - $5 cap
capit openrouter 5.00 --agent openclaw
# Opencode - $5 cap
capit openrouter 5.00 --agent opencode
Each agent gets its own capped key. Sleep soundly.
More agents
capit --agents # List all supported agents
See agents/README.md for the full list and adding custom agents. The supported agents table above has details on each.
Platforms
The included platforms are openrouter and aihubmix.
Platforms are easy to create with a claude skill located in skills/platform-creator.md.
See platforms/README.md for more details.
Administration
capit --keys list # List all keys with spending info
capit --keys list openrouter # List keys from specific provider
capit --keys delete <name> # Delete a key (e.g., claude-71ad2519)
capit --keys delete 'capit-*' # Delete keys matching pattern
capit --platforms # List available platforms
capit --platforms add # Add a master key
capit --platforms remove # Remove a master key
capit --agents # List supported agents
How It Works
- You run
capit openrouter 5.00 --agent claude - capit calls OpenRouter's API
- capit creates a guardrail with $5 cap
- capit creates an API key with that guardrail
- capit writes the key to
~/.claude/.credentials.json - Done
The cap is enforced by OpenRouter. The key literally cannot spend more than $5.
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file capit-0.8.2.tar.gz.
File metadata
- Download URL: capit-0.8.2.tar.gz
- Upload date:
- Size: 54.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d44a842295bec89f155c684aed4990f39a6ee7d45b2ecb528d0e6a2a9dcc9487
|
|
| MD5 |
64095e61b8da41b37c6af3c4eae69953
|
|
| BLAKE2b-256 |
e7e31aab9ddd2443415d5446d60c92f836030c7ad4d4cd69c2756ecc3bd3c63b
|
File details
Details for the file capit-0.8.2-py3-none-any.whl.
File metadata
- Download URL: capit-0.8.2-py3-none-any.whl
- Upload date:
- Size: 53.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a89772e5e65e0193d86e26931c82b3746fb6ce9bcf0a8caaa9e0fbaf8174eaf
|
|
| MD5 |
df9760e39bdf22257c54cdc8ac1f60e9
|
|
| BLAKE2b-256 |
98e95ea35f724e0d9cf7cac59dc64784ae148bf5f79921018f43d97bd38d0bfa
|