Authentication

API key management and role-based access control.

API keys

All /v1/* endpoints require a Bearer token in the Authorization header:

Authorization: Bearer br_live_...

Create keys in the dashboard or programmatically via the /auth/api-keys endpoint after signing in with your Supabase account.

Key properties

Each key supports optional constraints:

PropertyDescription
nameHuman-readable label
rateLimitRpmMax requests per minute
budgetLimitUsdSpend cap (daily or monthly)
budgetPeriod"daily" or "monthly"
expiresAtISO 8601 expiration date
allowedModelsRestrict to specific models

Roles & RBAC

Keys are assigned one or more roles. Each role grants a set of permissions:

RolePermissions
adminFull access to all endpoints
developerRoute requests, read config, read audit logs
operatorRead config, read audit logs
auditorRead-only audit access
agentRoute requests only (router.write, router.read)

Keys without an explicit role default to admin (with a deprecation warning). Always assign explicit roles in production.

Permission map

EndpointPermission
POST /v1/chat/completionsrouter.write
GET /v1/modelsrouter.read
GET /v1/tasksconfig.read
POST /v1/tasksconfig.write
DELETE /v1/tasks/:idconfig.write
GET /v1/usage/*audit.read
GET /v1/config/*config.read
PUT /v1/config/*config.write