Skip to main content

Start Agent conversation

POST 

/v1/aibot/bots/:botId/send-message

Start Agent conversation

Request

Path Parameters

    botId stringrequired

    Agent ID

    Example: bot-xxx

Body

required
    msg stringrequired

    User message

    history object[]

    Conversation history

  • Array [
  • role stringrequired

    Role in the conversation history

    content stringrequired

    Content of the conversation history

  • ]
  • searchEnable boolean

    Whether to enable web search. Only enabled when both the Agent configuration and this field are true.

    files string[]

    Fields required for file-related conversations. You can upload files to Cloud Storage and use the cloud storage link (cloud://xxx.xxx) or a publicly accessible link (https://xxxx.xxxx).

    conversationId string

    Conversation ID. Takes effect after multi-conversation is enabled and marks the conversation to which this interaction belongs. You can obtain the ID from conversation-related APIs.

Responses

Returned when the Agent conversation succeeds (SSE format)

Response Headers
  • X-Request-Id string

    Request ID

Schema
    created number

    Conversation timestamp

    record_id string

    Conversation record ID

    model string

    Large model type

    version string

    Large model version

    type string

    Response type: text for the main answer, thinking for reasoning process, search for search results, knowledge for knowledge base

    role string

    Conversation role, fixed as assistant in responses

    content string

    Conversation content

    finish_reason string

    Conversation termination flag; continue means not finished, stop means finished

    reasoning_content string

    Deep reasoning content (only non-empty for deepseek-r1)

    usage object

    Token usage

    promptTokens number

    Number of prompt tokens; remains constant across multiple responses

    completionTokens number

    Total completion tokens. In streaming responses, this accumulates across chunks.

    totalTokens number

    Sum of promptTokens and completionTokens

    knowledge_base string[]

    Knowledge bases used in the conversation

    search_info object

    Search results (requires web search to be enabled)

    search_results undefined[]

    Search citation information

  • Array [
  • index string

    Citation index

    title string

    Citation title

    url string

    Citation URL

  • ]
Loading...