{"record":{"id":"ba9e4afe94f727f8","repo":"xtekky/gpt4free","slug":"no-base-url-or-backup-url-specified","errorCode":null,"errorMessage":"No base_url or backup_url specified.","messagePattern":"No base_url or backup_url specified\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"g4f/Provider/template/OpenaiTemplate.py","lineNumber":106,"sourceCode":"    ) -> list[str]:\n        if not cls.models:\n            try:\n                if api_key is None and cls.api_key is not None:\n                    api_key = cls.api_key\n                if (\n                    not api_key\n                    or AppConfig.disable_custom_api_key\n                    or not cls.is_provider_api_key(api_key)\n                ):\n                    from ...tools.run_tools import AuthManager\n\n                    api_key = AuthManager.load_api_key(cls) or api_key\n                if base_url is None:\n                    base_url = cls.base_url\n                    if not cls.is_provider_api_key(api_key):\n                        base_url = cls.backup_url\n                    if base_url is None:\n                        raise NotImplementedError(\n                            \"No base_url or backup_url specified.\"\n                        )\n                    if base_url.startswith(SPACE_URL) and not api_key:\n                        api_key = AppConfig.g4f_space_api_key\n                    elif cls.models_needs_auth and not api_key:\n                        raise MissingAuthError(\"API key is required.\")\n                elif (\n                    not base_url.startswith(SPACE_URL)\n                    and api_key\n                    and (api_key.startswith(\"g4f_\") or api_key.startswith(\"gfs_\"))\n                ):\n                    raise ValueError(\"Invalid API key for the specified base_url.\")\n\n                response = requests.get(\n                    f\"{base_url}/models\",\n                    headers=cls.get_headers(False, api_key),\n                    verify=cls.ssl,\n                    timeout=timeout,","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/template/OpenaiTemplate.py#L88-L124","documentation":"Error \"No base_url or backup_url specified.\" thrown in xtekky/gpt4free.","triggerScenarios":"Thrown at g4f/Provider/template/OpenaiTemplate.py:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set base_url (or backup_url) on the provider or via its environment variable before making requests."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}