Skip to content

API overview

primerouter exposes a REST API fully compatible with OpenAI, plus native support for Anthropic Messages and Google Gemini.

Base URL

https://primerouter.ai

OpenAI-style endpoints are under /v1/.... Claude-style endpoints are listed in API Reference.

Authentication

Authorization: Bearer sk-your-key

Or Anthropic-style:

x-api-key: sk-your-key

Get a key: log in → Tokens → create.

Main endpoints

EndpointUse
POST /v1/chat/completionsMulti-turn chat (OpenAI-compatible, most common)
POST /v1/responsesOpenAI Responses API
POST /v1/messagesAnthropic Messages (native Claude)
POST /v1/embeddingsVector embeddings
POST /v1/images/generationsText to image
POST /v1/images/editsImage editing, multiple reference images
POST /v1/audio/speechTTS
POST /v1/audio/transcriptionsWhisper STT
GET /v1/modelsList models
POST /v1/rerankDocument reranking

Full schema and examples: API Reference (interactive viewer).

Sub-topics

SDKs and examples

primerouter does not ship a dedicated SDK — the goal is for you to keep using your existing SDK. See Migrate from OpenAI SDK.

Rate limits

Each API key is bound by:

  • User-level RPM / TPM (depends on your group)
  • Model-level RPM (some models have upstream limits)

Hitting the limit returns 429 Too Many Requests with a Retry-After header. See Error codes.

Built for transparent, auditable, crypto-native AI inference. About · Terms · Privacy