Anthropic-compatible APIs
Constraints
This function is only supported in CN-Hong Kong.
API Information
| Parameter | Description | Example Value |
|---|---|---|
| API URL | API URL for calling the model service. | https://api-ap-southeast-1.modelarts-maas.com/anthropic/v1/messages |
| Authentication request header | Provides the server with identity authentication/authorization credentials. | "x-api-key": "$MaaS_API_Key" |
Supported Models
You can log in to the MaaS console and enable the following models on the Model Inference > Real-Time Inference > Built-in Services page. On the model details page in the Model Square, you can view detailed information about the models.
| Model | Version | Supported Region | Value of model |
|---|---|---|---|
| GLM | GLM-5 | CN-Hong Kong | glm-5 |
| GLM-5.1 | CN-Hong Kong | glm-5.1 | |
| GLM-5.2 | CN-Hong Kong | glm-5.2 | |
| DeepSeek | DeepSeek-V4-Pro | CN-Hong Kong | deepseek-v4-pro |
| DeepSeek-V4-Flash | CN-Hong Kong | deepseek-v4-flash | |
| DeepSeek-V3.1 | CN-Hong Kong | deepseek-v3.1-terminus | |
| DeepSeek-V3 | CN-Hong Kong | DeepSeek-V3 | |
| DeepSeek-V3.2 | CN-Hong Kong | deepseek-v3.2 | |
| DeepSeek-R1-0528 | CN-Hong Kong | deepseek-r1-250528 |
Request Parameters
| Category | Parameter | Type | Mandatory | Range | Description |
|---|---|---|---|---|---|
| General | model | string | Yes | - | Model ID being requested. Default value: N/A |
| system | string | No | - | System prompt, which can be used to assign a specific goal or role to the model. Default value: N/A | |
| messages | object[] | Yes | - | List of messages in a dialog. Different models support different types of messages. Default value: N/A | |
| messages.role | enum<string> | Yes |
| Role that sends a message. Default value: N/A | |
| messages.content | string/array | Yes | - | Message sent by the current role. Default value: N/A | |
| messages.content.type | enum<string> | Yes |
| Message type. Default value: N/A | |
| Tool call result section (When messages.content.type is set tool_result) | messages.content.tool_use_id | string | Yes | - | Tool call ID. Default value: N/A |
| messages.content.content | string | No | - | Result obtained after the tool is called. Default value: N/A | |
| Deep thinking control | thinking | object | No | - | Controls whether to enable the deep thinking mode for a model. Default value: N/A |
| thinking.type | string | Yes |
|
Default value: The default value varies depending on the model. For details, see Thinking Control for Deep Thinking Models. | |
| Model output behavior configuration | max_tokens | integer/null | No | The value varies depending on the model. For details, see the maximum output length and maximum CoT length on the model details page. | Maximum length of the model answer (only the content part). After this parameter is set, the token length of the model output content does not exceed the value of max_tokens. Default Value: 4K |
| temperature | number | No | [0.0, 1.0] | ||
| top_p | float/null | No | (0,1] | Nucleus sampling probability threshold, used to control the diversity of the content generated by the model. Similar to the temperature parameter but operates differently, allowing finer control over the vocabulary range of the model's output.
It is advised to adjust either temperature or top_p, but not both simultaneously. Default value:
| |
| stream | boolean/null | No | - | Determines if the response content is returned in a streaming manner.
Default value: false | |
| stop_sequences | string[] | No | null | Stops the model from generating content when it encounters the string specified in the stop_sequences field. The stop token does not hit the token in the CoT, but only hits the part in the formal answer content. Default value: N/A | |
| reasoning_effort | string | No |
| ||
| Tool calls | tools | array | No | - | List of tools to be calls. Default value: N/A |
| tools.name | string | Yes | - | Name of the function to be called. Default value: N/A | |
| tools.description | string | No | - | Description of the function to be called. The foundation model will determine whether to call this tool based on this description. Default value: N/A | |
| tools.input_schema | object | No | - | Function request parameters, described in JSON format. Example: {
"type": "object",
"properties": {
"parameter name": {
"type": "parameter type",
"description": "parameter description"
}
},
"required": ["mandatory parameters"]
} Parameters must conform to JSON specifications. Default value: N/A |
Response Parameters (Non-Streaming)
| Parameter | Type | Description | |
|---|---|---|---|
| id | string | Unique ID of the response object. | |
| type | enum<string> | For the message type, the value is message. | |
| role | string | Role of the output content. | |
| model | string | Name and version of the model used in this request. | |
| content | array | Model-generated content. | |
| content.type | enum<string> | Type of the generated content. | |
| Deep thinking response (type: thinking) | content.thinking | string | Deep thinking content of the model. |
| content.signature | string | Complete thinking content encrypted and returned in the signature field. | |
| Formal reply response (type: text) | content.text | string | Formal reply content of the model. |
| Tool input response (type: tool_use) | content.id | string | Tool call ID. |
| content.name | string | Name of the tool to be called. | |
| content.input | object | Structured input information required for tool calls. | |
| Other parts | stop_reason | enum<string>/null | Reason why the model stops generating tokens. Range:
|
| stop_sequence | string/null | Indicates which custom stop_sequence was matched. Returns null if none were matched. | |
| usage | object | Token usage of this request. | |
| usage.output_tokens | integer | Tokens spent on the model's output content. | |
| usage.input_tokens | integer | Number of tokens input to the model for processing. | |
Response Parameters (Streaming)
| Parameter | Type | Description | |
|---|---|---|---|
| event | - | Options:
| |
| event: message_start | type | string | Type of the chunk. |
| message | object[] | Response message. | |
| message.id | string | Unique ID of a request. | |
| message.type | string | Response message type. The value is message. | |
| message.role | string | Role of the information. | |
| message.model | string | ID of the called model. | |
| message.stop_sequence | string/null | Hit stop sequence. | |
| message.usage | object | Token usage statistics of the current request. | |
| message.usage.input_tokens | integer | Number of input tokens. | |
| message.usage.output_tokens | integer | Number of output tokens. | |
| message.content | array | Content output by the model. | |
| message.stop_reason | enum<string>/null | Reason why the model stops outputting. | |
| event: content_block_start | type | string | Type of the chunk. |
| index | integer | Index of the current element. | |
| content_block | object | Content output module of the model. | |
| content_block.type | string | Output content type. | |
| content_block.thinking | string | Deep thinking content of the model. | |
| content_block.text | string | Formal reply content of the model. | |
| content_block.id | string | Tool call ID. | |
| content_block.name | string | Name of the tool to be called. | |
| content_block.input | object | Structured input information required for tool calls. | |
| event: content_block_delta | type | string | Type of the chunk. |
| index | integer | Index of the current element. | |
| delta | object | Incremental output from the model. | |
| delta.type | string | Incremental content type. | |
| delta.text | string | Incremental text output from the model. | |
| delta.partial_json | string | JSON data required for tool calls during model streaming. | |
| event: content_block_stop | type | string | Type of the chunk. |
| index | integer | Index of the current element. | |
| event: message_delta | type | string | Type of the chunk. |
| delta | object | Incremental content of the message. | |
| delta.stop_sequence | string/null | Hit stop sequence. | |
| delta.stop_reason | string | Reason why the model stops outputting. | |
| usage | enum<string>/null | Token usage statistics of the current request. | |
| usage.output_tokens | integer | Number of output tokens. | |
| event: message_stop | type | string | Type of the chunk. |
| event: ping | type | string | Type of the chunk. |
Thinking Control for Deep Thinking Models
| Model | thinking.type Default Value | thinking.type Options |
|---|---|---|
| GLM-5.2 GLM-5.1 GLM-5 | enabled |
|
| DeepSeek-V4-Flash DeepSeek-V4-Pro | enabled |
|
| DeepSeek-R1-0528 | enabled | enabled |
| DeepSeek-V3.1 DeepSeek-V3.2 | disabled |
|
Tool Choices for Models
| Model | Supported Tool Choice |
|---|---|
| GLM-5.1 GLM-5.2 |
|
| GLM-5 |
|
| DeepSeek-V4-Flash DeepSeek-V4-Pro DeepSeek-V3.2 DeepSeek-R1-0528 |
|
| DeepSeek-V3 DeepSeek-V3.1 |
|
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot