Skip to content
OpenSmartRoute
Documentation
Hosted platformREST API reference

Account, keys and tenants

The calling workspace: profile, usage, savings, activity log, API keys and tenants.

API version 1.0.0openapi.json

The calling workspace: profile, usage, savings, activity log, API keys and tenants.

get/api/v1/activity

Activity

Newest-first request log; pass `before=<ts of the last row> to page further back. traced marks rows whose spans and events are still in the tracer buffer (GET /api/v1/trace/{request_id}); outcome` summarises the feedback reported for the request.

Requires an API key.

Parameters

NameInTypeDefaultDescription
limitqueryinteger50
beforequerynumber | null
endpointquerystring | null
targetquerystring | null
keyquerystring | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/activity?limit=50" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/alerts

Alerts

Active conditions, most severe first: budgets nearly spent or exhausted and failing requests for the workspace; on plans with `stats` also the deployment's readiness, 5xx rate, latency SLO, open circuit breakers, routing drift, autopilot errors, a stale routing SLM and tracing being off. Each alert names the dashboard page that shows or fixes it. Evaluated on request from the platform's own state.

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/alerts" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/events

Events

Recent tracer events of the workspace's requests (`name may end with *, e.g. route.*). Oldest first, at most limit (default 200, max 2000). Deployment-wide events without a request id (breaker transitions, autopilot) are included on plans with stats. since / until (epoch seconds) select a time range from the platform's persisted telemetry (default the last 6 hours); source` says whether the rows came from the store or the in-memory buffer.

Requires an API key.

Parameters

NameInTypeDefaultDescription
request_idquerystring | null
namequerystring | null
kindquerystring | null
levelquerystring | null
limitqueryinteger200
sincequerynumber | null
untilquerynumber | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/events?limit=200" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/governance

Governance

One view of the AI-governance posture of the workspace on this deployment. Controls in force (input guard, PII redaction, audit chain, metrics, tracing), the workspace policy and tenants with their budgets and spend, the plan's limits and quota, the catalogue's data boundaries and PII-capable targets, and data retention.

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/governance" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/keys

Keys

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/keys" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/api/v1/keys

Create Key

Requires an API key.

Request bodyKeyIn

FieldTypeDefaultDescription
namestring""

Responses

201Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/keys" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Bodyjson
{}

patch/api/v1/keys/{key_id}

Rename Key

Rename an active key (the secret does not change).

Requires an API key.

Parameters

NameInTypeDefaultDescription
key_id(required)pathstring

Request bodyKeyIn

FieldTypeDefaultDescription
namestring""

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X PATCH "$OSR_URL/api/v1/keys/<key_id>" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Bodyjson
{}

delete/api/v1/keys/{key_id}

Revoke Key

Requires an API key.

Parameters

NameInTypeDefaultDescription
key_id(required)pathstring

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X DELETE "$OSR_URL/api/v1/keys/<key_id>" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/api/v1/keys/{key_id}/rotate

Rotate Key

Issue a new secret for the key and invalidate the old one immediately; the new value is shown once. The key keeps its id and name, so dashboards and audit rows stay attached to it.

Requires an API key.

Parameters

NameInTypeDefaultDescription
key_id(required)pathstring

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/keys/<key_id>/rotate" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/learning

Learning

How the router learns on this deployment: the strategy ensemble and its weights, the learner state (persistence, drift resets, quarantined state), per-target outcome statistics from feedback, the routing SLM in service (rows, sources, encoder, calibration, accuracy history) and the autopilot (schedule, drift monitor, last cycle, recent champion-vs-challenger reports). Deployment-wide aggregates only - no request text, no per-workspace data. Available on every plan.

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/learning" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/me

Me

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/me" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/me/audit

My Audit

The signed-in person's own account history: sign-ins, password and email changes, memberships.

Requires an API key.

Parameters

NameInTypeDefaultDescription
limitqueryinteger50
beforequerynumber | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/me/audit?limit=50" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/api/v1/me/delete

Delete Me

Delete the signed-in user: sessions, linked identities and memberships go; workspaces they alone owned are disabled with their keys. Organizations with other members need another owner first. Requires the password when one is set and the account email typed as confirmation.

Requires an API key.

Request bodyDeleteMeIn

FieldTypeDefaultDescription
confirmstring""
passwordstring | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/me/delete" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "password": "string" }'
Bodyjson
{
  "password": "string"
}

get/api/v1/me/export

My Export

Everything the platform holds about the signed-in person and the current workspace, as one JSON document (data portability): profile, identities, sessions, memberships, the workspace with its keys (prefixes only), tenants, policy, SSO connection, usage summary, request log and reported outcomes for the last `days` (max 365), plus the account history. Prompt text is never stored, so none appears.

Requires an API key.

Parameters

NameInTypeDefaultDescription
daysqueryinteger365

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/me/export?days=365" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/notifications

Inbox

Alert episodes of the workspace, newest first, with the unread counts the dashboard bell shows.

Requires an API key.

Parameters

NameInTypeDefaultDescription
unreadquerybooleanfalse
statequerystring | null
limitqueryinteger50
beforequerynumber | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/notifications?unread=false&limit=50" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/notifications/channels

Channels

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/notifications/channels" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/api/v1/notifications/channels

Create Channel

Add an email, webhook, Slack or Teams channel; webhooks may carry a secret for `X-OSR-Signature`.

Requires an API key.

Request bodyChannelIn

FieldTypeDefaultDescription
kind(required)string
min_severitystring"warning"
namestring""
rulesstring[]
secretstring | null
target(required)string

Responses

201Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/notifications/channels" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "kind": "string", "target": "string" }'
Bodyjson
{
  "kind": "string",
  "target": "string"
}

patch/api/v1/notifications/channels/{channel_id}

Patch Channel

Requires an API key.

Parameters

NameInTypeDefaultDescription
channel_id(required)pathstring

Request bodyChannelPatch

FieldTypeDefaultDescription
enabledboolean | null
min_severitystring | null
namestring | null
rulesstring[] | null
secretstring | null
targetstring | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X PATCH "$OSR_URL/api/v1/notifications/channels/<channel_id>" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "enabled": false, "min_severity": "string", "name": "default", "rules": [], "secret": "string", "target": "string" }'
Bodyjson
{
  "enabled": false,
  "min_severity": "string",
  "name": "default",
  "rules": [],
  "secret": "string",
  "target": "string"
}

delete/api/v1/notifications/channels/{channel_id}

Delete Channel

Requires an API key.

Parameters

NameInTypeDefaultDescription
channel_id(required)pathstring

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X DELETE "$OSR_URL/api/v1/notifications/channels/<channel_id>" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/api/v1/notifications/channels/{channel_id}/test

Test Channel

Send a test notification through the channel and report the result.

Requires an API key.

Parameters

NameInTypeDefaultDescription
channel_id(required)pathstring

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/notifications/channels/<channel_id>/test" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/notifications/deliveries

Deliveries

Requires an API key.

Parameters

NameInTypeDefaultDescription
limitqueryinteger100

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/notifications/deliveries?limit=100" \
  -H "Authorization: Bearer $OSR_API_KEY"

post/api/v1/notifications/read

Read

Mark the given notifications (or all) as read for the workspace.

Requires an API key.

Request bodyReadIn

FieldTypeDefaultDescription
idsstring[] | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/notifications/read" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "ids": [] }'
Bodyjson
{
  "ids": []
}

get/api/v1/notifications/unread

Unread

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/notifications/unread" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/onboarding

Onboarding

Getting-started checklist of the calling workspace: what is done, what to do next, with the links. Steps: verify the e-mail address, create an API key, route a first request, report a first outcome, connect a model provider (executable targets), invite a teammate (organizations). `complete` is the share of steps done; the dashboard shows the list until every step is done.

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/onboarding" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/policy

Policy

The workspace-wide routing policy: constraints and budgets applied to every request.

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/policy" \
  -H "Authorization: Bearer $OSR_API_KEY"

put/api/v1/policy

Set Policy

Replace the workspace policy (admin role). Target ids are checked against the catalogue.

Requires an API key.

Request bodyPolicyIn

FieldTypeDefaultDescription
configobject

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X PUT "$OSR_URL/api/v1/policy" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "config": {} }'
Bodyjson
{
  "config": {}
}

delete/api/v1/policy

Delete Policy

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X DELETE "$OSR_URL/api/v1/policy" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/savings

Savings

Baseline-vs-routed cost over the window; `baseline` defaults to the priciest model.

Requires an API key.

Parameters

NameInTypeDefaultDescription
daysqueryinteger30
baselinequerystring | null

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/savings?days=30" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/signals

Signals

The account's own product-usage signals (the same facts sales sees in `/admin/pql`).

Requires an API key.

Parameters

NameInTypeDefaultDescription
daysqueryinteger30

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/signals?days=30" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/telemetry/series

Telemetry Series

The workspace's traffic as a time series: requests, failures, p50 / p95 latency, cost and tokens per bucket over `window (1h, 6h, 24h, 7d, 30d), with totals per target and endpoint. Plans with stats also get http`: the deployment's requests, 5xx and latency percentiles per bucket. Computed from the platform's own records - no external metrics system.

Requires an API key.

Parameters

NameInTypeDefaultDescription
windowquerystring"24h"

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/telemetry/series?window=24h" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/tenants

Tenants

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/tenants" \
  -H "Authorization: Bearer $OSR_API_KEY"

put/api/v1/tenants

Upsert Tenant

Requires an API key.

Request bodyTenantIn

FieldTypeDefaultDescription
configobject
slug(required)string

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X PUT "$OSR_URL/api/v1/tenants" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "slug": "eu-health", "config": { "region": "eu", "data_boundary": "private" } }'
Bodyjson
{
  "slug": "eu-health",
  "config": {
    "region": "eu",
    "data_boundary": "private"
  }
}

delete/api/v1/tenants/{slug}

Delete Tenant

Requires an API key.

Parameters

NameInTypeDefaultDescription
slug(required)pathstring

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X DELETE "$OSR_URL/api/v1/tenants/<slug>" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/trace/{request_id}

Trace

Every span and event the router recorded for one of the workspace's requests, in time order. Spans (`kind: "span") carry duration_ms and status; events carry the stage's facts (signals, policy rejections, ranking, escalation, fallback, guard verdicts, execution steps). outcomes lists the feedback reported for the request and audit its hash-chained records (plans with audit`). Request text never appears - only its digest. 404 when the request id is not this workspace's.

Requires an API key.

Parameters

NameInTypeDefaultDescription
request_id(required)pathstring

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/trace/<request_id>" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/usage

Usage

Requires an API key.

Parameters

NameInTypeDefaultDescription
daysqueryinteger30

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/usage?days=30" \
  -H "Authorization: Bearer $OSR_API_KEY"

get/api/v1/workspace/reports

Report Preference

The workspace's usage-digest schedule and a preview of the figures the next one would carry.

Requires an API key.

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s "$OSR_URL/api/v1/workspace/reports" \
  -H "Authorization: Bearer $OSR_API_KEY"

put/api/v1/workspace/reports

Set Report Preference

Choose `weekly (default), monthly or off` for the owners' usage digest (admins and owners).

Requires an API key.

Request bodyReportPreferenceIn

FieldTypeDefaultDescription
frequency(required)string

Responses

200Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X PUT "$OSR_URL/api/v1/workspace/reports" \
  -H "Authorization: Bearer $OSR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "frequency": "string" }'
Bodyjson
{
  "frequency": "string"
}

post/api/v1/workspace/reports/send

Send Report Now

Email the digest for the last completed period to the caller now (a preview; at most once a minute).

Requires an API key.

Parameters

NameInTypeDefaultDescription
periodquerystring"weekly"

Responses

202Successful Response
422Validation ErrorHTTPValidationError
401Missing, invalid or revoked API key
Requestbash
curl -s -X POST "$OSR_URL/api/v1/workspace/reports/send?period=weekly" \
  -H "Authorization: Bearer $OSR_API_KEY"