/aichat2/conversations) is a new-generation conversation interface and a comprehensive upgraded version of the AI Chat API. Building on v1’s simplicity and hosted multi-turn conversations, it expands with:
- Multimodal user input: Directly send text + image + file blocks through the structured
messagefield, without needing to attach them indirectly throughreferencesfirst. - Agent-based tool calling: Includes a built-in set of tools such as web search, webpage fetching, and file reading, and can mount user-authorized MCP servers (Google Drive, Notion, Slack, GitHub, etc.). The model can autonomously call tools across multiple rounds within a single request to complete complex tasks.
- Structured streaming events: Through
accept: text/event-streamorapplication/x-ndjson, you can receive token-by-token events such astext_delta,tool_use,tool_result,thinking,citation,card, andartifact, making it convenient to render them separately by type on the frontend. - Interruptible / resumable: When the model needs the user to provide additional information, it emits an
ask_user_questionevent and pauses. In the next call, you can fill in the answer throughtool_resultsto continue. - New CRUD actions: Complete
retrieve/retrieve_batch/update/deletethrough theactionfield on the same endpoint, without requiring an additional conversation management API. - Continuously updated model list: By default, it supports contemporary models such as GPT-5.4, Claude Opus 4.8, Claude Sonnet 4.6, Gemini 3.1 Pro, GLM 5.1, DeepSeek V4, and Kimi K3.
model + question (+ optional stateful / id / references / preset) to get a {answer, id} JSON response equivalent to v1. Therefore, when migrating from /aichat/conversations, there is no need to rewrite the client; simply change the path to /aichat2/conversations.
If you are currently using /aichat/conversations, the old interface will remain available, and you can migrate at your own pace.
Application Process
To use the AI Chat v2 API, first go to the Ace Data Cloud Console to obtain your API Token and keep it for later use.
If you are not yet logged in or registered, you will be automatically redirected to the login page and invited to register and log in. After completion, you will automatically return to the current page.
One API Token can call all services on the platform; there is no need to apply separately for each service. Your first application comes with free credits for a free trial; when credits are insufficient, you can top up your general balance in the console.
📘 Complete documentation: AI Chat v2 API →
Basic Usage
The simplest usage is exactly the same as v1: passmodel + question, and receive {answer, id}.
CURL example:
model can be viewed directly in the dropdown of the Try panel on the right. Common categories include:
- OpenAI:
gpt-5.4-mini,gpt-5.4-nano,gpt-5.2-pro,gpt-5.1-all,gpt-5-all,gpt-4.1,gpt-4o,gpt-4o-image,o3,o4-mini, etc. - Anthropic:
claude-opus-4-8,claude-opus-4-7,claude-opus-4-6,claude-opus-4-5-20251101,claude-sonnet-4-6,claude-sonnet-4-5-20250929,claude-haiku-4-5-20251001, etc. - Google:
gemini-3.1-pro-preview,gemini-3.1-pro-preview,gemini-3.1-flash-image,gemini-3.1-pro-preview,gemini-2.5-flash-lite, etc. - xAI:
grok-4, etc. - DeepSeek:
deepseek-v4-pro,deepseek-v4.1-flash,deepseek-v4-flash,deepseek-v3.2-exp,deepseek-r1-0528, etc. - Moonshot:
kimi-k3,kimi-k2.6,kimi-k2.5, etc. - Zhipu:
glm-5.3,glm-5.2,glm-5.1,glm-5,glm-5-turbo,glm-4.7,glm-4.5v, etc.
Multi-turn Conversations
As with v1, passstateful: true to enable conversation storage. The API will return an id; simply include the id in subsequent requests to continue the conversation, without needing to maintain the messages history yourself.
First request:
id:
statefuldefaults totrue; omitting it is equivalent to explicitly passingtrue. If you do not want the server to save this conversation turn, you can explicitly setstateful: false.
Streaming Responses
v2 supports two streaming formats, selected according to theaccept header:
NDJSON Example
text_delta:
SSE Example
UsingEventSource in the browser does not support custom request bodies. It is recommended to use fetch + manually parse by splitting on \n\n:
Streaming Event Types
For clients that only care about the final answer, concatenating the
content of all text_delta events is equivalent to the answer in application/json mode.
Multimodal Input
If user input contains images or files, passmessage (an array) instead of question. Each array element is a content block:
text— Plain text; thetextfield is required.image_url— Image;image_url.urlis required.file_url— File (PDF, CSV, TXT, etc.);file_url.urlis required.
Relationship with v1 references
For compatibility with older clients, v2 still recognizes the references: ["https://...", ...] field:
- If the URL suffix is
jpg / jpeg / png / gif / bmp / webp / svg / heic / heif, automatically convert it into animage_urlblock; - Convert other extensions into a
file_urlblock; - If
questionis also provided at the same time, then prepend it as atextblock.
/aichat2/conversations; the original references usage will continue to work as usual.
If more fine-grained control is needed (for example, placing multiple images between text, or when the order is important), directly use the message array.
Tool Calls and MCP
The core enhancement of v2 is that the model can autonomously call tools to complete multi-step tasks. This is enabled by default, and the client does not need to make any additional configuration in the request. Common scenarios:- The user asks, “Help me search for what new exhibitions there are recently in Shanghai” → The model calls the built-in web search → Organizes the results into an answer.
- The user asks, “Read this PDF and then write a summary” → The model calls file_read → Writes a summary.
- The user has authorized Google Drive / GitHub / Notion, etc. in Connections → The model can call the corresponding MCP tools to read and write their data.
tool_use and tool_result, for example:
tool_use / tool_result / card / citation; the model’s final output will still stream through text_delta.
max_turns can limit the maximum number of rounds in which the model can call tools by itself in this request; the default upper limit is determined by the platform. Setting it low (for example, max_turns: 1) can force a single response and disallow any tool calls.
Asynchronous Execution and Unattended Authorization
If your calls come from alert Webhooks, CI/CD, monitoring systems, or other background tasks, you can setasync: true to make the API immediately return a task ID and continue execution in the background:
action: retrieve + id to query the conversation result; you can also provide callback_url, and after the task is completed, the platform will POST { status, answer, usage, error } to your callback address. callback_url must use http / https and cannot directly specify localhost or a private IP literal address.
Usually, there is no one available to click confirmation for background tasks. If you want certain Skills or MCP Servers to perform actions such as sending, publishing, or writing in unattended mode, explicitly pass a pre-authorization list in the request body:
allowed_skills are the slugs of connected Skills; the values in allowed_mcp_servers are the slugs of connected MCP Servers. Skills / MCP Servers not included in the pre-authorization list can still only preview, dry-run, or refuse to perform write operations in unattended mode.
If more fine-grained control is needed, you can also use the equivalent unattended_policy object:
--unattended-confirm or the corresponding security mechanism; otherwise, it will continue to dry-run and will not directly perform write operations.
Resuming Paused Conversations
Some tools cause the model to “ask the user a follow-up question.” At this time, the model sends anask_user_question event, and the conversation is frozen in the awaiting_user_input state:
id and fill the answer back through tool_results:
tool_use_id in the request body must be exactly the same as the tool_id when paused; otherwise, it will return 400. When tool_results exists in the request at the same time, question / message / references will all be ignored.
If the user decides to abandon this question, simply pass a new question / message; the platform will automatically mark the paused tool call as “skipped by user.”
Conversation Management (CRUD)
v2 provides lightweight conversation management through theaction field on the same endpoint, without the need to open another API.
action: retrieve —— Retrieve a Conversation
messages history, model, title, tools_used, etc.).
action: retrieve_batch —— List conversation summaries
{ items: [...], total }. Summaries do not include messages, making them suitable for sidebar lists; if the user opens a conversation, then use action: retrieve to fetch its complete messages separately.
Optional filter parameters: user_id, application_id, model_group, model.
action: update —— Change the title or rewrite history
messages can also be passed, but the server performs strict schema validation (it must be in the folded ToolUseContent form), and returns 400 if it does not comply. Generally, it is only recommended for changing the title.
action: delete —— Delete a conversation
{ id, success: true }. Deleted conversations cannot be recovered, so please confirm before calling.
Smooth migration from v1
If you are already using/aichat/conversations, migrating to v2 requires almost no code changes:
- Change the URL from
https://api.acedata.cloud/aichat/conversationstohttps://api.acedata.cloud/aichat2/conversations. - If you previously used v1 model names (such as
gpt-3.5,gpt-4-browsing, etc.), it is recommended to upgrade to current models when switching to v2 (such asgpt-5.4,claude-opus-4-8,gemini-3.1-pro-preview, etc.). - NDJSON stream fields remain backward compatible: each
text_deltaevent still includesdelta_answerandid, so clients that originally parsedelta_answerline by line do not need to be changed.
message, SSE, tool calling, action CRUD) and proceed at your own pace.
Error handling
Error responses follow a unified format:400 bad_request: Missing required fields, mismatchedtool_use_id, invalidmessagesschema, etc.401 invalid_token: Theauthorizationheader is incorrect.404 not_found: The conversation corresponding to theiddoes not exist when usingaction: retrieve / update / delete.429 too_many_requests: The rate limit has been triggered.500 chat_error: An upstream LLM error occurred, orcompletion_tokens=0for this turn (treated as not consumed and will not be charged).
{"type":"error","message":"..."} events, followed immediately by the end of the stream.

