xtekky/gpt4free · warning · RuntimeError

No response

Error message

No response

What it means

Raised by Perplexity.get_quota when its probe request (a minimal 'say only okay' chat to the default model) completes without ever yielding a string chunk. It signals that the provider responded with nothing usable — typically an auth/cookie challenge page or an immediate stream termination — so quota could not be measured.

Source

Thrown at g4f/Provider/Perplexity.py:113

        "pplx_reasoning",
        "r1",
    ]
    fallback_models = ["perplexity", "pplx_pro"]
    model_aliases = {
        "gpt-5": "gpt5",
        "gpt-5-thinking": "gpt5_thinking",
        "r1-1776": "r1",
    }

    @classmethod
    async def get_quota(cls, **kwargs):
        chunks = []
        async for chunk in cls.create_async_generator(
            cls.default_model, [{"role": "user", "content": "say only okay"}]
        ):
            if isinstance(chunk, str):
                return {"content": chunk}
        raise RuntimeError("No response")

    @classmethod
    async def create_async_generator(
        cls,
        model: str,
        messages: Messages,
        cookies: Cookies = None,
        proxy: str = None,
        conversation: JsonConversation = None,
        prompt: str = None,
        **kwargs,
    ) -> AsyncResult:
        """
        Create async generator for Perplexity requests with HAR file support.

        Authentication priority:
        1. HAR file cookies (har_and_cookies/perplexity*.har)
        2. Cookie jar from get_cookies()

View on GitHub (pinned to 973504e177)

Solutions

  1. Treat this provider as unavailable rather than retrying immediately — an empty stream usually means blocked auth.
  2. Pass fresh Perplexity cookies if your flow supports it.
  3. Update g4f; Perplexity's internal API is scraped and breaks often.
  4. Use a different provider for the actual work and exclude Perplexity from quota checks.

Example fix

# before
quota = await PerplexityAi.get_quota()

# after
try:
    quota = await PerplexityAi.get_quota()
except RuntimeError:
    quota = None  # mark provider offline, skip in this run
Defensive patterns

Strategy: try-catch

Try / catch

try:
    quota = await PerplexityAi.get_quota()
except RuntimeError:
    quota = None  # treat provider as offline; exclude from this run

Prevention

When it happens

Trigger: Calling get_quota (or APIs that call it, like provider status checks) when Perplexity's web endpoint returns an empty stream: missing/expired cookies, Cloudflare interstitial, or the default_model alias being invalid at the time.

Common situations: Status/quota dashboards probing all providers; cookie-based sessions expired since last use; Perplexity frontend API changes breaking the scraper; running without the browser impersonation needed to pass bot checks.

Related errors


AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14). Data as JSON: /api/errors/f85de9b0be75a9c7. Report an issue: GitHub.