All Products
Search
Document Center

Database Autonomy Service:Chat

Last Updated:Oct 28, 2026

Invokes the asynchronous logic interface for the large language model capabilities of Database Autonomy Service (DAS).

Operation description

Before you begin:

  • When using the Alibaba Cloud or DAS SDK, use the latest version.

  • When calling DAS services by using the SDK, set the region to cn-shanghai.

  • Only database instances with DAS Enterprise Edition enabled support the creation of offline tasks. For the databases and regions supported by each edition of DAS Enterprise Edition, see DAS editions and supported features.

For more methods and examples of using the Chat API to interact with the DAS agent, see Best practices for DAS agent interaction (Chat API integration).

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hdm:Chat

get

*All Resource

*

None None

Request syntax

POST /chat HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

Message

string

No

The message.

{"id":"68fe0321-37fe-4c75-a118-b61b33156f6a","role":"user","content":[{"type":"text","text":"hello"}]}

SessionId

string

No

Optional. The session ID, which is a UUID string. If not specified, a new session is created by default. Keep the same session ID for contextual conversations.

123e4567-e89b-12d3-a456-xxxxxxxxxxxx

AgentId

string

No

Optional. The agent ID used for the service. You can specify the agent generated after enabling the DAS agent or a manually created agent. If not specified, the default agent is used.

ag-472T0DxtmjIxxxxx

Summary

string

No

Specifies whether to output summary information.

false

Resume

string

No

The user interaction feedback.

[{"metadata":{"a2uiClientDataModel":{"decided":true,"interaction":{"request":{"allowFreeText":true,"question":"question?","options":[{"label":"162 items","value":"162"},{"label":"242 items","value":"242"},{"label":"243 items","value":"243"},{"label":"486 items","value":"486"}]},"kind":"choice","interruptId":"5857955e-4856-4ab3-969e-f8b4c484bda4","status":"pending"},"free_text":""},"a2uiAction":{"name":"das_interaction_response","context":{"value":"162"},"surfaceId":"render-choice-7c03eb4f927f42ff8c30b30a2cc0797d","sourceComponentId":"opts-0","timestamp":"2026-09-15T06:54:15.556Z"}},"payload":{"value":"162"},"interruptId":"5857955e-4856-4ab3-969e-f8b4c484bda4","status":"resolved"}]

ForwardedProps

string

No

The forwarded properties.

{"enableInteractiveTools":true}

Response elements

Element

Type

Description

Example

object

Schema of Response

ActivityType

string

The heartbeat.

waiting_for_agent_thinking

AgentId

string

The agent ID.

agent-7f9c2a81

Code

string

direct_skill_rejected

direct_skill_rejected

Content

string

The response content.

I see you have several PolarDB instances, and I will query them for you shortly

Delta

string

Specifies whether the content is incremental.

hello

Kind

string

The step type for STEP_STARTED, such as task.

task

Label

string

The display name of the sub-agent for STEP_STARTED.

SQL performance diagnostics

Message

string

[HdmApiClient] instance is not managed by the agent

[HdmApiClient] instance is not managed by the agent

MessageId

string

The message ID.

61820b594664275c4429****

Name

string

The extension key.

summary

OriginatingToolCallId

string

The original ID of the tool call.

ag-xxxx

ParentAgentId

string

The parent agent ID.

agent-3a6f1c92

ParentMessageId

string

The parent message ID.

76bee207-31ee-4707-8851-6b9d4da033aa

Role

string

The conversation role ID.

assistant

RunId

string

The run ID.

ed7cb7b1-ddc8-45d7-9ff3-b315726cb5f7

StepName

string

The name of the execution step.

sub_agent_performance_diagnose_mysql

StepStatus

string

The step status for STEP_FINISHED, such as completed.

completed

TaskTrackerId

string

The callback tool class.

das_api

ThreadId

string

The thread ID.

8e481be1-21d5-4a92-a2fb-fb54be0ab4f6

Timestamp

integer

The event timestamp.

1767225600000

ToolCallError

string

The fault that occurs when you invoke tool calling.

error

ToolCallId

string

The ID of the tool calling to invoke.

call_edf9cdb69e0e4c9796a6a5a6

ToolCallName

string

The tool name.

das_api

Type

string

The event type.

TEXT_MESSAGE_CONTENT

Value

any

The extension value.

{"CharCount":393,"End":1777428785996,"RequestId":"BE59AED5-D831-5811-BBAD-590B917B2089","SessionId":"123e4567-e89b-12d3-a456-xxxxxxxxxxxx","Start":1777428707927}

Examples

Success response

JSON format

{
  "ActivityType": "waiting_for_agent_thinking",
  "AgentId": "agent-7f9c2a81",
  "Code": "direct_skill_rejected",
  "Content": "I see you have several PolarDB instances, and I will query them for you shortly",
  "Delta": "hello",
  "Kind": "task",
  "Label": "SQL performance diagnostics",
  "Message": "[HdmApiClient] instance is not managed by the agent",
  "MessageId": "61820b594664275c4429****",
  "Name": "summary",
  "OriginatingToolCallId": "ag-xxxx",
  "ParentAgentId": " agent-3a6f1c92",
  "ParentMessageId": "76bee207-31ee-4707-8851-6b9d4da033aa",
  "Role": "assistant",
  "RunId": "ed7cb7b1-ddc8-45d7-9ff3-b315726cb5f7",
  "StepName": "sub_agent_performance_diagnose_mysql",
  "StepStatus": "completed",
  "TaskTrackerId": "das_api",
  "ThreadId": "8e481be1-21d5-4a92-a2fb-fb54be0ab4f6",
  "Timestamp": 1767225600000,
  "ToolCallError": "error",
  "ToolCallId": "call_edf9cdb69e0e4c9796a6a5a6",
  "ToolCallName": "das_api",
  "Type": "TEXT_MESSAGE_CONTENT",
  "Value": "{\"CharCount\":393,\"End\":1777428785996,\"RequestId\":\"BE59AED5-D831-5811-BBAD-590B917B2089\",\"SessionId\":\"123e4567-e89b-12d3-a456-xxxxxxxxxxxx\",\"Start\":1777428707927}"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The request parameters are invalid. The request parameters are invalid.
500 Timeout The request processing has failed due to timeout. Request processing failed due to timeout.
403 NoPermission You are not authorized to do this action. You do not have the permission to perform this operation.
404 InstanceNotFound Requested instance not found. The corresponding instance ID cannot be found.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.