Skip to main content

API

Middleware (public)​

OpenAI-compatible​

RouteAuth
GET /v1/modelsBearer rk_…auto (when more than one agent is on) and each agent that is on, with its description
POST /v1/chat/completionsBearer rk_…OpenAI chat completions. model: an agent id or auto; stream: true for server-sent events

Optional header: X-Session-Id keeps memory per session and agent, so only the new message needs to be sent.

Errors follow OpenAI's shape, { "error": { "message", "type", "code" } }: 401 invalid_api_key, 404 model_not_found, 429 demo_limit (demo mode), 502 agent_failed.

Settings​

All with Authorization: Bearer <ADMIN_TOKEN>.

RouteBody
GET /api/configendpoint, provider (without its key), agents, API keys
PUT /api/provider{ baseURL, model, apiKey? }set the provider; omit apiKey to keep the stored one
DELETE /api/providerback to the built-in model
PUT /api/agents{ disabled: ["id", …] }turn agents off
POST /api/keys{ name }create a key: { id, name, key }, shown only here
DELETE /api/keys/:idrevoke a key
GET /api/demo(no auth){ demo, adminToken? }: the published token in demo mode

Agents Worker​

Private: reached only through the middleware's service binding. Same /v1 routes, plus GET / (health and agent ids). The middleware sets these headers on each call:

Header
X-Provider-Base-URL, X-Provider-Key, X-Provider-Modelthe model provider for this request (absent: the built-in model)
X-Agentscomma-separated ids of the agents that are on
X-Session-Idpassed through from the client
Authorization: Bearer <AGENTS_API_KEY>when set