{"record":{"id":"a7a4ec6e1e7a6a94","repo":"langflow-ai/langflow","slug":"unknown-provider-provider","errorCode":null,"errorMessage":"Unknown provider: {provider}","messagePattern":"Unknown provider: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"src/backend/base/langflow/agentic/api/router.py","lineNumber":92,"sourceCode":"\n    provider = request.provider\n    if not provider:\n        for preferred in PREFERRED_PROVIDERS:\n            if preferred in enabled_providers:\n                provider = preferred\n                break\n        if not provider:\n            provider = enabled_providers[0]\n\n    if provider not in enabled_providers:\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Provider '{provider}' is not configured. Available providers: {enabled_providers}\",\n        )\n\n    api_key_name = provider_variable_map.get(provider)\n    if not api_key_name:\n        raise HTTPException(status_code=400, detail=f\"Unknown provider: {provider}\")\n\n    model_name = request.model_name or get_default_model(provider, user_id=user_id) or \"\"\n\n    # Get all configured variables for the provider\n    provider_vars = get_all_variables_for_provider(user_id, provider)\n\n    # Validate all required variables are present\n    required_keys = get_provider_required_variable_keys(provider)\n    missing_keys = [key for key in required_keys if not provider_vars.get(key)]\n\n    if missing_keys:\n        raise HTTPException(\n            status_code=400,\n            detail=(\n                f\"Missing required configuration for {provider}: {', '.join(missing_keys)}. \"\n                \"Please configure these in Settings > Model Providers.\"\n            ),\n        )","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/backend/base/langflow/agentic/api/router.py#L74-L110","documentation":"Raised by the agentic assistant endpoints when the resolved provider passed the 'is enabled' check but has no entry in the model-provider-to-API-key-variable mapping (get_model_provider_variable_mapping). It means the provider slug is recognized as configured for the user, yet the backend has no variable name mapped to it, so it cannot look up credentials. It surfaces as HTTP 400 with detail \"Unknown provider: {provider}\".","triggerScenarios":"POST /api/v1/agentic/assist (or /execute/{flow_name}, /assist/stream) with request.provider set to a slug that is in the user's enabled providers list but missing from the provider->variable map; typically a provider enabled via partial configuration (e.g. a non-default or newly added provider whose key mapping is not registered in get_model_provider_variable_mapping).","commonSituations":"Typo in a provider slug that happens to match an enabled row; a provider enabled in Settings > Model Providers without its required variable ever being defined; upgrading Langflow where a new provider was added to the enabled list but not to the variable map; custom/self-hosted deployments with modified provider mappings.","solutions":["Omit request.provider and let the server auto-pick from PREFERRED_PROVIDERS / enabled_providers[0].","Use one of the providers listed in the error/detail of a deliberate bad call, or fetch the enabled provider list for the user and pick from it.","Verify the provider slug spelling exactly matches the mapping key (case-sensitive) used by get_model_provider_variable_mapping.","If the provider should be supported, register its API-key variable name in the provider variable mapping (Settings > Model Providers / provider_service configuration) so provider_variable_map.get(provider) returns a key."],"exampleFix":"// before\nawait fetch('/api/v1/agentic/assist', {method:'POST', body: JSON.stringify({provider: 'open_ai', input_value: 'hi'})});\n// after\nawait fetch('/api/v1/agentic/assist', {method:'POST', body: JSON.stringify({provider: 'openai', input_value: 'hi'})}); // slug must exist in the provider variable map","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['openai', 'anthropic', ...]); // mirror get_model_provider_variable_mapping keys\nif (provider && !SUPPORTED.has(provider)) {\n  provider = undefined; // let server auto-pick from enabled providers\n}","typeGuard":"const isValidProvider = (p: string): boolean =>\n  /^(openai|anthropic|google|mistral|cohere|groq)$/i.test(p);","tryCatchPattern":"try { await assist(body) } catch (e) { if (e.status === 400 && e.detail.startsWith('Unknown provider')) { retry without provider field } }","preventionTips":["Prefer omitting provider and letting the server pick from PREFERRED_PROVIDERS.","Fetch the enabled provider list for the user once at session start and constrain the UI picker to it.","Treat provider slugs as case-sensitive identifiers; never free-type them."],"tags":["agentic","provider","http-400","configuration"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}