Usage > V2 > Anthropic-compatible
Create message
Anthropic (Claude) compatible endpoint to create a message, see the Claude documentation. <br><br> List of models available on this endpoint could be retrieve with GET /2/ai/{product_id}/anthropic/v1/models. <br><br> Some models are in beta and may being subject to changes, use GET /1/ai/models to check what model are in beta and see our General Terms and Conditions.
post/2/ai/{product_id}/anthropic/v1/messages
Path parameters
product_idinteger required
AI Tools product identifier: use GET /1/ai to retrieve your product identifier.
Request body
Example request
{
"messages": [
{
"content": "Hello, Claude",
"role": "user"
}
],
"metadata": {
"user_id": "12345"
},
"model": "glm-5.2",
"stop_sequences": [
"\\n\\nHuman:"
],
"system": "You are a helpful assistant.",
"thinking": {
"type": "enabled"
},
"tools": [
{
"description": "Get the current stock price for a given ticker symbol.",
"name": "get_stock_price"
}
]
}Response
OK
Example response
{
"id": "msg_1nZdL29xx5MUA1yADyHTEsnR8uuvGzszyY",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello!",
"id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
"name": "get_stock_price",
"input": "{\"ticker\":\"AAPL\"}",
"thinking": "I need to find the GCD of 1071 and 462.",
"signature": "EqQBCgIYAhIM1gbcDa9GJwZA2b3hGgxBdjrkzLoky3dl1pkiMOYds"
}
],
"model": "claude-sonnet-4-5",
"stop_reason": "end_turn",
"stop_sequence": "\\n\\nHuman:",
"usage": {
"input_tokens": 25,
"output_tokens": 15
}
}Changes
Changed in 1 of the 15 revisions of this API.1
- ○
endpoint added
endpoint-added
- ○