Updated on 2026-07-15 GMT+08:00

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

  • assistant
  • user

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

  • text
  • tool_use
  • tool_result

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

  • enabled
  • disabled
  • enabled: The thinking mode is enabled. The model must think before answering.
  • disabled: The thinking mode is disabled. The model directly answers questions without thinking.

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.

  • When set close to 0, the model samples from only the most probable tokens, resulting in very conservative and highly deterministic outputs.
  • When set close to 1, there is virtually no restriction on the vocabulary, leading to more random and divergent outputs.

It is advised to adjust either temperature or top_p, but not both simultaneously.

Default value:

  • DeepSeek-V4: In thinking mode, the value is always 1.0, regardless of the user input.
  • This parameter is not applicable to other models.

stream

boolean/null

No

-

Determines if the response content is returned in a streaming manner.

  • false: Returns results once all content has been generated by the model.
  • true: Returns content piece by piece, ending with data: [DONE].

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

  • high
  • max

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:

  • end_turn: The model output ends naturally.
  • max_tokens: The model output triggers the max_tokens limit.
  • stop_sequence: The model output token matches the token in stop_sequence.
  • tool_use: The model determines that a tool needs to be called.

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:

  • message_start: first chunk.
  • content_block_delta: Contains the text of the formal reply, input_json for tool calls, and thinking of deep thinking.
  • content_block_stop: Indicates that a segment of content has been fully output.
  • message_delta: Contains stop_reason, stop_sequence, and usage information.
  • message_stop: Indicates that all messages have been returned.

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

  • enabled
  • disabled

DeepSeek-V4-Flash

DeepSeek-V4-Pro

enabled

  • enabled
  • disabled

DeepSeek-R1-0528

enabled

enabled

DeepSeek-V3.1

DeepSeek-V3.2

disabled

  • enabled
  • disabled

Tool Choices for Models

Model

Supported Tool Choice

GLM-5.1

GLM-5.2

  • none
  • auto
  • named

GLM-5

  • none
  • auto

DeepSeek-V4-Flash

DeepSeek-V4-Pro

DeepSeek-V3.2

DeepSeek-R1-0528

  • none
  • auto
  • named

DeepSeek-V3

DeepSeek-V3.1

  • auto
  • named