API Key Configuration
This guide walks you through getting your API key from the dashboard and configuring it in your environment or tool.
Get Your API Key
Generate your key from the API Keys page:
- Sign in and navigate to API Keys
- Click "Create Key" and give it a name
- Copy the key immediately — it is shown only once
Using the Key in Request Headers
Include these headers in every API request:
x-api-key: sk-ar-YOUR_KEY_HERE
anthropic-version: 2023-06-01
content-type: application/json
.env File Setup
For local development, store credentials in a .env file (never commit this to source control):
# .env
ANTHROPIC_API_KEY=sk-ar-YOUR_KEY_HERE
ANTHROPIC_BASE_URL=https://api.cheapai.cc
# OpenAI-compatible
OPENAI_API_KEY=sk-ar-YOUR_KEY_HERE
OPENAI_BASE_URL=https://api.cheapai.cc/v1
Per-Key Limits
Each key can have independent limits configured from the API Keys page:
- Requests per minute (RPM) — throttle individual keys to prevent runaway usage
- Max tokens per request — cap context size per call
- Budget limit (credits) — key is automatically disabled when the budget is reached
Security Best Practices
- Never expose keys in client-side JavaScript or public repositories
- Rotate keys regularly and revoke any that may have been exposed
- Use per-key budget limits to limit blast radius if a key leaks
