
API Key Scopes and Limits
Creates and rotates API keys and sets scopes, spending limits and expiry dates.
Install
npx skills add cheaper-inference/OmniRoute --skill omni-api-keys -g -a claude-code -y- Repository
- cheaper-inference/OmniRoute83.6k
- Category
- Security
- Updated
- 4d ago
- License
- MIT
- Context cost
- Lightabout 1,452 tokens
- Runs scripts
- No, instructions only
What it does
Create, list, rotate, and revoke OmniRoute API keys. Control per-key scopes, spending limits, and expiration. Keys gate access to all proxy and management endpoints.
Overview
Create, list, rotate, and revoke OmniRoute API keys. Control per-key scopes, spending limits, and expiration. Keys gate access to all proxy and management endpoints.
Authentication
All requests require a valid Bearer token or session cookie. Obtain a token via POST /api/auth/login or configure REQUIRE_API_KEY=false for local development.
Endpoints
GET /api/keys
List API keys
curl http://localhost:20128/api/keys \
-H "Authorization: Bearer $OMNIROUTE_TOKEN"
POST /api/keys
Create API key
curl -X POST http://localhost:20128/api/keys \
-H "Authorization: Bearer $OMNIROUTE_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
GET /api/keys/{id}
Get API key
curl http://localhost:20128/api/keys/{id} \
-H "Authorization: Bearer $OMNIROUTE_TOKEN"
PATCH /api/keys/{id}
Update API key
curl -X PATCH http://localhost:20128/api/keys/{id} \
-H "Authorization: Bearer $OMNIROUTE_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
DELETE /api/keys/{id}
Delete API key
curl -X DELETE http://localhost:20128/api/keys/{id} \
-H "Authorization: Bearer $OMNIROUTE_TOKEN"
POST /api/keys/{id}/access
Add or remove allowed models and combos on an API key atomically
Adds or removes allowed models and combos on an API key without lost updates. Serialized per key ID using an in-process async lock. Keys allowing all models (modelAccessMode: all) or all combos (allowedCombos containing 'combo/*') require switchToRestricted: true when adding new models or combos, otherwise returning a 409 Conflict. When switching to restricted mode, the allowlist becomes exactly the net added items (at least one required). Direct concurrent PATCH calls to /api/keys/{id} completely overwrite the policy outside this lock.

