Skip to content

API Reference ​

All endpoints are prefixed with the base URL of your instance (e.g. https://api.runne.run). Authentication modes:

  • Session — the runne_session cookie (customer dashboard). Ownership-checked routes additionally require that the session owns the workspace.
  • API key — Authorization: Bearer rn_live_… or x-api-key: rn_live_….
  • Webhook — HMAC signature in X-YooKassa-Signature.
  • Public — no authentication.

Auth & session ​

MethodPathAuthScopeDescription
POST/v1/auth/registerPublic (auth rate limit 5/min/IP)—Register {email, password, name}; auto-login, 201 {customer_id, email}
POST/v1/auth/loginPublic (auth rate limit 10/min/IP)—Login {email, password}; 200 {expires_at} + session cookie
POST/v1/auth/logoutSession—Revoke session jti server-side, clear cookie; {success: true}
GET/v1/auth/meSession—{customer_id, email, name, status, is_platform_admin}

Workspaces ​

MethodPathAuthScopeDescription
POST/v1/workspacesSession—Create workspace {name}; 201 workspace DTO
GET/v1/workspacesSession—List own workspaces; {workspaces: [...]}

API keys ​

MethodPathAuthScopeDescription
POST/v1/workspaces/{workspace_id}/api-keysSession (owner)—Create key {name, scopes[], rate_limit?}; 201 incl. raw_key (once)
GET/v1/workspaces/{workspace_id}/api-keysSession (owner)—List keys; {api_keys: [...]}
DELETE/v1/workspaces/{workspace_id}/api-keys/{api_key_id}Session (owner)—Revoke key; {success: true}

Payments & webhooks ​

MethodPathAuthScopeDescription
POST/v1/paymentsSession—Create YooKassa payment {workspace_id, amount_rubles, description?}; 201
GET/v1/payments?workspace_id=Session—List payments for own workspace
POST/webhooks/yookassaWebhook (HMAC-SHA256)—Process payment.succeeded/canceled, receipt.succeeded/canceled (idempotent)

Ledger & balance ​

MethodPathAuthScopeDescription
GET/v1/workspaces/{workspace_id}/transactionsSession (owner)—Transaction history ?type=&from=&to=&limit=&offset=
GET/v1/workspaces/{workspace_id}/balanceSession (owner)—{balance, updated_at}
GET/v1/balanceAPI keybalance:read{balance, currency, updated_at}

Usage & cost ​

MethodPathAuthScopeDescription
POST/v1/cost/estimatePublic—Estimate cost {model, max_tokens}
GET/v1/workspaces/{workspace_id}/usage-reportSession (owner)—Aggregated usage `?from=&to=&group_by=day

Quotas ​

MethodPathAuthScopeDescription
GET/v1/workspaces/{workspace_id}/quotaSession (owner)—Current quota; `{quota:
GET/v1/workspaces/{workspace_id}/quota/usageSession (owner)—Current-period usage; {usage: {...}}

Chat completions ​

MethodPathAuthScopeDescription
POST/v1/chat/completionsAPI key + rate limitchat:writeOpenAI-compatible {model, messages[], max_tokens?}; mock provider in beta

Models ​

MethodPathAuthScopeDescription
GET/v1/modelsPublic—List active models with current pricing
GET/v1/models/{provider}/{model}Public—Single model (no pricing in response)

Admin (platform admin only) ​

Requires a session whose customer is_platform_admin is true. Non-admins receive 403.

MethodPathDescription
GET/v1/admin/dashboard/overviewSystem overview metrics
GET/v1/admin/dashboard/top-workspacesTop workspaces by usage (?limit=)
GET/v1/admin/dashboard/top-modelsTop models by usage (?limit=)
GET/v1/admin/customersList customers with pagination (?page=&limit=&status=)
GET/v1/admin/customers/{customer_id}Customer card: profile + workspaces
PUT/v1/admin/customers/{customer_id}/statusSet status `{status: active
POST/v1/admin/workspaces/{workspace_id}/adjustAdjust balance {amount, description} (signed decimal)
PUT/v1/admin/workspaces/{workspace_id}/quotaUpdate quota
PUT/v1/admin/models/{provider}/{model}/pricingUpdate model pricing
GET/v1/admin/models/{provider}/{model}/pricing-historyPricing history
GET/v1/admin/workspaces/{workspace_id}/paymentsWorkspace payments
GET/v1/admin/workspaces/{workspace_id}/receiptsWorkspace receipts

System ​

MethodPathAuthDescription
GET/healthPublic{status: "ok"}
GET/PublicService info

Error envelope ​

Not all non-2xx responses share one envelope. Domain errors use { "error": { "code": "…", "message": "…" } }; 400 validation errors use { "success": false, "error": { … } } (no code); some 401/403 responses (webhook signature, api-key ownership) return a flat { "error": "…" } string. See Errors for the code table and handling guidance.