/chat-messagesSend Chat Message
Available for: Chatflow, Agent, Chatbot, Legacy Agent apps.
Sends a message to a chat app and returns the assistant's reply. The events in the streaming response vary by app type.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Request body to send a chat message.
10 documented failures
app_unavailableApp unavailable, please check your app configurations.
app_unavailable
completion_request_errorCompletion request failed.
completion_request_error
conversation_completedThe conversation has ended. Please start a new conversation.
conversation_completed
bad_requestCannot use draft workflow version. Workflow ID: a1b2c3d4-5678-90ab-cdef-1234567890ab.
bad_request
model_currently_not_supportDify Hosted OpenAI trial currently not support the GPT-4 model.
model_currently_not_support
invalid_paramAgent App has no bound Agent
invalid_param
agent_not_publishedAgent has not been published. Please publish the Agent before using the API.
agent_not_published
not_chat_appPlease check if your app mode matches the right API route.
not_chat_app
provider_not_initializeNo valid model provider credentials found. Please go to Settings -> Model Provider to complete your provider credentials.
provider_not_initialize
provider_quota_exceededYour quota for Dify Hosted OpenAI has been exhausted. Please go to Settings -> Model Provider to complete your own provider credentials.
provider_quota_exceeded
One documented failure
workflow_version_execution_not_allowedWorkflow version execution is not available on your current plan. Please upgrade to a paid plan.
workflow_version_execution_not_allowed
One documented failure
not_foundConversation Not Exists.
not_found
2 documented failures
rate_limit_errorWorkflow execution quota limit reached for tenant 8f1e2a90-3b7c-4d55-9a01-6c2f4e8b1d33
rate_limit_error
too_many_requestsToo many requests. Please try again later.
too_many_requests
One documented failure
internal_server_errorThe server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
internal_server_error
A 400 is returned: - app_unavailable : App unavailable or misconfigured.
not_chat_app: App mode does not match the API route.provider_not_initialize: No valid model provider credentials found.provider_quota_exceeded: Model provider quota exhausted.model_currently_not_support: Current model unavailable.completion_request_error: Text generation failed.bad_request: Cannot use draft workflow version.bad_request: Invalidworkflow_idformat.bad_request:blockingresponse mode with an Agent app.invalid_param: The Agent app has no bound Agent.agent_not_published: The bound Agent has no published version. (Agent apps)conversation_completed: The conversation has ended; start a new one by omittingconversation_id. A 403 is returned:workflow_version_execution_not_allowed: A Chatflow request pinned a workflow version viaworkflow_idon the Dify Cloud Sandbox plan. A 404 is returned: -not_found: Conversation does not exist.not_found: Workflow not found with the specifiedworkflow_id. A 429 is returned: -too_many_requests: Too many concurrent requests for this app.rate_limit_error: The Dify Cloud workflow execution quota for this workspace has been reached. A 500 is returned:internal_server_error: Internal server error.