Documentation Index
Fetch the complete documentation index at: https://mintlify.com/router-for-me/CLIProxyAPI/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The CLI Proxy API supports OAuth authentication for various AI providers. OAuth credentials are stored in theauth-dir directory and managed through the Management API or CLI.
Supported OAuth Providers
The following providers support OAuth authentication:- Gemini CLI (
gemini-cli) - Google Gemini via CLI authentication - Vertex AI (
vertex) - Google Vertex AI with service accounts - AI Studio (
aistudio) - Google AI Studio - Antigravity (
antigravity) - Gemini 3.0 experimental access - Claude (
claude) - Anthropic Claude via OAuth - Codex (
codex) - OpenAI Codex - Qwen (
qwen) - Alibaba Qwen models - iFlow (
iflow) - iFlow AI - Kimi (
kimi) - Moonshot AI Kimi
OAuth Model Aliases
Global OAuth model name aliases allow you to rename model IDs for both model listing and request routing.Per-channel model name aliases. Each channel can have multiple aliases defined.
Aliases do not apply to API key-based providers (
gemini-api-key, codex-api-key, claude-api-key, openai-compatibility, vertex-api-key, ampcode). Those providers have their own per-credential alias systems.Alias Configuration
Each alias entry has three properties:Original model name under this channel.
Client-visible alias for the model.
When true, keep the original model name and add the alias as an extra model. When false, replace the original name with the alias.
OAuth Alias Example
OAuth Excluded Models
Exclude specific models from OAuth providers using patterns.Per-provider model exclusion lists. Each provider can have multiple exclusion patterns.
Exclusion Patterns
Supports four pattern types:- Exact match:
"gemini-2.5-pro"- Excludes only this exact model - Prefix wildcard:
"gemini-2.5-*"- Excludesgemini-2.5-flash,gemini-2.5-pro, etc. - Suffix wildcard:
"*-preview"- Excludesgemini-3-pro-preview,claude-opus-preview, etc. - Substring wildcard:
"*flash*"- Excludesgemini-2.5-flash-lite,flash-pro, etc.
Exclusion Example
Wildcard patterns are case-insensitive and match against lowercase model names.
OAuth Setup
1. Configure Authentication Directory
2. Enable Management API
3. Initiate OAuth Flow
Use the Management API to start OAuth authentication:4. Complete Authorization
Open theauth_url in a browser, authorize the application, and copy the callback URL.
5. Exchange Code for Token
6. Verify Session
Complete OAuth Configuration Example
Provider-Specific Notes
Gemini CLI
gcloud CLI or service account.
Claude OAuth
Vertex AI
Best Practices
Exclusion vs Aliases:Exclusions are applied before aliases. If you exclude a model, you cannot create an alias for it.
Troubleshooting
OAuth Flow Fails
- Check Management API is enabled (
secret-keyis set) - Verify
auth-direxists and is writable - Ensure OAuth provider supports your account type
Models Not Appearing
- Check
oauth-excluded-modelsfor matching patterns - Verify OAuth session is active (
GET /v0/management/sessions) - Ensure provider supports the requested models
Aliases Not Working
- Verify channel name matches provider exactly (case-sensitive)
- Check for typos in
namefield (must match upstream model name) - Ensure
fork: falseif you want to replace (not add to) model name