Troubleshooting & security
Key safety and best practices
A key is money: how to store it, limit it and what to do after a leak.
About 6 minFor:Everyone who holds a key
Before you start
- At least one key
Step 1 · STEP 0x01
Store keys properly
terminal
$ export API_KEY=<YOUR_API_KEY>$ echo ".env" >> .gitignore
- Keep it in an environment variable or a password manager, never in code.
- Never commit it to git, especially public repos; add
.envto.gitignore. - Never ship it in web front-end or mobile app code — anyone can extract it.
- Don't post it in chats, tickets or screenshots.
Many leaks come from “just pasting once”: replace the key with a placeholder before pasting configs into a forum.
Step 2 · STEP 0x02
One key per purpose, with limits
API keys → Edit
1
Budgets (USD)
Set a monthly cap
2
Model allowlist
Only the models this use needs
3
IP allowlist
For servers with a fixed outgoing IP
4
Expiry date
Set one for keys you lend out
5
Save
Even if one key leaks, the loss is capped by its own budget and revoking it does not affect your other tools.
Step 3 · STEP 0x03
Turn on alerts and review regularly
Settings → Email notifications
1
Low balance alert
On
2
Unusual key usage alert
On
3
Top-up received
On
4
Save
- Glance at the Usage page weekly for unknown models or times.
- Check Last used on the API keys page and revoke keys you no longer use.
- Change your password now and then; other devices are signed out after a change.
Step 4 · STEP 0x04
If you suspect a leak, do this in order
API keys
1
Revoke
2
Create key
- 1. Revoke the key at once; requests using it fail immediately.
- 2. Create a new key and update your tools.
- 3. Check the Usage page for unknown requests during the exposure and open a billing ticket for charges you doubt (within 30 days).
- 4. Find where it leaked (repo, chat, screenshot) and clean it up.
If it was your account password, change it immediately and mention it in a ticket.
✓ How to tell it worked
- Every key has a name, a budget and suitable limits, and you know the first step after a leak is to revoke.
FAQ
Does the share page leak the key?
No — it only shows how to connect. You send the key separately.
Can several people share one key?
Not recommended. One key each: you revoke only the one that misbehaves and see who used how much.
Related tutorials
Budgets, rate limits and allowlistsCap what each key can spend so a leak or a runaway script cannot drain your balance.Create and manage API keysCreate a key, copy the base URL, edit and revoke — all in one place.Usage, billing records and low balanceWhere your money went, how to check a charge, and what to do when you run low.
Still stuck?
Read the troubleshooting tutorials first. If that does not help, open a ticket with the request_id, time, model and the exact error (never paste your key).