Documentation › Public pages and API

API overview

The endpoint, outcomes, calls and nodes, Model Compare settings, kept content, re-runs and comparisons, passports and their export, public verification, and what the assurance features expose.

Authentication#

The base is https://www.ospp.it.com/api. Every call carries Authorization: Bearer <OSPP API key>, except the public addresses, which need no key, and the outcome address of a call, which is its own secret.

The endpoint#

The one way to send work through OSPP. It is OpenAI-compatible; the base URL for a client is https://www.ospp.it.com/api/v1/openai.

CallWhat it does
POST /v1/openai/chat/completionsOne call to the model you name. The answer comes back with its passport, or with the run id while the passport is still pending
GET /v1/openai/modelsThe models you can name, each with ospp: what it supports (tools, JSON output, JSON schema, images, streaming live or replayed) and its price per million tokens
GET /v1/runs/{run_id}The state of one call; where to read the passport id when the answer said it was pending

An unknown or misspelled model is answered 404 model_not_found with close names.

See The endpoint, Request headers and Responses.

Outcomes#

CallWhat it does
POST /v1/o/<run_id>/<token>The outcome address of one call, given in X-OSPP-Outcome-URL and ospp.outcome_url. No API key. Takes {"values": {"score": 1}} or a flat object of whole numbers, with optional observed_at and idempotency_key
GET /v1/o/<run_id>/<token>Describes the address and what it takes
POST /v1/outcomesThe same with the API key: {"passport_id": "...", "values": {...}}
GET /v1/passports/{id}/outcomeThe outcome of a passport: the latest value of each metric and every update

The outcome address answers 409 PASSPORT_PENDING until the passport is issued, and 409 NO_PASSPORT when the call failed. It takes at most 30 updates per minute per passport; more answer 429. The default metrics score and count are created on the node's first outcome. See Outcomes.

Calls and nodes#

CallWhat it does
GET /v1/callsYour calls through the endpoint, newest first. Filters: node, model, trace, reference, since, until, status, compare. Up to 200 per page; page with before, taken from next_before
GET /v1/calls/summary?range=30dThe figures for one range (24h, 7d, 30d, 90d or 365d), per node and model: calls, passports, errors, cost, median duration, tokens, tool-call validity and the outcome reported
GET /v1/nodesYour nodes: name, models used, call count, first and last call, the Model Compare setting
GET /v1/nodes/{node}/settingsA node's Model Compare switch and retention period, and how many calls are kept
PUT /v1/nodes/{node}/settingsSets model_compare, retention_days (1 to 365) and, with delete_kept: true, deletes the content already kept
GET /v1/passports/{id}/contentThe conversation and the answer of a call, while OSPP keeps them

Here {node} is the node's name. Tool-call validity counts tool calls that name an undeclared tool or carry malformed arguments. Re-runs are counted apart and stay out of the other figures. An organisation with its own gateway cannot switch Model Compare on at OSPP (409 SELF_HOSTED_GATEWAY): the content stays on its gateway. Content that is not kept answers 409 CONTENT_NOT_KEPT. See Passports and Model Compare.

Running a call again#

CallWhat it does
POST /v1/passports/{id}/rerunRuns the call again on another model: {"model": "provider/model"}. A new passport that names the original
GET /v1/runs/{run_id}/replayThe re-run next to the original, side by side
POST /v1/compareRuns a selection again on several models: {passport_ids, models, title?, repeats?}. 1 to 50 passports of one node version, 1 to 8 models, repeats 1 to 5
GET /v1/compareYour comparisons, with their progress
GET /v1/experiments/{id}/comparisonThe result of one comparison, as it fills

A re-run needs the content of the original call: Model Compare on for its node, inside the retention period. Re-runs are billed as normal calls and kept out of the node's production figures. See Model Arena.

Passports#

CallWhat it does
GET /v1/passportsYour organisation's passports
GET /v1/passports/{id}One passport
GET /v1/passports/{id}/exportThe passport as a .ospp file
POST /v1/passports/exportA zip of .ospp files plus index.csv: {"passport_ids": [...]}, up to 500
GET /v1/passports/{id}/historyWhat was recorded on the passport after it was issued

A single passport's file is also public, without a key: the address in X-OSPP-Passport-File, which is the passport's verify address followed by /bundle. Save it as <id>.ospp. Search, retention and legal holds are in passport management on the Platform.

Your own provider keys#

CallWhat it does
GET, POST /v1/credentials; DELETE /v1/credentials/{id}Your own provider keys in the vault: store, list (ids and providers only) and revoke. With your own key the model use is not charged by OSPP

Public verification#

No key needed.

CallWhat it does
GET /v1/public/passports/{id}The public page of a passport
GET /v1/public/passports/{id}/bundleThe bundle a verifier checks offline
GET /v1/public/verify/{id}The rule-by-rule verification result for one passport id
POST /v1/public/verifyVerifies a .ospp file or a passport id: rules, status, freshness
POST /v1/public/verify/batchUp to 200 passport ids or links at once

The other public addresses are listed under Public pages.

Assurance#

AreaEndpoints
StatementsGET, POST /v1/statements; GET, PUT, DELETE /v1/statements/{id}; POST /v1/statements/{id}/issue, /withdraw; GET /v1/statements/{id}/pdf
ReceiptsGET, PUT /v1/procedures/{version}/receipt-spec; POST /v1/passports/{id}/receipt; GET /v1/receipts; GET /v1/receipts/{id}; POST /v1/receipts/{id}/withdraw
Content credentialsPOST, GET /v1/passports/{id}/credential; public: GET /v1/public/credentials/{id}, POST /v1/public/credentials/verify
ComplianceGET /v1/evidence; GET /v1/procedures/{version}/evidence; GET, PUT /v1/evidence/policy; GET, POST /v1/evidence/holds; POST /v1/evidence/holds/{id}/release; GET, POST /v1/evidence/packs; GET /v1/evidence/packs/{id}, /{id}/download
Assurance profileGET /v1/procedures/{version}/assurance-profile
Model watchGET /v1/models; GET /v1/models/{provider}/{model}; GET /v1/models/notices; POST /v1/models/notices/read; replays: POST /v1/passports/{id}/replay, GET /v1/passports/{id}/replays
FinanceGET /v1/finance/statement?period=YYYY-MM; GET /v1/finance/periods

In these paths {version} is a node version, the value the endpoint returns in X-OSPP-Node. The features are described in the Assurance section.

Errors#

The endpoint answers errors in OpenAI's error shape, so existing clients show the message; see Errors. The other calls answer JSON problems with a code and a plain-words message; the codes are stable, the messages are for people.

How the Platform and the admin UI call OSPP#

Neither puts the organisation's API key in a browser. The Platform relays a signed-in member's calls through /api/organizations/{org}/ospp/…; the self-hosted admin UI through /admin/api/ospp/…. Both pass only an allow-listed set of calls, name the person acting in a header, and stream files such as packs, PDFs and CSV through a separate route. Owners' and admins' actions are enforced at the relay as well as at OSPP.