langflow-ai/langflow · error · HTTPException
Missing required configuration for {provider}: {', '.join(mi
Error message
Missing required configuration for {provider}: {', '.join(missing_keys)}. Please configure these in Settings > Model Providers. What it means
Raised when the chosen model provider is enabled and mapped, but one or more of its required configuration variables (API keys, base URLs, etc. from get_provider_required_variable_keys) have no value stored for the current user. The assistant cannot run a flow that embeds a model without those credentials. HTTP 400; the detail lists the exact missing variable names.
Source
Thrown at src/backend/base/langflow/agentic/api/router.py:104
status_code=400,
detail=f"Provider '{provider}' is not configured. Available providers: {enabled_providers}",
)
api_key_name = provider_variable_map.get(provider)
if not api_key_name:
raise HTTPException(status_code=400, detail=f"Unknown provider: {provider}")
model_name = request.model_name or get_default_model(provider, user_id=user_id) or ""
# Get all configured variables for the provider
provider_vars = get_all_variables_for_provider(user_id, provider)
# Validate all required variables are present
required_keys = get_provider_required_variable_keys(provider)
missing_keys = [key for key in required_keys if not provider_vars.get(key)]
if missing_keys:
raise HTTPException(
status_code=400,
detail=(
f"Missing required configuration for {provider}: {', '.join(missing_keys)}. "
"Please configure these in Settings > Model Providers."
),
)
global_vars: dict[str, str] = {
"USER_ID": str(user_id),
"FLOW_ID": request.flow_id,
"MODEL_NAME": model_name,
"PROVIDER": provider,
}
# Seeded here (not per-endpoint) so /assist and /execute/{flow_name}
# honor the budget the same way /assist/stream does.
if request.iterations_limit is not None:
global_vars["ITERATIONS_LIMIT"] = str(request.iterations_limit)View on GitHub (pinned to 976ec789d2)
Solutions
- Open Settings > Model Providers in the Langflow UI and fill in every variable named in the error detail, then retry.
- If multiple providers are configured, retry with request.provider pointing at one whose required keys are all set.
- Programmatically, upsert the missing variables via the variables API (POST /api/v1/variables) for the current user before calling the assistant endpoint.
- Check with get_provider_required_variable_keys(provider) in your environment/tooling to know exactly which keys are mandatory.
Example fix
# before
resp = await client.post('/api/v1/agentic/assist', json={'provider': 'anthropic', 'input_value': 'hi'})
# 400 Missing required configuration for anthropic: ANTHROPIC_API_KEY
# after
await client.post('/api/v1/variables', json={'name': 'ANTHROPIC_API_KEY', 'value': sk})
resp = await client.post('/api/v1/agentic/assist', json={'provider': 'anthropic', 'input_value': 'hi'}) Defensive patterns
Strategy: validation
Validate before calling
// Before calling /agentic/assist, verify required vars exist for the user
const vars = await fetch('/api/v1/variables').then(r => r.json());
const required = providerRequiredKeys[provider] ?? []; // e.g. ['OPENAI_API_KEY']
const missing = required.filter(k => !vars.some(v => v.name === k && v.value));
if (missing.length) openProviderSettings(missing); Try / catch
catch HTTP 400 whose detail matches /Missing required configuration for (\w+): (.+)./ -> parse missing keys and deep-link the user to Settings > Model Providers.
Prevention
- Gate the assistant UI behind a provider-readiness check that reads required keys per provider.
- After any workspace/account switch, re-verify provider variables before the first assist call.
- Automate key setup via POST /api/v1/variables during onboarding.
When it happens
Trigger: POST /api/v1/agentic/assist* with a provider whose required variable keys (e.g. OPENAI_API_KEY) are empty/unset for the user in the variables store; happens before any flow executes, inside _resolve_assistant_context.
Common situations: Fresh install where a provider was selected but keys never saved; user switched workspace/account so their stored variables no longer apply; key deleted from Settings after being enabled; providers requiring multiple variables (key + base URL) with only one filled in.
Related errors
- No model provider is configured. Please configure at least o
- Unknown provider: {provider}
- This endpoint is not available
- Invalid path
- Provider '{provider}' is not configured. Available providers
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/5bcc580ff3e66d73.
Report an issue: GitHub.