Auto Router
by 0G
Picks a model for each conversation based on its task, from the models your routing rules allow. You pay the price of the model it picks, plus a small classification charge when a conversation starts. To limit which models Auto can choose, go to Console › Routing.
Selected model's price
+ about $0.00004 to classify a new conversation
Top-ranked for the task
Within your routing rules
29
Coding, agents, data and general tasks
About 1 s
First turn only, for task classification
How it works
1Classify the conversation
The opening of the conversation, the system prompt and the first user message, truncated, goes to a small classifier model (Vela) end-to-end encrypted. Only text is read: images are noted, never sent. The task is remembered for 24 hours per API key, so later turns are not classified again and stay on the same model.
2Apply your routing rules
Only models your account's and API key's routing rules allow are considered, with their trust mode, encrypted transit and price caps. A request with images only goes to models that accept images.
3Pick the top model and send
The highest-ranked model for that task is picked. Rankings follow OpenRouter's per-task leaderboard, limited to the models 0G serves. The request is then sent as if you had named that model: provider choice, fallbacks and billing work as usual, and whether it is end-to-end encrypted depends on that model.
Task categories
A request that cannot be classified is treated as general and still runs.
- Coding
- General implementationFile read/writeDebuggingCode review & securityShell executionFrontend / UIRepo scanDevOps configSQL / databases
- Agents
- Workflow executionMulti-step planningTool dispatchWeb searchMemory extraction
- Data
- ExtractionTransformation
- General
- Classification & taggingContent writingRoleplay / fictionQ&A / knowledgeConversationResearch reportsCustomer supportSummarizationSecurity auditMathFinance & tradingTranslationDevOps
Limit what Auto can choose
Auto follows your routing rules: allowed models, trust mode, encrypted transit, provider lists and price caps. Rules set on an API key replace the account's, rule by rule.
API
curl "https://router-api.0g.ai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-d '{
"model": "0g/auto",
"messages": [
{"role": "user", "content": "Hello!"}
],
"stream": true
}'See which model answered
The response is the picked model's normal response. The body's model field names the model that answered, and these headers say why:
- X-0G-Auto-Model
- The model that answered
- X-0G-Auto-Task
- The task category it was picked for;
generalwhen not classified - X-0G-Auto-Classifier-E2EE
sealedwhen the classification was end-to-end encrypted,nonewhen not. Absent when not classified
Other features
Billing
- The request is billed at the price of the model that answered, as if you had named it.
- Classifying a new conversation is billed as its own request to Vela, about 1,050 input tokens (about $0.00004). Later turns of the same conversation are not classified again, and a request that is not classified, such as one that pins a provider, is not charged for it.
- Both show in Activity: the request under the model that answered, and the classification under Vela.
Privacy
With X-0G-Provider-Trust-Mode: private, Auto only picks models served by TEE providers. A request with images or web search can then fail with auto_no_eligible_model when no such model fits.
With X-0G-Encrypted-Transit: required, Auto only picks models that can be end-to-end encrypted, so the whole conversation is, the classification included. A request with images can then fail with auto_no_eligible_model, as few such models accept images.