Application Process
To use the Claude Chat Completion API, first go to the Ace Data Cloud Console to obtain your API Token and keep it for later use.
If you have 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 platform services; there is no need to apply separately for each service. Your first application will receive free credits for a free trial; when credits are insufficient, you can recharge your general balance in the Console.
📘 Full documentation: Claude Chat Completion API →
Basic Usage
Next, you can fill in the corresponding content in the interface, as shown in the image:
authorization, which can be selected directly from the dropdown list. Another parameter is model, and it is recommended to use the latest flagship claude-fable-5-1; the original claude-fable-5 can still continue to be called. The last parameter is messages, which is an array of prompt messages, where each element contains role and content; role supports user, assistant, and system, while content is the specific content. Claude Fable 5.1 supports 1 million Token context and a maximum output of 128K Tokens.
At the same time, you can notice that the corresponding invocation code is generated on the right. You can copy the code and run it directly, or click the “Try” button directly for testing.
Common optional parameters:
max_tokens: Limits the maximum number of tokens in a single response.temperature: Generation randomness, between 0 and 2; the larger the value, the more divergent it is.n: How many candidate responses to generate at once.response_format: Return format settings.

id, the ID generated for this conversation task, used to uniquely identify this conversation task.model, the Claude official website model selected.choices, the response information provided by Claude for the prompt.usage: Statistical information about tokens for this Q&A session.
usage.prompt_tokens is the total input amount; prompt_tokens_details.cached_tokens and prompt_tokens_details.cache_write_tokens respectively record cache read and write details. completion_tokens_details.reasoning_tokens is a subset of completion_tokens, and should not be added again when calculating totals or costs. Non-streaming responses may also return a usage.cost object, where amount is the actual credit consumption, currency is the unit of measurement, and list_amount is the amount before discounts, if applicable.
The field name in Chat-compatible is reasoning_tokens; the native Messages API uses output_tokens_details.thinking_tokens. The wire schemas of the two protocols are different, and clients should not mix field names.
Among them, choices contains Claude’s response information, and the choices inside it contains the specific information of Claude’s response, as shown in the image.

content field in choices contains the specific content of Claude’s response.
Streaming Response
This API also supports streaming responses, which is very useful for web integration and can enable a word-by-word display effect on web pages. If you want to return responses in a stream, you can change thestream parameter in the request header to true.
The modification is shown in the image, but the invocation code needs corresponding changes to support streaming responses.

stream to true, the API will return the corresponding JSON data line by line. At the code level, we need to make corresponding changes to obtain line-by-line results.
Python sample invocation code:
data entries in the response. The choices within data are the latest response content, which is consistent with the content introduced above. choices contains the newly added response content, and you can integrate it into your system according to the results. At the same time, the end of a streaming response is determined based on the content of data. If the content is [DONE], it indicates that the streaming response has completely ended. The returned data results contain multiple fields, described as follows:
id, the ID generated for this conversation task, used to uniquely identify this conversation task.model, the Claude official website model selected.choices, the response information given by Claude for the prompt.
Multi-turn Conversations
If you want to integrate multi-turn conversation functionality, you need to upload multiple prompts in themessages field. A specific example of multiple prompts is shown in the image below:

choices is consistent with the basic usage content. This contains the specific content of Claude’s responses to multiple conversations, so that corresponding questions can be answered based on the multiple conversation contents.
Deep Thinking
New-generation Claude models may reason according to the model’s default policy, without needing to be triggered through the-thinking model suffix. Chat-compatible responses use the OpenAI-compatible usage field completion_tokens_details.reasoning_tokens. reasoning_tokens is already included in completion_tokens; do not add them together repeatedly. Reasoning and visible body text share the output token limit, so when max_tokens is small, the body text may be empty or truncated; in this case, please increase the output budget, or select a lower reasoning effort when supported by the model being used.
If native thinking, output_config.effort, thinking content blocks, and signature return are required, please use /v1/messages. The usage field corresponding to Messages is output_tokens_details.thinking_tokens; do not mix it with the Chat-compatible completion_tokens_details.reasoning_tokens.
Vision Model
claude-sonnet-4-20250514 is a multimodal large language model developed by Claude. It adds visual understanding capabilities based on claude-4. This model can process both text and image inputs simultaneously, achieving cross-modal understanding and generation. The text processing of the claude-sonnet-4-20250514 model is consistent with the basic usage described above. Below is a brief introduction to how to use the model’s image processing capabilities. The image processing capability of the claude-sonnet-4-20250514 model is mainly enabled by adding atype field to the original content content. Through this field, it can determine whether the upload is text or an image, thereby using the image processing capability of the claude-sonnet-4-20250514 model. The following mainly describes two ways to call this capability, using Curl and Python.
- Curl script method
- Python script method
Error Handling
When calling the API, if an error is encountered, the API will return the corresponding error code and information. For example:400 token_mismatched: Bad request, possibly due to missing or invalid parameters.400 api_not_implemented: Bad request, possibly due to missing or invalid parameters.401 invalid_token: Unauthorized, invalid or missing authorization token.429 too_many_requests: Too many requests, you have exceeded the rate limit.500 api_error: Internal server error, something went wrong on the server.

