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.
| Protocol | SDK base_url | Auth header |
|---|---|---|
| OpenAI | https://portal.torouter.ai/v1 | Authorization: Bearer sk-*** |
| OpenAI (OpenRouter style) | https://portal.torouter.ai/api/v1 | Authorization: Bearer sk-*** |
| Anthropic | https://portal.torouter.ai | x-api-key: sk-*** + anthropic-version: 2023-06-01 |
Anthropic (with /api) | https://portal.torouter.ai/api | same |
| Gemini | https://portal.torouter.ai/v1beta | ?key=sk-*** or x-goog-api-key: sk-*** |
Gemini (with /api) | https://portal.torouter.ai/api/v1beta | same |
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.