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 claude -y
$5.00 openrouter key installed into claude

That's it. Claude Code now has a capped API key. If it goes rogue, it can only cost you $5.


Install

pip install capit

Usage

Give an agent a budget

# Claude Code - $5 cap
capit openrouter 5.00 --agent claude -y

# Cursor - $10 cap
capit openrouter 10.00 --agent cursor -y

# Windsurf - $5 cap
capit openrouter 5.00 --agent windsurf -y

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

Each agent gets its own capped key. Sleep soundly.

More agents

capit --consumers  # List all supported agents

See consumers/README.md for the full list and adding custom agents.

First time?

capit openrouter 5.00 --agent claude -i -y

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


Platforms

The included platforms are openrouter and unkey.

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              # Your master keys
capit --keys list -r openrouter  # Capped keys created on OpenRouter
capit --keys delete openrouter <id>  # Revoke a key
capit --platforms              # Available platforms
capit --consumers              # Supported agents

How It Works

  1. You run capit openrouter 5.00 --agent claude -y
  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.2.0.tar.gz (14.4 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.2.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for capit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f194ee0af4794ae4af21ea53b8d1a31689b987d18d9c8e33e20a80b05e0dcccf
MD5 db158e739773143ee46853ac05966f8f
BLAKE2b-256 1ac4fa4b7ba605f7b544f97622bd4f4960b1390151b1edf7b9c68af5ad3d2b55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: capit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3462919e77cfa98d861c8922323e0d6a5c06e30ac005e002d514acd3e3470531
MD5 cdaa0c187faa8fea4e10da2f7d9720e9
BLAKE2b-256 8e29c63dfdce2e7b2ffcf65eab7fbfd8b1c4105e0a1ef933dd6cb5a9e76645df

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