Base URLs#
| Protocol | Base URL | Notes |
|---|
| OpenAI compatible | https://api.flyrouter.ai/v1 | For the OpenAI SDK and most clients (includes /v1) |
| Anthropic native | https://api.flyrouter.ai | The Anthropic SDK and Claude Code append /v1/messages (no /v1) |
| Gemini native | https://api.flyrouter.ai | The Google Gen AI SDK appends /v1beta/models/... (no /v1) |
Authentication#
Every endpoint is authenticated with an API key. See Authentication:
- OpenAI compatible:
Authorization: Bearer sk-...
- Anthropic native:
x-api-key: sk-... (Authorization: Bearer also works), plus anthropic-version: 2023-06-01
- Gemini native:
Authorization: Bearer sk-... or x-goog-api-key: sk-...
Endpoints#
OpenAI compatible#
Anthropic native#
| Method | Path | Description |
|---|
POST | /v1/messages | Messages, recommended for Claude |
Gemini native#
| Method | Path | Description |
|---|
POST | /v1beta/models/{model}:generateContent | Generate content |
POST | /v1beta/models/{model}:streamGenerateContent | Stream generated content |
| Method | Path | Description |
|---|
GET | /v1/dashboard/billing/subscription | Key budget |
GET | /v1/dashboard/billing/usage | Key spend |
Choosing a protocol#
- Claude: use the Anthropic native protocol for the fullest support of prompt caching, reasoning and tool use.
- GPT: Chat Completions or Responses both work; Responses is recommended for new projects.
- Gemini: the Gemini native or OpenAI-compatible protocol both work.
- Code or tools that only speak OpenAI: call any text model through the OpenAI-compatible protocol.
Errors and rate limits#
Errors return the matching HTTP status code in the protocol's error format. When you send requests too quickly you get a 429; lower concurrency and retry with exponential backoff. See Errors and retries for every status code and retry advice.