{"openapi":"3.1.0","info":{"title":"OpenSmartRoute platform API","description":"Metered routing API and OpenAI-compatible proxy for OpenSmartRoute 1.0.0 (enterprise edition). Authenticate with `Authorization: Bearer <key>` or `X-API-Key`; keys are created at signup and in the dashboard.","version":"1.0.0"},"paths":{"/api/v1/admin/notifications/evaluate":{"post":{"tags":["admin"],"summary":"Evaluate","description":"Run one evaluation round now (every active workspace and the deployment).","operationId":"evaluate_api_v1_admin_notifications_evaluate_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Evaluate Api V1 Admin Notifications Evaluate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/info":{"get":{"tags":["public"],"summary":"Info","operationId":"info_api_v1_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/status":{"get":{"tags":["public"],"summary":"Status","description":"Readiness checks, uptime and the observability controls of this deployment (no key needed).\n\nThe same checks as ``GET /readyz`` with the edition, versions and tracing state added; the\nstatus code is 503 while a check fails so status pages can poll it directly.","operationId":"status_api_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/estimate":{"post":{"tags":["public"],"summary":"Estimate Public","description":"Quote a request before sending it: tokens, cost per candidate and the recommended pick.\n\nWorks without a key (rate limited per client, no tenant rules) and with one (metered as\n``estimate``, workspace tenants and plan applied). ``monthly_requests`` adds a monthly projection.","operationId":"estimate_public_api_v1_estimate_post","parameters":[{"name":"x-osr-tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Osr-Tenant"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Estimate Public Api V1 Estimate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"bearer":[]},{"apiKey":[]}]}}},"components":{"schemas":{"EstimateIn":{"properties":{"text":{"type":"string","title":"Text"},"context":{"additionalProperties":true,"type":"object","title":"Context"},"history":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"History"},"objective":{"additionalProperties":{"type":"number"},"type":"object","title":"Objective"},"constraints":{"additionalProperties":true,"type":"object","title":"Constraints"},"profile":{"additionalProperties":true,"type":"object","title":"Profile"},"kinds":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Kinds"},"top_k":{"type":"integer","title":"Top K","default":3},"plan":{"type":"boolean","title":"Plan","default":false},"execute":{"type":"boolean","title":"Execute","default":false},"output_tokens":{"anyOf":[{"type":"integer","maximum":1000000.0,"minimum":0.0},{"type":"null"}],"title":"Output Tokens"},"monthly_requests":{"anyOf":[{"type":"integer","maximum":1000000000.0,"minimum":0.0},{"type":"null"}],"title":"Monthly Requests"}},"type":"object","required":["text"],"title":"EstimateIn","description":"``POST /api/v1/estimate``: the routing request plus the expected answer length and a monthly volume."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"`Authorization: Bearer <api key>`"},"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key","description":"`X-API-Key: <api key>`"}}},"tags":[{"name":"routing","description":"Route a request to a target and return the decision with its trace; optionally build a plan or execute it. Report outcomes for the learners and read statistics and the audit trail."},{"name":"openai","description":"OpenAI-compatible chat completions and model listing. Point an OpenAI SDK at the platform base URL and use `model: \"auto\"`; the router chooses the model per request."},{"name":"public","description":"No API key required: deployment information, the model catalogue with live statistics, rankings and self-serve signup."},{"name":"account","description":"The calling workspace: profile, usage, savings, activity log, API keys and tenants."},{"name":"workspaces","description":"Organization workspaces: members, roles, invitations and organization SSO (browser sessions only)."},{"name":"auth","description":"Sign-in with GitHub, Google or an organization identity provider; browser sessions; and CLI sign-in with device codes (`osr login`): the CLI requests a code, the person approves it in the browser, the CLI receives a workspace API key."},{"name":"billing","description":"Plan upgrades through Stripe Checkout and the webhook that confirms them."},{"name":"mcp","description":"Model Context Protocol server for IDEs and agents (VS Code, Cursor, Claude, Windsurf): `POST /mcp` speaks JSON-RPC with tools to route, quote, recommend, explain and ask; `GET /mcp` describes it. Authenticate like the REST API."},{"name":"marketplace","description":"Browse, publish, install and rate agents, skills, personas, prompts, templates and tools. Each listing has a validated manifest the router can load; `GET /registry/{slug}/manifest` is what `registry://` references resolve to."},{"name":"providers","description":"Model providers: `GET /providers` is the public, OpenRouter-style view of what this deployment executes on (provider, upstream model, prices, health per executable target - never credentials); the `/admin/providers` endpoints add, check and map OpenAI-compatible endpoints at run time, and every API replica picks the change up without a restart."},{"name":"admin","description":"Operator console: sign in with an operator username and password (`POST /admin/auth/login`, then `Authorization: Bearer osr_op_...`) or use the static `X-Admin-Token`; manage users, workspaces, members, keys, tenants, plans and operators."},{"name":"docs","description":"Rendered documentation for programmatic consumers."}]}