providerCatalog top-level constant
The built-in provider table.
Build-time provider filtering: the FA_PROVIDERS dart-define
restricts the binary to a subset of providers —
dart compile exe -DFA_PROVIDERS=dial,codemie builds a CLI that offers
ONLY those (plus saved custom openai-like endpoints; custom is always
available). Unset or all keeps every provider. The ProviderSpec map
itself stays complete (adapters, tests, config parsing unchanged); the
filter applies at every user-facing surface: the catalog lookups
(catalogProvider), the CLI pickers, /provider status, the model
pickers, and key-name collection.
Implementation
const providerCatalog = <String, ProviderSpec>{
'aiin': ProviderSpec(
name: 'aiin',
// Own kind (the minimax/zai pattern) so `--provider aiin` and the parity
// guards treat AIIN as a first-class provider; chat is OpenAI-compatible,
// so providerStreamFunction routes it to the OpenAI completions adapter.
kind: 'aiin',
api: 'openai-completions',
defaultBaseUrl: '$aiinApiBaseUrl/v1',
apiKeyEnvNames: ['AIIN_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
),
'openrouter': ProviderSpec(
name: 'openrouter',
kind: 'openai-completions',
api: 'openai-completions',
defaultBaseUrl: 'https://openrouter.ai/api/v1',
apiKeyEnvNames: ['OPENROUTER_API_KEY', 'OPENAI_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
),
'kimi': ProviderSpec(
name: 'kimi',
kind: 'openai-completions',
api: 'openai-completions',
defaultBaseUrl: 'https://api.kimi.com/coding/v1',
apiKeyEnvNames: ['KIMI_API_KEY', 'OPENAI_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
),
'openai': ProviderSpec(
name: 'openai',
kind: 'openai-completions',
api: 'openai-completions',
defaultBaseUrl: 'https://api.openai.com/v1',
apiKeyEnvNames: ['OPENAI_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
),
'chatgpt': ProviderSpec(
name: 'chatgpt',
kind: 'chatgpt-codex',
api: 'responses',
defaultBaseUrl: chatGptCodexBaseUrl,
apiKeyEnvNames: ['CHATGPT_OAUTH_CREDENTIALS'],
contextWindow: 128000,
maxTokens: 16384,
// OAuth account creds + the Codex Responses wire exist only on
// chatgpt.com; a persisted pair pointing the kind at another host is
// not servable (the boot restore degrades it).
endpointLocked: true,
),
'copilot': ProviderSpec(
name: 'copilot',
kind: 'copilot',
api: 'openai-completions',
defaultBaseUrl: copilotIndividualBaseUrl,
apiKeyEnvNames: ['COPILOT_GITHUB_TOKEN'],
contextWindow: 1000000,
maxTokens: 32768,
),
'codemie': ProviderSpec(
name: 'codemie',
kind: 'openai-completions',
api: 'openai-completions',
defaultBaseUrl: '$defaultCodeMieBaseUrl/code-assistant-api/v1',
apiKeyEnvNames: ['CODEMIE_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
),
'dial': ProviderSpec(
name: 'dial',
kind: 'dial',
api: 'openai-completions',
defaultBaseUrl: 'https://ai-proxy.lab.epam.com',
apiKeyEnvNames: ['DIAL_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
),
'minimax': ProviderSpec(
name: 'minimax',
// Chat is OpenAI-compatible (MiniMax-M3 works via the OpenAI completions
// adapter, including vision); image generation uses a separate dialect
// handled in generate_image.dart (detected by the baseUrl marker). The
// kind is its own so `--provider minimax` and the parity guards treat it
// as a first-class provider; providerStreamFunction routes it to the
// OpenAI completions adapter.
kind: 'minimax',
api: 'openai-completions',
defaultBaseUrl: 'https://api.minimax.io/v1',
apiKeyEnvNames: ['MINIMAX_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
),
'anthropic': ProviderSpec(
name: 'anthropic',
kind: 'anthropic',
api: anthropicMessagesApi,
defaultBaseUrl: 'https://api.anthropic.com',
apiKeyEnvNames: ['ANTHROPIC_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
),
'google': ProviderSpec(
name: 'google',
kind: 'google',
api: 'google-generative-ai',
defaultBaseUrl: 'https://generativelanguage.googleapis.com/v1beta',
apiKeyEnvNames: ['GOOGLE_API_KEY'],
contextWindow: 1000000,
maxTokens: 16384,
),
'zai': ProviderSpec(
name: 'zai',
// Own kind (the minimax pattern) so `--provider zai` and the parity
// guards treat Z.AI as a first-class provider; chat is OpenAI-
// compatible, so providerStreamFunction routes it to the OpenAI
// completions adapter.
kind: 'zai',
api: 'openai-completions',
// The CODING plan endpoint — the plain /api/paas/v4 root serves a
// different, non-agentic model set.
defaultBaseUrl: 'https://api.z.ai/api/coding/paas/v4',
apiKeyEnvNames: ['ZAI_API_KEY', 'Z_AI_API_KEY'],
contextWindow: 200000,
maxTokens: 16384,
// glm-5.3 (the coding endpoint's flagship) is text-only; the per-id
// vision heuristic covers the `...v` variants when one is selected.
input: ['text'],
),
};