{"record":{"id":"ebbdb9f3cb4bdc31","repo":"xtekky/gpt4free","slug":"no-yupp-accounts-configured-set-yupp-api-key-envi","errorCode":null,"errorMessage":"No Yupp accounts configured. Set YUPP_API_KEY environment variable.","messagePattern":"No Yupp accounts configured\\. Set YUPP_API_KEY environment variable\\.","errorType":"exception","errorClass":"MissingAuthError","httpStatus":null,"severity":"error","filePath":"g4f/Provider/Yupp.py","lineNumber":413,"sourceCode":"class Yupp(AsyncGeneratorProvider, ProviderModelMixin):\n    url = \"https://yupp.ai\"\n    login_url = \"https://discord.gg/qXA4Wf4Fsm\"\n    working = False and has_cloudscraper\n    active_by_default = True\n    supports_stream = True\n    image_cache = True\n\n    @classmethod\n    def get_models(cls, api_key: str = None, **kwargs) -> List[str]:\n        if not cls.models:\n            if not api_key:\n                api_key = AuthManager.load_api_key(cls)\n            if not api_key:\n                api_key = get_cookie_tokens()\n            if api_key:\n                load_yupp_accounts(api_key)\n            else:\n                raise MissingAuthError(\n                    \"No Yupp accounts configured. Set YUPP_API_KEY environment variable.\"\n                )\n            api_key = YUPP_ACCOUNTS[0][\"token\"] if YUPP_ACCOUNTS else None\n            manager = YuppModelManager(session=create_scraper(), api_key=api_key)\n            models = manager.client.fetch_models()\n            if models:\n                cls.models_tags = {\n                    model.get(\"name\"): manager.processor.generate_tags(model)\n                    for model in models\n                }\n                cls.models = [model.get(\"name\") for model in models]\n                cls.image_models = [\n                    model.get(\"name\")\n                    for model in models\n                    if model.get(\"isImageGeneration\")\n                ]\n                cls.vision_models = [\n                    model.get(\"name\")","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/Yupp.py#L395-L431","documentation":"Raised by Yupp.get_models() as a MissingAuthError when no API token can be resolved. The provider tries three sources in order: the api_key argument, AuthManager.load_api_key (env var YUPP_API_KEY / stored auth), then browser cookie scraping via get_cookie_tokens(). Only if all three yield nothing does it raise, because listing models requires a real authenticated call to Yupp's model manager.","triggerScenarios":"Calling g4f.Provider.Yupp.get_models() (directly or via client.get_models()) on a machine with no YUPP_API_KEY environment variable, no saved auth file, and no yupp.ai session cookies in the local browser cookie store.","commonSituations":"Fresh installs/headless servers (no browser cookies exist), CI containers, or environments where the auth file was cleared. Users who assume model listing is public and needs no key.","solutions":["Set the YUPP_API_KEY environment variable to a valid yupp.ai session token","Log in to yupp.ai in a local browser so get_cookie_tokens() can harvest session cookies","Pass api_key explicitly: Yupp.get_models(api_key='...')","Store the key via g4f's AuthManager so load_api_key() finds it"],"exampleFix":"# before\nmodels = Yupp.get_models()\n\n# after\nimport os\nos.environ['YUPP_API_KEY'] = 'your-yupp-session-token'\nmodels = Yupp.get_models()","handlingStrategy":"validation","validationCode":"import os\nfrom g4f.Provider.Yupp import get_cookie_tokens\n\ndef yupp_credentials_present(api_key=None):\n    return bool(api_key or os.getenv('YUPP_API_KEY') or get_cookie_tokens())\n\n# call before Yupp.get_models()","typeGuard":null,"tryCatchPattern":"from g4f.errors import MissingAuthError\ntry:\n    models = Yupp.get_models()\nexcept MissingAuthError:\n    models = []  # or prompt user for YUPP_API_KEY","preventionTips":["Set YUPP_API_KEY in the deployment environment rather than relying on browser cookies","Skip Yupp in provider lists when no credential is detected","Cache the model list so get_models() is not called on every request"],"tags":["yupp","authentication","api-key","configuration"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}