AI Chat API
POSThttps://api.acedata.cloud/aichat/conversations

This API is based on LLM, providing artificial intelligence Q&A functionality, and supports multi-turn dialogue interaction and streaming responses.

Request Headers

acceptstring
Specify the response format returned by the server.
Please select
authorizationstring
Bearer token

Request Body

actionstring
When action is omitted or set to chat, question and model must be provided, and charges are based on the selected model. retrieve, retrieve_batch, update, and delete each cost 0 Credits per request and do not require question or model.
Please select
modelstring
The name of the large language model used to answer prompt words.
Please select
questionstring
Prompts or questions for the model to respond to.
statefulboolean
Whether to enable stateful conversation mode. Once enabled, the server will retain conversation history to support multi-turn continuous dialogue.
Please select
idstring
The unique identifier of the conversation, which can be used to continue an existing conversation. This field is required for retrieve, update, and delete.
presetstring
Preset system prompts or dialogue configurations used to customize the model's response style and behavior.
referencesarray
idsarray
retrieve_batch The list of session IDs to query.
titlestring
update the new title to be set.
messagesarray
update is an array of messages used to replace the entire conversation history, with the same message format as the messages returned by retrieve.

Response

Integration guide

Shell

Python

JavaScript

Java

Go

PHP

Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.

AI Dialogue
Allow Use General Balance

When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.