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

$ 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.


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

# OpenClaw - $5 cap
capit openrouter 5.00 --agent openclaw

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.

First time?

capit openrouter 5.00 --agent claude -i

The -i flag prompts for your OpenRouter management key once. It's used to create the capped key.


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.6.2.tar.gz (26.9 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.6.2-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for capit-0.6.2.tar.gz
Algorithm Hash digest
SHA256 35cb03673e2bad4ef659579aaaa7031d33520edfa896d66e50dd96ec8d69b3e4
MD5 b035f8f67fcad94afb70029f170a0dea
BLAKE2b-256 f07a5f4e4d0489c14c90fc25430655db8e9bcc5549152d1c2a1645fd151dd603

See more details on using hashes here.

File details

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

File metadata

  • Download URL: capit-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 26.5 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.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 505003b89b956b8f7cba1f4214ba25a1d3bc4a3fc018c048ca8ae2fee7e53e6c
MD5 daf5d3c8eb80b19e8a5be642dd5a44c3
BLAKE2b-256 5dec17564b7fa5148340ed2451a869981b16da1b253efe6672c12508a60f8b91

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