OPTINROUTER / DEVELOPER DOCS

API reference

Endpoint inventory, availability and planned authorization scopes. All /v1 routes currently return 401 for every supplied key.

Contract preview · Production API access is closed. All /v1 endpoints currently return 401.Install CLI
01

Endpoint and scope matrix

Only the public cached price feed is available today. Scope names are proposed. Validation endpoints are designed to check contracts without publishing or running them.

Method / pathPurposePlanned scope
GET /v1/modelsList eligible modelscatalog:read
POST /v1/chat/completionsOpenAI-format inferenceinference:write
POST /v1/policiesCreate a versioned policypolicy:write
POST /v1/policies/validateValidate a policy without publishingpolicy:validate
GET /v1/policies/{policy_id}Read a policy revisionpolicy:read
POST /v1/grammars/validateValidate a grammar contractgrammar:validate
POST /v1/action-graphs/validateValidate a context action DAGactions:validate
POST /v1/action-graphsPublish a versioned action DAGactions:write
GET /v1/traces/{trace_id}Read a redacted inference tracetrace:read
GET /v1/usageRead scoped usage and costsusage:read
POST /v1/reports/sovereigntyRequest a scoped provenance and sovereignty reportreports:read
GET /api/model-ratesRead the public cached model-rate snapshotPublic read
POST /v1/policies/{policy_id}/activateActivate or roll back an authorized policy revisionpolicy:activate
GET /v1/reports/{report_id}Read a scoped report jobreports:read
POST /v1/grammarsPublish a versioned grammargrammar:write
GET /v1/grammars/{grammar_id}Read a grammar revisiongrammar:read
GET /v1/action-graphs/{graph_id}Read an action graph revisionactions:read
POST /v1/reports/provenanceRequest a scoped provenance reportreports:read
02

Request and response conventions

Use JSON with UTF-8 and bearer authorization for the planned platform APIs. Server-issued IDs identify requests, traces and immutable policy/action revisions. Mutation requests will require an Idempotency-Key scoped to the tenant, operation and canonical payload; reusing a key with different content returns a conflict. Validate APIs have no publication side effect.

03

Proposed policy validation response

A schema check is not a capability certification. Validation also resolves tenant ownership, grammar/tool references, cycles, placement support and required joins. Unknown fields and unsupported controls fail validation.

json
{
  "valid": false,
  "errors": [
    {
      "path": "/routing/regions",
      "code": "region_capability_unverified",
      "message": "The route cannot satisfy the required processing boundary."
    }
  ]
}
04

Protocol support

The first proposed production slice is a certified OpenAI-format chat-completions route. Responses API, Anthropic-format messages, Gemini native, realtime/audio and other formats remain separate future compatibility work. Do not infer support from a logo or an endpoint pattern.

05

Public model snapshot

GET /api/model-rates reads a persisted snapshot. Upstream refresh runs on a two-minute schedule, independently of page requests. Rates are USD per million input/output tokens. Weekly popularity is the source catalog ordering by tokens processed in the last week. It is not global adoption or model quality. Missing benchmark scores remain missing. Base token prices do not include every tier or non-token charge.

Contracts & examples

Download the preview, validate its shape locally and review the capability limits before planning an integration.

OpenAPI preview

OptinRouter AI guide

Product and developer guidance.

A good place to start

What would you
like to know?

Ask about public APIs, policies, grammars, context actions or the product. This guide uses approved information and can’t reveal private details or take actions.

Recent messages stay in this page’s memory. Reload or reset to clear them here.