API overview
modelux exposes two HTTP APIs:
- Proxy API for running inference. Two surfaces, both authenticated with a project API key:
- OpenAI-shape at
https://api.modelux.ai/openai/v1/*— drop-in replacement for the OpenAI base URL. Routes to OpenAI, Anthropic, Google, Bedrock, Cohere, etc. - Anthropic-shape at
https://api.modelux.ai/anthropic/v1/*— drop-in replacement for the Anthropic base URL. Same cross-provider routing.
- OpenAI-shape at
- Management API at
https://api.modelux.ai/manage/v1/*— REST API for managing projects, routing configs, providers, budgets, analytics, etc. Authenticated with a management API key.
Both proxy surfaces accept the same model identifiers (raw model names or @config slugs), the same X-Modelux-* headers, and the same routing/budget/observability pipeline. Pick whichever wire format your existing SDK already speaks.
For a per-feature breakdown of what each surface supports and which features round-trip cleanly across each upstream provider, see the capability matrix.
OpenAPI specs
Two specs, served from the docs site so you can codegen clients or import them into Postman / Insomnia:
| Spec | Surface | URL |
|---|---|---|
| Management API | /api/manage/v1/* (orgs, projects, configs, budgets, …) | modelux.ai/openapi.yaml |
| Proxy / runtime | /openai/v1/*, /anthropic/v1/* (inference, batches, files, Responses, …) | modelux.ai/openapi-proxy.yaml |
The proxy spec mirrors the upstream OpenAI / Anthropic shapes for
request/response bodies (referencing the official specs for the field
catalog) and documents in detail what’s modelux-specific: the
X-Modelux-* request headers, the mlx:* request extensions, the
response headers (X-Modelux-Request-Id, X-Modelux-Cost-Usd, etc.),
and the proxy-only endpoints (/dry-run, /messages/batches,
/files, /responses).
Authentication
All API calls require a bearer token:
Authorization: Bearer mlx_sk_... // proxy / project key
Authorization: Bearer mlx_mk_... // management key
API key prefixes
| Prefix | Use |
|---|---|
mlx_sk_ | Project API key — for the proxy API |
mlx_mk_ | Management API key — for the management API and MCP |
Base URLs
| Environment | Base URL |
|---|---|
| Production | https://api.modelux.ai |
| Dev (self-hosted) | http://localhost:8080 (proxy), http://localhost:5100 (app) |
Error format
Errors follow the OpenAI error shape for familiarity:
{
"error": {
"type": "invalid_request_error",
"message": "Missing required field: messages",
"code": "missing_field"
}
}
Management API errors use the same shape with additional fields where useful:
{
"error": {
"type": "not_found",
"message": "routing config @missing not found",
"code": "routing_config_not_found",
"resource": "routing_config",
"id": "@missing"
}
}
Status codes
| Code | Meaning |
|---|---|
200 | Success |
400 | Bad request — malformed input |
401 | Missing or invalid authentication |
402 | Payment required — budget exceeded |
403 | Forbidden — authenticated but lacks permission |
404 | Not found |
409 | Conflict — duplicate resource |
422 | Unprocessable entity — validation failed |
429 | Rate limited |
500 | Server error — check status page |
502/504 | Upstream provider error or timeout |
Rate limits
Proxy API limits are per-API-key. Default: 600 requests/minute. Upgrade tiers increase this. Custom limits can be set per key.
Management API: 60 req/min per management key.
Idempotency
Mutating management API endpoints accept an Idempotency-Key header. Same
key + same body returns the original response within 24 hours.
Pagination
Management API list endpoints return:
{
"data": [...],
"next_cursor": "opaque_cursor_or_null",
"has_more": true
}
Pass ?cursor=... to fetch the next page.