Auto Router
OpenRouterReleased Nov 8, 2023
Your prompt will be processed by a meta-model and routed to one of dozens of models (see below), optimizing for the best possible output. To see which model was used,...
- Context window
- 2M tokens
- Input
- text, image, audio, file, video
- Output
- text, image
- Tokenizer
- Router
- Released
- Nov 8, 2023
Pricing
Per 1M tokens. The provider price and our flat 3% fee are separate columns — what you pay is their sum.
Variable pricing — this router selects an underlying model per request, and you pay that model's price + 3%.
Supported parameters
- frequency_penalty
- include_reasoning
- logit_bias
- logprobs
- max_completion_tokens
- max_tokens
- min_p
- presence_penalty
- reasoning
- repetition_penalty
- response_format
- seed
- stop
- structured_outputs
- temperature
- tool_choice
- tools
- top_a
- top_k
- top_logprobs
- top_p
- web_search_options
Call it
OpenAI-compatible: point your SDK at api.openkey.ai/v1 and use model openrouter/auto.
curl https://api.openkey.ai/v1/chat/completions \
-H "Authorization: Bearer $OPENKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openrouter/auto",
"messages": [{"role": "user", "content": "Hello"}]
}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.openkey.ai/v1",
api_key=os.environ["OPENKEY_API_KEY"],
)
completion = client.chat.completions.create(
model="openrouter/auto",
messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.openkey.ai/v1",
apiKey: process.env.OPENKEY_API_KEY,
});
const completion = await client.chat.completions.create({
model: "openrouter/auto",
messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);Questions
- What is Auto Router's context window?
- Auto Router accepts up to 2M tokens of context.
- Is Auto Router OpenAI-compatible?
- Yes. Send requests to OpenKey's /v1/chat/completions endpoint with model "openrouter/auto" using any OpenAI SDK — only the base URL and API key change.
- What inputs does Auto Router support?
- Auto Router accepts text, image, audio, file, video input and produces text, image output.
More from OpenRouter
All OpenRouter models →Fusion
Fusion turns your prompt into a small multi-model deliberation. A panel of expert models (see below) analyzes your prompt in parallel with web search and web fetch enabled, then a...
ctx 1Min Variableout Variable
Pareto Code Router
The Pareto Router maintains a tiered shortlist of strong coding models, ranked by [Artificial Analysis](https://artificialanalysis.ai/) coding percentiles. Set min_coding_score between 0 and 1 on the [pareto-router plugin](https://openrouter.ai/docs/guides/routing/routers/pareto-router#the-min_coding_score-parameter) to control how...
ctx 2Min Variableout Variable
Free Models Router
The simplest way to get free inference. openrouter/free is a router that selects free models at random from the models available on OpenRouter. The router smartly filters for models that...
ctx 200Kin Freeout Free
Body Builder (beta)
Transform your natural language requests into structured OpenRouter API request objects. Describe what you want to accomplish with AI models, and Body Builder will construct the appropriate API calls. Example:...
ctx 128Kin Variableout Variable