{"record":{"id":"3fda42a3666a218b","repo":"langgenius/dify","slug":"provider-not-initialize-3fda42","errorCode":"provider_not_initialize","errorMessage":"No valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.","messagePattern":"No valid model provider credentials found\\. Please go to Settings -> Model Provider to complete your provider credentials\\.","errorType":"console","errorClass":"ProviderNotInitializeError","httpStatus":400,"severity":"error","filePath":"api/controllers/console/explore/audio.py","lineNumber":83,"sourceCode":"                end_user=None,\n            )\n\n            return response\n        except services.errors.app_model_config.AppModelConfigBrokenError:\n            logger.exception(\"App model config broken.\")\n            raise AppUnavailableError()\n        except NoAudioUploadedServiceError:\n            raise NoAudioUploadedError()\n        except AudioTooLargeServiceError as e:\n            raise AudioTooLargeError(str(e))\n        except UnsupportedAudioTypeServiceError:\n            raise UnsupportedAudioTypeError()\n        except ProviderNotSupportSpeechToTextServiceError:\n            raise ProviderNotSupportSpeechToTextError()\n        except SpeechToTextDisabledServiceError:\n            raise SpeechToTextDisabledError()\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 as e:\n            logger.exception(\"internal server error.\")\n            raise InternalServerError()\n\n\n@console_ns.route(\n    \"/installed-apps/<uuid:installed_app_id>/text-to-audio\",\n    endpoint=\"installed_app_text\",\n)\nclass ChatTextApi(InstalledAppResource):","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/explore/audio.py#L65-L101","documentation":"HTTP 400 ProviderNotInitializeError, raised by the STT endpoint. The model layer raised ProviderTokenNotInitError, meaning the resolved model provider has no valid credentials configured. The controller passes the exception's description through verbatim. This is distinct from 681 (no model instance at all): here a provider/model was selected but its API key/token is missing or invalid.","triggerScenarios":"POST /console/explore/installed-apps/{id}/audio-to-text where the tenant has a default speech2text model selected but the backing provider credentials were never entered, were cleared, or failed validation at invoke time.","commonSituations":"Admin selected a model from a provider but never pasted the API key; credentials were deleted; provider credentials revoked by the upstream vendor; environment-specific key not loaded in a self-hosted deploy.","solutions":["Go to Settings -> Model Provider, open the relevant provider, and add/refresh the API credentials.","Use 'devkey' / your credential manager to supply the key rather than pasting it in chat.","Validate the credential by running the provider's built-in check in the UI after saving.","If self-hosted, confirm the secret is mounted into the container env the API process actually reads."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await postAudio(file) }\ncatch (e) { if (e.code === 400 && e.error_code === 'provider_not_initialize') promptAddCredentials() else throw e }","preventionTips":["Run the provider's credential validation check right after saving the API key.","Supply keys through 'devkey' rather than pasting them in chat.","On self-hosted, verify the secret is mounted into the API container env the process reads.","Alert on credential-expiry events from the upstream provider."],"tags":["audio","stt","model-provider","credentials","http-400"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}