Authentication
API keys, authentication methods, and key management
All API requests (except health check) require authentication.
Getting Your API Key
- Sign in at agent-heavy.vercel.app/dashboard
- Go to Keys and click Create New Key
- Store the key securely — it's shown only once
API keys start with ck_ and are managed via Unkey. Each key has its own rate limit enforced server-side.
Authentication Methods
Bearer Token (Recommended)
X-API-Key Header
Endpoint Authentication
| Endpoint | Auth Methods |
|---|---|
/api/v1/chat/completions | Bearer token, X-API-Key |
/api/v1/models | Bearer token, X-API-Key |
/api/v1/media/* | Bearer token, X-API-Key |
/api/v1/fashion/* | Bearer token, X-API-Key |
/api/chat | Bearer token, X-API-Key |
/api/v1/keys | Dashboard session (cookie) |
/api/v1/provider-keys | Dashboard session (cookie) |
/api/v1/usage | Bearer token, X-API-Key, or dashboard session |
/api/health | None required |
Key Management API
Manage your API keys programmatically. These endpoints require dashboard authentication (Supabase session cookie).
Create Key
POST /api/v1/keys
Response (201):
List Keys
GET /api/v1/keys
Returns all your keys (masked — metadata only, never the full key).
Update Key
PATCH /api/v1/keys/:id
Revoke Key
DELETE /api/v1/keys/:id
Permanently revokes a key. Returns 204.
Provider Keys (BYOK)
Store your own provider API keys so gateway requests use your key instead of the platform key. Keys are encrypted at rest with AES-256-GCM.
Store Provider Key
POST /api/v1/provider-keys
Supported providers: openai, anthropic, google, x-ai, openrouter, minimax.
List Provider Keys
GET /api/v1/provider-keys
Returns stored keys (masked — only last 4 characters shown).
Remove Provider Key
DELETE /api/v1/provider-keys/:id
Returns 204.
Usage Analytics
GET /api/v1/usage?from=2026-03-01&to=2026-03-21
Returns request volume, token usage, and estimated costs broken down by model.
Security Best Practices
- Never expose your API key in client-side code
- Use environment variables to store your key
- Rotate keys regularly if you suspect compromise
- Use separate keys for development and production
- Use BYOK to keep provider costs on your own account