{"record":{"id":"7a8bebcc0456b037","repo":"xtekky/gpt4free","slug":"model-model-is-not-supported-by-cls-name","errorCode":null,"errorMessage":"Model '{model}' is not supported by {cls.__name__}. Supported models: {cls.models}","messagePattern":"Model '(.+?)' is not supported by (.+?)\\. Supported models: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"g4f/Provider/needs_auth/Video.py","lineNumber":146,"sourceCode":"        \"search\": \"https://app.flim.ai/?ft={0}\",\n    }\n\n    active_by_default = True\n    default_model = \"search\"\n    models = list(urls.keys())\n    video_models = models\n\n    needs_auth = False\n    working = True\n\n    @classmethod\n    async def create_async_generator(\n        cls, model: str, messages: Messages, prompt: str = None, **kwargs\n    ) -> AsyncResult:\n        if not model:\n            model = cls.default_model\n        if model not in cls.video_models:\n            raise ValueError(\n                f\"Model '{model}' is not supported by {cls.__name__}. Supported models: {cls.models}\"\n            )\n        yield ProviderInfo(**cls.get_dict(), model=model)\n        prompt = (\n            format_media_prompt(messages, prompt)\n            .encode()[:100]\n            .decode(\"utf-8\", \"ignore\")\n            .strip()\n        )\n        if not prompt:\n            raise ValueError(\"Prompt cannot be empty.\")\n        prompt = await RequestConfig.translate_prompt(prompt)\n        response = await RequestConfig.get_response(prompt, model == \"search\")\n        if response:\n            yield Reasoning(label=f\"Found {len(response.urls)} Video(s)\", status=\"\")\n            yield response\n            return\n        raise RuntimeError(\"Failed to find any videos for the prompt.\")","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/needs_auth/Video.py#L128-L164","documentation":"Raised as ValueError by the Video provider when the requested model is not in cls.video_models. The provider only serves a fixed list of video/search models; any other string is rejected before any network call, and the message lists the supported set.","triggerScenarios":"Passing a text model name or a typo (e.g. 'gpt-4o' or 'veo-typo') to the Video provider's create_async_generator.","commonSituations":"Routing automation picks a generic default model for every provider, model list changed between g4f versions so a previously valid name is gone.","solutions":["Use one of the models listed in the error message (cls.models for the provider class)","Check g4f.Provider.Video.supported_models or the provider's get_models() at runtime","Update g4f if a newer video model should be supported"],"exampleFix":"# before\nresponse = client.chat.completions.create(model='gpt-4o', messages=msgs, provider=g4f.Provider.Video)\n\n# after\nresponse = client.chat.completions.create(model='search', messages=msgs, provider=g4f.Provider.Video)  # or another listed model","handlingStrategy":"type-guard","validationCode":"supported = g4f.Provider.Video.video_models  # or cls.get_models()\nif model not in supported:\n    model = next(iter(supported))  # pick a valid default","typeGuard":"def is_supported_video_model(model: str) -> bool:\n    return isinstance(model, str) and model in g4f.Provider.Video.video_models","tryCatchPattern":"try:\n    result = ...create(model=model, provider=g4f.Provider.Video)\nexcept ValueError as e:\n    if 'not supported' in str(e):\n        model = 'search'\n        result = ...create(model=model, provider=g4f.Provider.Video)\n    else:\n        raise","preventionTips":["Resolve model names against the provider's live model list instead of hardcoding","Re-check supported models after upgrading g4f"],"tags":["validation","model-name","video","g4f"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}