Managing API Keys
Create, rotate, scope and limit AnyRouter API keys, and revoke them instantly.
Create one sk-ar-… key per app and environment at /dashboard/keys, each with its own limits, usage history and revoke switch. There is no per-account key limit. For auth headers see Authentication; for REST endpoints see the Keys API.
Only a one-way hash is stored. The full secret is shown once, at creation. If you lose it, create a new key and revoke the old one. Never paste keys into chat or commit them. The masked prefix (sk-ar-7d2f***) is safe to share.
Create a key
- Click Create key.
- Set a Name and, optionally, the fields below.
- Click Create key, then copy the secret from the one-time panel before closing it.
Configuration fields
| Field | What it does |
|---|---|
| Name | Internal label, never sent with requests. Use one per app and environment, for example web-app-prod. |
| Expiration | Never (default), 7, 30 or 90 days, or an exact date-time. After expiry the key returns 401. |
| Rate limit (RPM) | Requests per minute. Over the cap returns 429 with Retry-After. There is no per-key TPM cap; set a low RPM plus a credit limit instead. |
| Credit limit | Dollar limit with a reset of Daily, Weekly or Monthly, measured over a rolling window. With no cadence it is measured over 30 days like Monthly, not as a lifetime cap. Over the limit returns 402 until the window rolls. |
| Include BYOK usage | Off by default. On, BYOK requests count toward the credit limit. |
Allowed models restricts a key to a subset of the catalog. A disallowed model returns 403 and is not charged. IP allow-lists and Referer checks are not available on keys.
Monitor
Click a key at /dashboard/key/<id> for spend and request counts (24 hours, 7 and 30 days), a 14-day spend chart, top models, and recent errors with status codes (commonly 402 credit limit or 429 rate limit). The Logs link opens the request log filtered to the key.
Edit
Use the overflow menu (⋯) to Edit expiration, credit limit, reset cadence or the BYOK toggle, or Rename. Changes apply within seconds. The owner or workspace of a key cannot change; issue a new key instead.
Rotate and revoke
Rotate in place replaces the secret and keeps the id, name, limits, restrictions and history. The old secret returns 401 immediately, with no overlap. The new secret is shown once and can be fetched later with Reveal.
Rotate without downtime
- Issue a new key with the same configuration (for example
app-prod-v2). - Deploy it alongside the old one.
- Check the card's "Last used" timestamp updates.
- Revoke the old key once its traffic is zero.
For a suspected leak skip the handoff and revoke immediately. Failed requests are recoverable; drained credits are not.
- Disable keeps the key but rejects all requests with
401. You can re-enable it. - Delete removes it permanently. Usage history is kept for billing and audit.
Both take effect within seconds. Streams already in flight finish. For an instant kill switch, also drop the credit limit to $0.01.
Best practices
- One key per app per environment; never share a key across environments.
- Set a credit limit on every key, for example 3x current peak with a monthly reset.
- Keep Management keys (badge on the key) separate: one per administrator, never used by an app, rotated often. Revoke a departing teammate's keys the same day.
Troubleshooting
| Symptom | Fix |
|---|---|
| "Last used" not updating | Send Authorization: Bearer sk-ar-… on every request and check the prefix matches the dashboard. |
401 after creating | The key is disabled, expired or deleted, or the secret was truncated when copied. |
402 mid-month | Credit limit reached. Raise it in Edit or wait for the reset. |
429 at low volume | Check the key's RPM in Edit; account-wide and per-model limits also apply. |
AnyRouter routes requests to third-party models. Models and outputs are provided as is, with no warranty; you use them at your own risk. Disclaimer