LogoToRouter Docs
LogoToRouter Docs
HomepageWhat is ToRouter5-minute quickstartCore concepts
Base URL & authenticationOpenAI-compatible APIAnthropic-compatible APIGemini-compatible APIStreaming responses (SSE)Model identifiers & vendor prefixesPlayground — test in the browser
Gateway

Base URL & authentication

Endpoint table for the ToRouter gateway — OpenAI, Anthropic and Gemini protocols, with both /v1 and /api/v1 mount points.

ToRouter exposes three protocol-compatible surfaces. Point your SDK at the matching base_url and ToRouter handles the rest.

Endpoint table

The backend mounts every gateway path under both /v1/* and /api/v1/*. Pick the form your SDK expects.

ProtocolSDK base_urlAuth header
OpenAIhttps://portal.torouter.ai/v1Authorization: Bearer sk-***
OpenAI (OpenRouter style)https://portal.torouter.ai/api/v1Authorization: Bearer sk-***
Anthropichttps://portal.torouter.aix-api-key: sk-*** + anthropic-version: 2023-06-01
Anthropic (with /api)https://portal.torouter.ai/apisame
Geminihttps://portal.torouter.ai/v1beta?key=sk-*** or x-goog-api-key: sk-***
Gemini (with /api)https://portal.torouter.ai/api/v1betasame

The Anthropic SDK auto-appends /v1/messages, so the base URL stays at the host root.

Quick test

curl https://portal.torouter.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-***" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-5","messages":[{"role":"user","content":"hi"}]}'
curl https://portal.torouter.ai/v1/messages \
  -H "x-api-key: sk-***" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-opus-4-7","max_tokens":256,"messages":[{"role":"user","content":"hi"}]}'
curl "https://portal.torouter.ai/v1beta/models/gemini-3-flash-preview:generateContent?key=sk-***" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"parts":[{"text":"hi"}]}]}'

Don't have a key yet? See Create your first API key.

Next steps

OpenAI-compatible API

Chat, Responses, Embeddings, Images.

Anthropic-compatible API

Native /v1/messages.

Gemini-compatible API

Native /v1beta.

Streaming responses

SSE for all three protocols.

Rotate or revoke a key

Replace a leaked ToRouter API key, or instantly revoke one you no longer need.

OpenAI-compatible API

Use the OpenAI SDK with ToRouter for chat completions, responses, embeddings and image generation.

Table of Contents

Endpoint tableQuick testNext steps