{"record":{"id":"ff745e543328696a","repo":"langgenius/dify","slug":"provider-quota-exceeded-ff745e","errorCode":"provider_quota_exceeded","errorMessage":"Your quota for Dify Hosted Model Provider has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.","messagePattern":"Your quota for Dify Hosted Model Provider has been exhausted\\. Please go to Settings -> Model Provider to complete your own provider credentials\\.","errorType":"error_code","errorClass":"ProviderQuotaExceededError","httpStatus":400,"severity":"error","filePath":"api/controllers/console/explore/message.py","lineNumber":187,"sourceCode":"        try:\n            response = AppGenerateService.generate_more_like_this(\n                session=session,\n                app_model=app_model,\n                user=current_user,\n                message_id=message_id_str,\n                invoke_from=InvokeFrom.EXPLORE,\n                streaming=streaming,\n            )\n            # response-contract:ignore compact_generate_response\n            return helper.compact_generate_response(response)\n        except MessageNotExistsError:\n            raise NotFound(\"Message Not Exists.\")\n        except MoreLikeThisDisabledError:\n            raise AppMoreLikeThisDisabledError()\n        except ProviderTokenNotInitError as ex:\n            raise ProviderNotInitializeError(ex.description)\n        except QuotaExceededError:\n            raise ProviderQuotaExceededError()\n        except ModelCurrentlyNotSupportError:\n            raise ProviderModelCurrentlyNotSupportError()\n        except InvokeError as e:\n            raise CompletionRequestError(e.description)\n        except ValueError as e:\n            raise e\n        except Exception:\n            logger.exception(\"internal server error.\")\n            raise InternalServerError()\n\n\n@console_ns.route(\n    \"/installed-apps/<uuid:installed_app_id>/messages/<uuid:message_id>/suggested-questions\",\n    endpoint=\"installed_app_suggested_question\",\n)\nclass MessageSuggestedQuestionApi(InstalledAppResource):\n    @console_ns.response(200, \"Success\", console_ns.models[SuggestedQuestionsResponse.__name__])\n    @with_current_user","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/explore/message.py#L169-L205","documentation":"HTTP 400 with error_code provider_quota_exceeded, raised when generate_more_like_this raises QuotaExceededError. The Dify hosted model provider quota for the tenant has been exhausted.","triggerScenarios":"GET more-like-this when the tenant has used up its hosted-model quota. The service raises QuotaExceededError and the controller maps it to ProviderQuotaExceededError(400).","commonSituations":"Free/trial plan quota used up; high-volume usage on the hosted provider; billing downgrade reduced the quota; many users sharing the same tenant hitting the limit together.","solutions":["Upgrade the plan or wait for the quota window to reset.","Configure your own provider credentials under Settings -> Model Provider so generation bypasses the hosted quota.","Reduce generation frequency (cache more-like-this results per message).","Check usage in the billing dashboard to confirm the quota state."],"exampleFix":"# before: relying solely on hosted provider quota\nresp = get(more_like_this_url(id, mid))\n\n# after: fall back to own credentials when hosted quota is exhausted\ntry:\n    resp = get(more_like_this_url(id, mid))\nexcept QuotaExceeded:\n    switch_to_own_provider_credentials()\n    resp = get(more_like_this_url(id, mid))","handlingStrategy":"fallback","validationCode":"// Check hosted quota before generation if a usage endpoint is available\nconst usage = await get('/console/billing/usage');\nif (usage.hosted_quota_remaining <= 0) {\n  ensureOwnProviderConfigured(); // switch path before calling\n}","typeGuard":"function hostedQuotaAvailable(usage) {\n  return Number(usage?.hosted_quota_remaining) > 0;\n}","tryCatchPattern":"try {\n  return await get(moreLikeThisUrl(id, mid));\n} catch (e) {\n  if (e.code === 'provider_quota_exceeded') {\n    await switchToOwnProviderCredentials();\n    return get(moreLikeThisUrl(id, mid)); // fallback to own credentials\n  }\n  throw e;\n}","preventionTips":["Configure your own provider credentials as a fallback to the hosted quota.","Monitor usage in the billing dashboard.","Cache more-like-this results per message to reduce calls."],"tags":["rest-api","explore","provider","quota","billing","more-like-this","dify"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}