{"record":{"id":"2e8222309d911165","repo":"OpenBB-finance/OpenBB","slug":"missing-credential-c-extra-msg-refer-to-the","errorCode":null,"errorMessage":"Missing credential '{c}'.{extra_msg} Refer to the documentation for setting provider credentials at https://docs.openbb.co/platform/settings/user_settings/api_keys.","messagePattern":"Missing credential '(.+?)'\\.(.+?) Refer to the documentation for setting provider credentials at https://docs\\.openbb\\.co/platform/settings/user_settings/api_keys\\.","errorType":"exception","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/core/openbb_core/provider/query_executor.py","lineNumber":56,"sourceCode":"        credentials: dict[str, SecretStr] | None,\n        provider: Provider,\n        require_credentials: bool,\n    ) -> dict[str, str]:\n        \"\"\"Filter credentials and check if they match provider requirements.\"\"\"\n        filtered_credentials = {}\n\n        if provider.credentials:\n            if credentials is None:\n                credentials = {}\n\n            for c in provider.credentials:\n                v = credentials.get(c)\n                secret = v.get_secret_value() if v else None\n                if c not in credentials or not secret:\n                    if require_credentials:\n                        website = provider.website or \"\"\n                        extra_msg = f\" Check {website} to get it.\" if website else \"\"\n                        raise OpenBBError(\n                            f\"Missing credential '{c}'.{extra_msg} Refer to the documentation for setting provider \"\n                            \"credentials at https://docs.openbb.co/platform/settings/user_settings/api_keys.\"\n                        )\n                else:\n                    filtered_credentials[c] = secret\n\n        return filtered_credentials\n\n    async def execute(\n        self,\n        provider_name: str,\n        model_name: str,\n        params: dict[str, Any],\n        credentials: dict[str, SecretStr] | None = None,\n        **kwargs: Any,\n    ) -> Any:\n        \"\"\"Execute query.\n","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/core/openbb_core/provider/query_executor.py#L38-L74","documentation":"OpenBBError from QueryExecutor.filter_credentials: the chosen provider declares required credentials, and at execution time a required credential is absent from user settings or its secret value is empty. The message names the missing credential, links the provider's website when known, and points to OpenBB's credentials documentation. Only raised when require_credentials is true (default).","triggerScenarios":"Calling obb.equity.price.historical('AAPL', provider='benzinga') with no benziga/benzinga API key configured; key present in settings but empty string; key name mismatch (e.g. set 'benzinga_token' where the provider requires 'benzinga_api_key'); OPENBB_<NAME>_API_KEY env var not exported in the current shell.","commonSituations":"Fresh setup without keys; wrong credential key name in openbb_settings.json or .env; env var defined in one shell but the script runs in another (cron, CI, systemd); provider renamed its credential field between versions.","solutions":["Set the named credential: obb.user.credentials.<name_in_error> = 'KEY', or export OPENBB_<NAME>_API_KEY=...","Use the exact credential name shown in the error - check obb.coverage.credentials or provider docs for the field name","Persist it in openbb_settings.json / Hub account so cron and CI jobs inherit it","Or switch to a provider whose credentials are already set"],"exampleFix":"# before\nres = obb.equity.price.historical('AAPL', provider='benzinga')  # Missing credential\n\n# after\nobb.user.credentials.benzinga_api_key = 'YOUR_KEY'\nres = obb.equity.price.historical('AAPL', provider='benzinga')","handlingStrategy":"validation","validationCode":"from openbb import obb\n\ndef credentials_ready(provider: str) -> bool:\n    spec = obb.coverage.providers.get(provider.lower())\n    if not spec:\n        return False\n    creds = obb.user.credentials.model_dump()\n    return all(creds.get(f) for f in spec.get('credentials', {}))","typeGuard":"def has_required_credentials(obb, provider: str) -> bool:\n    import openbb\n    fields = openbb.coverage.providers.get(provider.lower(), {}).get('credentials', {})\n    return all(getattr(obb.user.credentials, f, None) for f in fields)","tryCatchPattern":"from openbb_core.app.model.abstract.error import OpenBBError\n\ntry:\n    res = obb.equity.price.historical('AAPL', provider='benzinga')\nexcept OpenBBError as e:\n    if 'Missing credential' in str(e):\n        res = obb.equity.price.historical('AAPL', provider='yfinance')  # keyless fallback\n    else:\n        raise","preventionTips":["Check required credentials per provider at app startup and fail fast with a clear message","Load keys from env/secret manager, never hardcode","Keep a keyless fallback provider (e.g. yfinance) for degraded-mode operation"],"tags":["openbb","credentials","api-key","configuration"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}