{"record":{"id":"fadadda1f7225d85","repo":"xtekky/gpt4free","slug":"no-valid-yupp-accounts-available","errorCode":null,"errorMessage":"No valid Yupp accounts available","messagePattern":"No valid Yupp accounts available","errorType":"exception","errorClass":"ProviderException","httpStatus":null,"severity":"error","filePath":"g4f/Provider/Yupp.py","lineNumber":607,"sourceCode":"        url_uuid = conversation.url_uuid if conversation else None\n        is_new_conversation = url_uuid is None\n\n        prompt = kwargs.get(\"prompt\")\n        if prompt is None:\n            if is_new_conversation:\n                prompt = format_messages_for_yupp(messages)\n            else:\n                prompt = get_last_user_message(messages, prompt)\n\n        log_debug(\n            f\"Use url_uuid: {url_uuid}, Formatted prompt length: {len(prompt)}, Is new conversation: {is_new_conversation}\"\n        )\n\n        max_attempts = len(YUPP_ACCOUNTS)\n        for attempt in range(max_attempts):\n            account = await get_best_yupp_account()\n            if not account:\n                raise ProviderException(\"No valid Yupp accounts available\")\n\n            try:\n                scraper = create_scraper()\n                if proxy:\n                    scraper.proxies = {\"http\": proxy, \"https\": proxy}\n\n                credits = await get_credits(scraper, account)\n                log_debug(f\"Account ...{account['token'][-4:]} has {credits} credits\")\n                if credits is not None and credits <= 100:\n                    log_debug(\n                        f\"Account ...{account['token'][-4:]} has low credits, rotating\"\n                    )\n                    async with account_rotation_lock:\n                        account[\"error_count\"] += 1\n                    continue\n\n                # Initialize token extractor for automatic token swapping\n                token_extractor = get_token_extractor(","sourceCodeStart":589,"sourceCodeEnd":625,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/Yupp.py#L589-L625","documentation":"Raised as ProviderException inside the account-rotation loop when get_best_yupp_account() returns None. Accounts exist in YUPP_ACCOUNTS but none qualifies as usable — typically all have been marked failed (error_count too high), are rate-limited, or have insufficient credits — so the loop cannot even attempt a request.","triggerScenarios":"Repeated Yupp requests where every account accumulates errors or runs out of credits (>100-credit threshold triggers rotation, exhausted accounts get excluded), leaving get_best_yupp_account() with no candidate on a subsequent iteration.","commonSituations":"Heavy automated usage draining all accounts' credits; a Cloudflare/site change marking every token as failed; a single shared token reused across many workers until rate-limited.","solutions":["Provide fresh tokens: set YUPP_API_KEY to a comma-separated list of new session tokens to repopulate YUPP_ACCOUNTS","Wait for rate-limit windows to pass so failed-account state resets, then retry","Reduce request volume or add backoff between Yupp calls","Fall back to another provider via g4f's provider fallback/RetryProvider instead of hammering Yupp"],"exampleFix":"# before\nfor _ in range(100):\n    resp = await client.chat.completions.create(model='gpt-4o', provider='Yupp', messages=msgs)\n\n# after\nfrom g4f.Provider import IterListProvider\nclient = Client(provider=IterListProvider([Yupp, Cloudflare], shuffle=False))","handlingStrategy":"fallback","validationCode":"# pre-flight: confirm at least one account is selectable\nfrom g4f.Provider.Yupp import YUPP_ACCOUNTS, get_best_yupp_account\nusable = [a for a in YUPP_ACCOUNTS if a.get('error_count', 0) < 3]\nif not usable:\n    # refresh tokens or choose another provider","typeGuard":null,"tryCatchPattern":"try:\n    resp = await create(..., provider='Yupp')\nexcept ProviderException as e:\n    if 'No valid Yupp accounts' in str(e):\n        os.environ['YUPP_API_KEY'] = fresh_tokens()  # then retry once","preventionTips":["Configure several Yupp tokens so rotation has headroom","Add cooldown/backoff after consecutive failures so error_count recovers","Keep a fallback provider chain for long-running jobs"],"tags":["yupp","rate-limit","account-rotation","credits"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}