/aichat2/conversations) is the next generation dialogue interface, a comprehensive upgrade of the AI Chat API. It expands on the simplicity and multi-turn dialogue hosting of v1 by adding:
- Multimodal User Input: Directly transmit text + images + file blocks through the structured
messagefield, without needing to first attach viareferences. - Agent-like Tool Invocation: Built-in tools for web search, web scraping, file reading, etc., and can mount user-authorized MCP servers (Google Drive, Notion, Slack, GitHub, etc.), allowing the model to autonomously call tools multiple times in a single request to complete complex tasks.
- Structured Streaming Events: By using
accept: text/event-streamorapplication/x-ndjson, you can receive token-by-token events such astext_delta,tool_use,tool_result,thinking,citation,card,artifact, etc., making it easier to render them separately in the frontend by type. - Interruptible / Resumable: The model will emit an
ask_user_questionevent and pause when it needs additional information from the user; the next call can continue by filling in the answer throughtool_results. - New CRUD Actions: Complete
retrieve/retrieve_batch/update/deleteactions on the same endpoint using theactionfield, eliminating the need for additional session management APIs. - Continuously Updated Model List: By default, it connects to contemporary models such as GPT-5.4, Claude Opus 4.8, Claude Sonnet 4.6, Gemini 3.1 Pro, GLM 5.1, DeepSeek V4, Kimi K3, etc.
model + question (+ optional stateful / id / references / preset) to receive an equivalent {answer, id} JSON response as in v1, so migrating from /aichat/conversations does not require rewriting the client; just change the path to /aichat2/conversations.
If you are currently using /aichat/conversations, the old interface will still be available for service, allowing you to migrate at your own pace.
Application Process
To use the AI Chat v2 API, first obtain your API Token from the Ace Data Cloud Console for backup.
If you are not logged in or registered, you will be automatically redirected to the login page to invite you to register and log in, and will return to the current page automatically after completion.
One API Token can call all services on the platform, no need to apply separately for each service. The first application will grant a free quota for a trial experience; when the quota is insufficient, you can recharge the general balance in the console.
📘 Complete documentation: AI Chat v2 API →
Basic Usage
The simplest usage is identical to v1: passmodel + question to get {answer, id}.
CURL Example:
model values can be seen directly in the dropdown on the right side of the Try panel, with common categories including:
- 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,gemini-3.1-pro-preview,gemini-3.1-flash-image-preview,gemini-3-pro-preview,gemini-2.5-flash-lite, etc. - xAI:
grok-4, etc. - DeepSeek:
deepseek-v4-flash,deepseek-v3.2-exp,deepseek-r1-0528, etc. - Moonshot:
kimi-k3,kimi-k2.6,kimi-k2.5, etc. - Zhipu:
glm-5.1,glm-5,glm-5-turbo,glm-4.7,glm-4.5v, etc.
Multi-Turn Dialogue
Like v1, passstateful: true to enable session saving, and the API will return an id; subsequent requests can continue the conversation by bringing back the id, without needing to maintain message history yourself.
First Request:
id:
statefuldefaults totrue, omitting it is equivalent to explicitly passingtrue. If you do not want the server to save this round of conversation, you can explicitly setstateful: false.
Streaming Response
v2 supports two streaming formats, selected by theaccept header:
NDJSON Example
text_delta:
SSE Example
The browser side usingEventSource does not support custom request bodies, it is recommended to use fetch + manually slice parsing by \n\n:
Streaming Event Types
For clients that only care about the final answer, concatenating all
text_delta content is equivalent to the answer in application/json mode.
Multimodal Input
If the user input contains images or files, passmessage (array) instead of question. Each array element is a content block:
text— Plain text, thetextfield is required.image_url— Image, theimage_url.urlis required.file_url— File (PDF, CSV, TXT, etc.), thefile_url.urlis required.
Relationship with v1 references
To maintain compatibility with older clients, v2 still recognizes the references: ["https://...", ...] field:
- The URL suffix is
jpg / jpeg / png / gif / bmp / webp / svg / heic / heif, automatically converted toimage_urlblock; - Other extensions are converted to
file_urlblock; - If a
questionis also provided, it will be placed as atextblock in front.
/aichat2/conversations, and the original references usage will work as usual.
For more precise control (such as placing multiple images between texts, or if the order is very important), use the message array directly.
Tool Invocation 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 configurations in the request. Common scenarios:- The user asks, “Help me find out what new exhibitions are in Shanghai recently” → 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 event types, for example:
tool_use / tool_result / card / citation event types, and the model’s final output will still flow out through text_delta.
max_turns can limit how many rounds the model can self-invoke tools in this request, with the default limit determined by the platform. Setting it low (for example, max_turns: 1) can enforce a single response without allowing any tool invocation.
Asynchronous Execution and Unattended Authorization
If your invocation comes from an alert Webhook, CI/CD, monitoring system, or other background tasks, you can setasync: true to let the interface immediately return the task ID, while the background continues to execute:
action: retrieve + id to query the session result; you can also provide a callback_url, and after the task is completed, the platform will POST { status, answer, usage, error } to your callback address. The callback_url must use http / https, and cannot directly specify localhost or private IP literal addresses.
Background tasks usually do not have anyone to click to confirm. If you want certain Skills or MCP Servers to perform actions like sending, publishing, writing, etc., in unattended mode, please explicitly pass the pre-authorization list in the request body:
allowed_skills are the slugs of the connected Skills; the values in allowed_mcp_servers are the slugs of the connected MCP Servers. Skills / MCP Servers not listed in the pre-authorization will still only be able to preview, dry-run, or refuse to execute write operations in unattended mode.
For finer control, you can also use the equivalent unattended_policy object:
--unattended-confirm or corresponding security mechanisms; otherwise, it will continue to dry-run and not directly execute write operations.
Resuming Paused Conversations
Some tools will make the model “ask the user,” at which point the model will emit anask_user_question event, and the conversation will be frozen in the awaiting_user_input state:
id, filling in the answer through tool_results:
tool_use_id in the request body must exactly match the tool_id from when it was paused; otherwise, it will return 400. When tool_results are present in the request, question / message / references will all be ignored.
If the user decides to abandon this question, simply pass a new question / message, and the platform will automatically mark the paused tool invocation as “user skipped.”
Session Management (CRUD)
v2 provides lightweight session management through theaction field on the same endpoint, without needing to open another API.
action: retrieve — Pull a session
messages history, model, title, tools_used, etc.).
action: retrieve_batch —— List conversation summaries
{ items: [...], total }. Summaries do not include messages, suitable for sidebar lists; if the user clicks on a conversation, use action: retrieve to fetch its complete messages separately.
Optional filter parameters: user_id, application_id, model_group, model.
action: update —— Change title or rewrite history
messages can also be passed, but the server will perform strict schema validation (must be in the collapsed ToolUseContent form), and non-compliance will return 400. Generally, it is only recommended to change the title.
action: delete —— Delete a conversation
{ id, success: true }. Once deleted, it cannot be recovered, 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 passed v1 model names (such as
gpt-3.5,gpt-4-browsing, etc.), it is recommended to upgrade to contemporary models (such asgpt-5.4,claude-opus-4-8,gemini-3.1-pro, etc.) when switching to v2. - The fields of the NDJSON stream remain backward compatible: each
text_deltaevent still carriesdelta_answerandid, so clients that originally parseddelta_answerby line do not need to change.
message, SSE, tool calls, action CRUD), and proceed at your own pace.
Error handling
Error responses are unified as:400 bad_request: Missing required fields,tool_use_idmismatch, illegalmessagesschema, etc.401 invalid_token: Incorrectauthorizationheader.404 not_found: The session corresponding toiddoes not exist duringaction: retrieve / update / delete.429 too_many_requests: Rate limit triggered.500 chat_error: Upstream LLM error or this roundcompletion_tokens=0(treated as unconsumed, no charge will be incurred).
{"type":"error","message":"..."} events, followed immediately by the end of the stream.

