n8n-io/n8n · error · Error
Unsupported provider: "${provider}". Supported providers: ${
Error message
Unsupported provider: "${provider}". Supported providers: ${SUPPORTED_PROVIDERS} What it means
After splitting the model ID at the first `/`, `createModel` looks up the provider segment in `LANGUAGE_PROVIDERS`. If the provider key is not in the registry it throws, listing all supported providers. The registry currently includes: `openai`, `custom`, `anthropic`, `google`, `google-vertex`, `mistral`, `cohere`, `microsoft-azure`, `aws-bedrock` (per the registry definition).
Source
Thrown at packages/@n8n/agents/src/runtime/model/model-factory.ts:239
if (isLanguageModel(config)) {
return config;
}
const rawId = typeof config === 'string' ? config : config.id;
if (!rawId || rawId.trim() === '') {
throw new Error('Model ID is required');
}
const slashIndex = rawId.indexOf('/');
if (slashIndex <= 0) {
throw new Error(`Invalid model ID "${rawId}": expected "provider/model-name" format`);
}
const provider = rawId.slice(0, slashIndex) as ProviderId;
const modelName = rawId.slice(slashIndex + 1);
const entry = LANGUAGE_PROVIDERS[provider];
if (!entry) {
throw new Error(
`Unsupported provider: "${provider}". Supported providers: ${SUPPORTED_PROVIDERS}`,
);
}
// Collect credential fields: strip `id`, pass the rest to Zod validation.
let credFields: Record<string, unknown> = {};
if (typeof config !== 'string') {
const { id: _id, ...rest } = config as { id: string; [k: string]: unknown };
credFields = rest;
}
// Host configs (e.g. Instance AI's `{ id, url }` for OpenAI-compatible
// endpoints) spell the base URL as `url`; the provider schemas only know
// `baseURL`, and Zod strips unknown keys, so normalize before validation.
// An EMPTY url means "no custom endpoint" (Instance AI emits `url: ''` for
// the api-key-only config) and must keep the provider default.
if (typeof credFields.url === 'string' && credFields.baseURL === undefined) {
const { url, ...restCreds } = credFields;
credFields = url ? { ...restCreds, baseURL: url } : restCreds;View on GitHub (pinned to 5ac6606e81)
Solutions
- Read the error message — it lists all supported provider keys.
- Correct the provider segment to match a registered key exactly (e.g. `anthropic` not `anthrpic`).
- For OpenAI-compatible custom endpoints, use the `custom/` provider prefix and supply `baseURL` and `apiKey` in the config.
- If you need a genuinely new provider, add an entry to `LANGUAGE_PROVIDERS` in model-factory.ts and install the corresponding `@ai-sdk/*` package.
Example fix
// before:
createModel('anthrpic/claude-sonnet-4-5'); // typo
// after:
createModel('anthropic/claude-sonnet-4-5'); Defensive patterns
Strategy: validation
Validate before calling
import { SUPPORTED_PROVIDERS } from './model-factory'; // export if needed
const KNOWN_PROVIDERS = new Set(['openai','custom','anthropic','google','google-vertex','mistral','cohere','microsoft-azure','aws-bedrock']);
function validateProvider(modelId: string): void {
const provider = modelId.slice(0, modelId.indexOf('/'));
if (!KNOWN_PROVIDERS.has(provider)) {
throw new Error(`Unknown provider "${provider}". Known: ${[...KNOWN_PROVIDERS].join(', ')}`);
}
}
validateProvider(config.modelId); Type guard
function isKnownProvider(modelId: string): boolean {
const provider = modelId.slice(0, modelId.indexOf('/'));
return ['openai','custom','anthropic','google','google-vertex','mistral','cohere','microsoft-azure','aws-bedrock'].includes(provider);
} Prevention
- Keep an up-to-date list of supported providers in your config/UI validation.
- For custom OpenAI-compatible endpoints, always use the `custom/` prefix.
- Validate at config-load time so the user gets the error in the UI, not at runtime.
When it happens
Trigger: Calling `createModel('huggingface/llama-3')` where `huggingface` is not a registered provider. Using a typo like `createModel('anthrpic/claude-sonnet-4-5')`. Using a provider alias that does not exist in the registry.
Common situations: Typo in the provider name. The desired provider's `@ai-sdk/*` package is not installed (though this error is about the registry key, not the package). A custom/self-hosted model endpoint was given a provider name not in the registry (should use `custom/` instead).
Related errors
- Unsupported embedding provider: "${provider}". Supported: ${
- Model ID is required
- Invalid model ID "${rawId}": expected "provider/model-name"
- Invalid credentials for provider "${provider}": ${issues}
- Cannot decrease maxIterations when resuming a run. Expected
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/60b05676274d6e0f.
Report an issue: GitHub.