Skip to content
On this page

Compatibility

OpenRouter-compatible API

Every OpenRouter REST operation, served natively at the bare path, /v1, and /api/v1.

RelayRouter implements the OpenRouter API surface directly. The same routes answer at /models, /v1/models and /api/v1/models, so an OpenRouter client only needs its base URL changed. Inference routes reuse the native chat path, which means auth, allowlists, quotas, billing, reasoning visibility, forced personas and failover behave identically everywhere.

Base URL

import { OpenRouter } from "@openrouter/sdk";
const client = new OpenRouter({
apiKey: process.env.RELAY_API_KEY,
baseURL: "https://api.relayrouter.org/api/v1",
});

Three equivalent prefixes

Bare paths (/models), /v1/… and /api/v1/… are all valid. Pick whichever your client expects; the response is the same.

Inference

EndpointMethodWhat it does
/messagesPOSTAnthropic Messages API. Translated to the native chat path, then back to the Anthropic shape. Streaming uses Anthropic SSE events.
/responsesPOSTOpenAI Responses API, including streaming (response.created, response.output_text.delta, response.completed).
/rerankPOSTRerank proxy. Billed on model-reported units, or the returned document count when the model omits usage.
/chat/completionsPOSTThe native chat endpoint.
/embeddings, /images, /images/generationsPOSTEmbeddings and image generation.
/audio/speech, /audio/transcriptionsPOSTText-to-speech and speech-to-text.
/videos, /videos/{job}, /videos/{job}/contentPOST/GETCreate a video job, poll it (free), and stream the result. The job→model mapping is stored, so polling needs no ?model=.

Catalog and account

EndpointMethodWhat it does
/models, /models/count, /models/userGETPublic catalog, count, and the caller-scoped catalog. /models supports the documented filters, sorting and paging.
/model/{author}/{slug}GETA model by its author/slug form.
/models/{author}/{slug}/endpointsGETPer-endpoint records for one model.
/providers, /key, /creditsGETProvider list, current key metadata, and remaining credit.
/generation, /generation/content, /generation/feedbackGET/POSTLook up a request by its generation id, read retained content, and submit feedback.
/activity, /analytics/meta, /analytics/queryGET/POSTUsage activity and the analytics query surface.
/benchmarks, /tools, /tools/{name}GETCorrectly shaped empty results: the relay does not operate benchmark scores or server tools.
/oauth/jwksGETAccess-token signing keys. Sessions are HS256, so the list is empty.
/embeddings/models, /images/models, /images/models/{author}/{slug}/endpoints, /videos/modelsGETModality-specific catalogs.
/endpoints/zdrGETWhich endpoints are zero-data-retention capable.
/datasets/rankings-daily, /datasets/app-rankings, /datasets/session-costGETPublic usage datasets, computed from real rows.
/classifications/taskGETTask classification market share.

Model filters

GET /models and GET /models/user accept the documented query parameters. Unrecognised values are ignored rather than rejected.

FieldTypeDescription
qstringCase-insensitive match over id, name and description.
categorystringfree, text, image, audio, video, embedding. all is the default.
contextintegerMinimum context length.
min_price, max_pricenumberInput price per million tokens, in USD.
min_output_price, max_output_pricenumberOutput price per million tokens, in USD.
input_modalities, output_modalitiesstringComma-separated modality filters.
model_authors, providersstringComma-separated author or provider slugs.
supported_parametersstringOnly models that accept all of the listed parameters.
sortstringpricing, context, new, or name.
offset, limitintegerPaging. limit=0 returns everything.
# cheapest models with at least 200k context
curl "https://api.relayrouter.org/api/v1/models?context=200000&sort=pricing&limit=10" \
-H "Authorization: Bearer $RELAY_API_KEY"

Files, batches, containers

EndpointMethodWhat it does
/filesGET/POSTList your files, or upload one (multipart `file` field).
/files/{id}, /files/{id}/contentGET/DELETEMetadata, raw bytes, or delete.
/batches, /batches/{id}GET/POST/DELETESubmit a batch of chat requests (inline or from an uploaded JSON file), poll it, and delete it once terminal.
/containers/{container_id}/filesGETArtifacts written by server-side tool runs.
/containers/{container_id}/files/{file_id}GETContainer file metadata.
/containers/{container_id}/files/{file_id}/contentGETContainer file bytes.
/containers/{container_id}/files/{file_id}/promotePOSTCopy a container file into your Files scope.

Files and batches are scoped to the calling account. An id from another account is indistinguishable from a missing row.

Platform resources

Management resources are real, account-scoped storage — a resource exists because a row exists. Credential responses carry metadata only, never the secret.

GroupEndpoints
PresetsGET /presets, GET /presets/{slug}, POST /presets/{slug}/{chat/completions,messages,responses}, GET /presets/{slug}/versions[/{version}].
BYOKGET/POST /byok, GET/PATCH/DELETE /byok/{id}.
GuardrailsGET/POST /guardrails, GET/PATCH/DELETE /guardrails/{id}, bulk key and member assignment, GET /guardrails/assignments/{keys,members}.
WorkspacesGET/POST /workspaces, GET/PATCH/DELETE /workspaces/{id}, members add/remove, GET /workspaces/{ref}/budgets, GET/PUT/DELETE /workspaces/{ref}/budgets/{interval}.
VaultWorkspace and intern secrets, effective secrets, connections, and copy. See the Vault page.
External usersGET/POST /external-users, GET/PATCH/DELETE /external-users/{user}.
ObservabilityGET/POST /observability/destinations, GET/PATCH/DELETE /observability/destinations/{id}.
SCIMGET /scim/groups, GET/POST /scim/group-mappings, GET/PATCH/DELETE /scim/group-mappings/{id}, POST /scim/sync-jobs, GET /scim/sync-jobs/{id}.
Private endpointsGET/POST /private-endpoints, GET/PATCH/DELETE /private-endpoints/{id}, POST …/{validate,activate,disable,enable}, PUT …/{parameters,pricing}.
OrganizationGET/PATCH /organization/settings, GET /organization/members.
OAuthPOST /auth/keys/code, POST /auth/keys (PKCE exchange), POST /oauth/token (RFC 8693).

Errors

The error contract is identical across every route: model_busy (503, retry after Retry-After), model_not_available (404, do not retry) and invalid_request (400). Internal serving details are never returned to callers.

Empty, not fabricated

Features the relay does not operate (benchmark scores, server tools, container runtimes, app/session datasets) return correctly shaped empty results rather than made-up data.