| title | API Overview |
|---|---|
| sidebar_position | 1 |
Routerly exposes two groups of HTTP endpoints:
| Group | Path prefix | Auth method | Purpose |
|---|---|---|---|
| LLM Proxy | /v1/* |
Bearer project token | Forward requests to LLM providers |
| Management API | /api/* |
Bearer JWT (dashboard session) | Configure models, projects, users, etc. |
Pass your project token as a Bearer token:
Authorization: Bearer sk-rt-YOUR_PROJECT_TOKENProject tokens start with sk-rt- and are created in the project's Tokens tab.
First obtain a JWT by logging in:
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@example.com","password":"your-password"}'Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 86400
}Then pass the JWT as a Bearer token:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...JWTs expire after 24 hours. Re-authenticate to get a new token.
All errors return a JSON body:
{
"error": "error_code",
"message": "Human-readable description"
}Common error codes:
| HTTP Status | error value |
Meaning |
|---|---|---|
400 |
validation_error |
Request body is invalid |
401 |
unauthorized |
Missing or invalid token |
403 |
forbidden |
Valid token but insufficient permissions |
404 |
not_found |
Resource does not exist |
409 |
conflict |
Duplicate resource (e.g. slug already taken) |
503 |
budget_exceeded |
Request blocked by a budget limit |
503 |
no_model_available |
All routing candidates filtered out |
Every proxied request includes the x-routerly-trace-id header in the response:
x-routerly-trace-id: 018f3c2a-4b5d-7e8f-9012-34567890abcd
Use this ID to look up the full request trace in the Usage page or via the Usage API.
GET /health
Unauthenticated. Returns 200 OK with:
{ "status": "ok", "version": "1.2.3" }Suitable for load-balancer health probes.