API Reference
OneRouter is a transparent gateway. It validates your key, forwards the request to the upstream model, records metadata and usage, and returns the upstream response. Pick the protocol your client already speaks.
Base URLs
Use the shortest protocol-specific base URL that matches your client. OpenAI-compatible SDKs use https://onerouter.com/v1. Claude native requests use https://onerouter.com with /v1/messages. Gemini native requests use https://onerouter.com/v1beta or the /gemini/* compatibility prefix.
| Parameter | Type | Required | Description |
|---|---|---|---|
| OpenAI-compatible | base URL | required | https://onerouter.com/v1 |
| Claude native | base URL | required | https://onerouter.com |
| Gemini native | base URL | required | https://onerouter.com/v1beta |
Authentication
Send your OneRouter API key with every request. OpenAI-compatible clients should use Authorization: Bearer YOUR_API_KEY. Gemini-native clients may also use x-goog-api-key. Keys are issued from the console and use the OneRouter key format.
Authorization: Bearer YOUR_API_KEYOpenAI-compatible endpoints
Point any OpenAI SDK at https://onerouter.com/v1. These routes mirror the OpenAI REST API and are forwarded upstream as-is.
| POST | /v1/chat/completionsChat completions for text, vision, tools, and streaming. |
| POST | /v1/responsesResponses API for agents, reasoning, and multi-step output. |
| POST | /v1/embeddingsVector embeddings for text input. |
| POST | /v1/images/generationsImage generation (model-dependent). |
| POST | /v1/audio/speechText-to-speech and other audio routes. |
| POST | /v1/rerankRerank documents against a query. |
| POST | /v1/moderationsClassify content for safety. |
| GET | /v1/modelsList models available to your key. |
Claude (Anthropic) endpoints
Anthropic-compatible clients use the base URL https://onerouter.com and call /v1/messages.
| POST | /v1/messagesClaude Messages API. |
| POST | /v1/messages/count_tokensCount tokens for a Messages request when supported. |
Gemini endpoints
Gemini-compatible clients use https://onerouter.com/v1beta and the :generateContent style paths, or the /gemini/* compatibility prefix.
| POST | /v1beta/models/{model}:generateContentGenerate content with the Gemini schema. |
| POST | /v1beta/models/{model}:streamGenerateContentStream Gemini content events. |
| GET | /v1beta/modelsList Gemini-compatible models. |
Model-dependent features
OneRouter keeps protocol compatibility and forwards model-specific parameters where supported. Features such as tool calling, structured output, reasoning, prompt caching, web search, image input, audio input, video generation, and provider-specific options depend on the selected model and upstream provider. Check the model detail page before relying on a feature in production.