Skip to main content
App and classic knowledge base endpoints return errors in the same three-field JSON envelope:
status mirrors the HTTP status; code is the stable identifier to branch on; message is human-readable detail. Each endpoint page lists exactly which codes it can raise.
The agent knowledge base API uses the same three fields and adds a failure object to many errors. For what failure tells you and when to retry, see its Handle Errors section.

Status Classes at a Glance

On Dify Cloud, a 401 response from an app API can also mean the request was blocked by IP access control. If your API key is valid, ask the app administrator to check whether the request’s source IP is allowed.

Provider Errors Are Configuration Errors

Four common 400 codes point at the app’s model setup rather than your request:
  • provider_not_initialize: no valid model credentials
  • provider_quota_exceeded: the model provider’s own quota ran out
  • model_currently_not_support: the model isn’t currently supported
  • completion_request_error: an error occurred while making a completion request
For these errors, retrying won’t help. Fix the app’s model configuration in Dify.

Rate Limits and Quotas

The two 429 codes mean different things:
  • too_many_requests is a concurrency ceiling—too many simultaneous requests for the app right now. Back off and retry.
  • rate_limit_error is a plan quota on Dify Cloud, such as workflow executions. Retrying won’t clear it; it resets with the quota period or a plan change.
On Dify Cloud, knowledge base endpoints also enforce plan limits as 403 responses, such as the request rate limit. These carry the forbidden code. Classic knowledge base endpoints use the same code for access restrictions, so read the message to tell them apart rather than switching on code alone.

Errors Inside Streams

Once an app stream opens, the HTTP status is already 200: failures arrive as an error event and end the stream. The event’s code values are the same ones documented here—classify them with the same rules. See Consume Streaming Responses for details.

What to Retry

  • Retry with backoff: too_many_requests, 500, and network failures.
  • Don’t retry as-is: validation errors (fix the request first), authorization failures, or quota errors (they won’t clear until the quota does).
  • Fix, don’t retry: a 404 from a resume call means the wrong user or a run that doesn’t exist. Correct the identifier instead.
Last modified on November 4, 2026