Skip to main content

Issue authentication keys with spending caps

Project description

capit_500

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
capit-ss

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

  1. You run capit openrouter 5.00 --agent claude
  2. capit calls OpenRouter's API
  3. capit creates a guardrail with $5 cap
  4. capit creates an API key with that guardrail
  5. capit writes the key to ~/.claude/.credentials.json
  6. Done

The cap is enforced by OpenRouter. The key literally cannot spend more than $5.


MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

capit-0.8.3.tar.gz (56.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

capit-0.8.3-py3-none-any.whl (55.1 kB view details)

Uploaded Python 3

File details

Details for the file capit-0.8.3.tar.gz.

File metadata

  • Download URL: capit-0.8.3.tar.gz
  • Upload date:
  • Size: 56.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for capit-0.8.3.tar.gz
Algorithm Hash digest
SHA256 03d0759458bd2c06b909cc14387daa75e8b45cb322facb67fd41716046ee84ac
MD5 d83b9684f151d5b6ad7007ed5cdbc226
BLAKE2b-256 f1cbf81cf446f48c2e725fed2b13bfd9ebed562ad4804a631aafe6a63c8311c0

See more details on using hashes here.

File details

Details for the file capit-0.8.3-py3-none-any.whl.

File metadata

  • Download URL: capit-0.8.3-py3-none-any.whl
  • Upload date:
  • Size: 55.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for capit-0.8.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e179705eb13122884d45f5d55e051c8b3bb4d7f77f52993ccc8af193de848b6d
MD5 7fbebb48372cc9f05592aa10e6aa3df5
BLAKE2b-256 26797de1b2608d09b1c8bad846056ca99665e3ca4f0605ee0bae2533e88de110

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page