API key format
ModelRoute API keys follow the format:sk_ prefix identifies it as a secret key. The trailing 8-character CRC32 checksum allows client-side format validation before making a network request.
Example:
Using your API key
Include your key in theAuthorization header as a Bearer token on every request:
Creating API keys
- Log in to app.modelroute.ai
- Navigate to Settings > API Keys
- Click Create Key
- Choose a permission level and label
- Copy the full key — it is shown only once
Permission levels
| Level | Capabilities |
|---|---|
| Full access | Executions, files, webhooks, billing, key management |
| Execution only | Executions and file operations only. Cannot manage keys, webhooks, or billing. |
Key rotation
Rotate a key to generate a new secret while keeping the same key ID and permissions:Rate limiting
Every API response includes rate limit headers:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the window resets |
429 Too Many Requests with the RATE_LIMITED error code:
X-RateLimit-Reset header to determine when to retry. Implement exponential backoff for production systems.
Security best practices
Never expose keys in client-side code
Never expose keys in client-side code
API keys are server-side secrets. Never embed them in JavaScript bundles, mobile apps, or public repositories. Use a backend proxy to make ModelRoute API calls.
Use environment variables
Use environment variables
Store keys in environment variables or a secrets manager (e.g., AWS Secrets Manager, GCP Secret Manager). Never hardcode keys in source files.
Scope keys to minimum permissions
Scope keys to minimum permissions
Use execution-only keys for services that only run executions. Keep full-access keys for admin operations only.
Rotate keys regularly
Rotate keys regularly
Rotate keys every 90 days or immediately if a key is compromised. The 1-hour grace period on rotation ensures zero downtime.
Revoke compromised keys immediately
Revoke compromised keys immediately
If a key is leaked, revoke it from the dashboard immediately. Revocation is instant — the key stops working on the next request.