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.

ParameterTypeRequiredDescription
OpenAI-compatiblebase URLrequiredhttps://onerouter.com/v1
Claude nativebase URLrequiredhttps://onerouter.com
Gemini nativebase URLrequiredhttps://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_KEY

OpenAI-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/completions

Chat completions for text, vision, tools, and streaming.

POST/v1/responses

Responses API for agents, reasoning, and multi-step output.

POST/v1/embeddings

Vector embeddings for text input.

POST/v1/images/generations

Image generation (model-dependent).

POST/v1/audio/speech

Text-to-speech and other audio routes.

POST/v1/rerank

Rerank documents against a query.

POST/v1/moderations

Classify content for safety.

GET/v1/models

List models available to your key.

Claude (Anthropic) endpoints

Anthropic-compatible clients use the base URL https://onerouter.com and call /v1/messages.

POST/v1/messages

Claude Messages API.

POST/v1/messages/count_tokens

Count 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}:generateContent

Generate content with the Gemini schema.

POST/v1beta/models/{model}:streamGenerateContent

Stream Gemini content events.

GET/v1beta/models

List 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.