API keys
Create, use, and revoke the keys that connect your tools to CostCrunch.
Updated October 31, 2026
An API key lets a tool read your company's CostCrunch data without signing in through a browser. It's what the AI assistant setup, scripts, and CI use.
A key:
- Can only read. Anything that would change data is refused.
- Belongs to one company and sees what you see there. If you belong to several companies, make a key in each one you need.
- Acts as you. If you leave the company, the key stops working.
- Works until you revoke it. Keys don't expire on their own.
Create a key
- In CostCrunch, open Settings → API (under Connections).
- Click Create key and name it after where you'll use it, like Claude on my laptop or Monthly spend report.
- Copy the key. It's only shown once: CostCrunch keeps a fingerprint of it, not the key itself.
After you create a key, the setup steps on that page include it, ready to copy.
You can have up to 10 keys at a time. Each person sees and manages only their own.
Use a key
| Tool | How |
|---|---|
| AI assistants | Set COSTCRUNCH_API_KEY in the assistant's MCP config. See AI assistants. |
| CLI | cost auth login --api-key (it asks for the key) or set COSTCRUNCH_API_KEY |
| Python | CostCrunch(api_key="cc_live_...") or set COSTCRUNCH_API_KEY |
Keep keys safe
- Treat a key like a password. Don't paste it into chats, tickets, or shared documents, and don't commit it to a code repository.
- Prefer environment variables or a secrets manager over writing the key into code.
- Use one key per place you use it, so you can revoke one without breaking the rest.
Revoke a key
In Settings → API, click Revoke next to the key. Anything using it stops working within a minute. Revoke right away if a key may have been exposed, then create a new one.
Settings → API also shows when each key was last used, which helps you spot keys nobody needs any more.
Didn't answer your question?
Email [email protected]