# Start Conversation

`POST` `/v1/ai/agents/{agent_id}/conversations`

Ask a question to the specified Agent. You can start a brand-new conversation, or pass the `chat_uid` of an existing one to continue asking in the same conversation.

The Agent generates the answer using capabilities such as market data and account access. When the Agent needs more information or confirmation from you, the run is **interrupted** (`status` is `interrupted`) — send your answers via [Continue Conversation](/docs/ai/chat/continue) to resume it.

Choose the response mode with the `Accept` header: `text/event-stream` streams the run progress and answer via SSE; any other value returns a blocking response with the aggregated final result.

:::tip How to find an Agent's UID
Besides querying the Agents in Workspace endpoint, you can also get it directly from the Longbridge website: open the Agent's chat page — the URL looks like `https://longbridge.com/en/ai/agents/chatbot/chat`, where `chatbot` is the Agent's UID.
:::

## Parameters

### Path Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `agent_id` | string | Yes | UID of the target Agent; must be a published Agent |

### Request Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | The user question; must not be empty |
| `chat_uid` | string | No | Identifier of an existing conversation. Pass it to continue that conversation; omit to start a new one |
| `parent_message_id` | string | No | Parent message ID, taken from the `message_id` in the previous response. Pass it when asking a follow-up in an existing conversation to attach the new message after the specified one, keeping the message stream in order. Only valid together with `chat_uid`, and the parent message must belong to that conversation; must not be set for a new conversation |

## Request Example

```bash
curl --request POST \
  --url 'https://openapi.longbridge.com/v1/ai/agents/<agent_id>/conversations' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{"query":"<query>","chat_uid":"<chat_uid>","parent_message_id":"<parent_message_id>"}'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `chat_uid` | string | Yes | Conversation identifier, used for follow-up questions and troubleshooting |
| `message_id` | string | Yes | Message ID of this round (as a string) |
| `status` | string | Yes | Final run status: `succeeded` / `interrupted` / `failed` / `stopped` |
| `answer` | string | No | Final answer text; valid when `status` is `succeeded` |
| `references` | object[] | No | Sources referenced by the answer; `null` if none |
| `elapsed_time` | number | No | Run duration in seconds |
| `interrupt` | object | No | Present only when `status` is `interrupted` |
| `└ node_id` | string | Yes | ID of the node that triggered the interrupt |
| `└ tool_call_id` | string | Yes | Tool call ID of this inquiry; used as the answer key when continuing |
| `└ questions` | object[] | Yes | Questions you need to answer |
| `└ ∟ question` | string | Yes | Question text |
| `└ ∟ options` | object[] | No | Options; empty means free-form answer |
| `└ ∟∟ description` | string | No | Option text |
| `└ ∟ multi_select` | boolean | No | Whether multiple options may be selected |
| `└ message_id` | int64 | No | ID of the paused message |
| `└ chat_id` | int64 | No | ID of the owning conversation |
| `error` | object | No | Present only when the run failed |
| `└ code` | int32 | No | Error code |
| `└ message` | string | No | Error message |

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "chat_uid": "ct_9f2c1a5b",
    "message_id": "42",
    "status": "succeeded",
    "answer": "Tesla (TSLA.US) recently...",
    "references": [
      {
        "index": 1,
        "title": "...",
        "url": "..."
      }
    ],
    "elapsed_time": 3.21
  }
}
```
