curl --request POST \
--url https://api.sailresearch.com/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "zai-org/GLM-5.3",
"max_tokens": 300,
"messages": [
{
"role": "user",
"content": "Give me a short launch checklist for an API integration."
}
]
}
'import requests
url = "https://api.sailresearch.com/v1/messages"
payload = {
"model": "zai-org/GLM-5.3",
"max_tokens": 300,
"messages": [
{
"role": "user",
"content": "Give me a short launch checklist for an API integration."
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'zai-org/GLM-5.3',
max_tokens: 300,
messages: [
{
role: 'user',
content: 'Give me a short launch checklist for an API integration.'
}
]
})
};
fetch('https://api.sailresearch.com/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sailresearch.com/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'zai-org/GLM-5.3',
'max_tokens' => 300,
'messages' => [
[
'role' => 'user',
'content' => 'Give me a short launch checklist for an API integration.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sailresearch.com/v1/messages"
payload := strings.NewReader("{\n \"model\": \"zai-org/GLM-5.3\",\n \"max_tokens\": 300,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Give me a short launch checklist for an API integration.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sailresearch.com/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"zai-org/GLM-5.3\",\n \"max_tokens\": 300,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Give me a short launch checklist for an API integration.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sailresearch.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"zai-org/GLM-5.3\",\n \"max_tokens\": 300,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Give me a short launch checklist for an API integration.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "<string>",
"cache_control": {
"type": "ephemeral"
}
}
],
"model": "<string>",
"stop_reason": "end_turn",
"stop_sequence": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}Create an Anthropic message
Anthropic-compatible Messages endpoint supporting system prompts, tool calling, and Anthropic SSE framing after generation completes.
curl --request POST \
--url https://api.sailresearch.com/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "zai-org/GLM-5.3",
"max_tokens": 300,
"messages": [
{
"role": "user",
"content": "Give me a short launch checklist for an API integration."
}
]
}
'import requests
url = "https://api.sailresearch.com/v1/messages"
payload = {
"model": "zai-org/GLM-5.3",
"max_tokens": 300,
"messages": [
{
"role": "user",
"content": "Give me a short launch checklist for an API integration."
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'zai-org/GLM-5.3',
max_tokens: 300,
messages: [
{
role: 'user',
content: 'Give me a short launch checklist for an API integration.'
}
]
})
};
fetch('https://api.sailresearch.com/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sailresearch.com/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'zai-org/GLM-5.3',
'max_tokens' => 300,
'messages' => [
[
'role' => 'user',
'content' => 'Give me a short launch checklist for an API integration.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sailresearch.com/v1/messages"
payload := strings.NewReader("{\n \"model\": \"zai-org/GLM-5.3\",\n \"max_tokens\": 300,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Give me a short launch checklist for an API integration.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sailresearch.com/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"zai-org/GLM-5.3\",\n \"max_tokens\": 300,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Give me a short launch checklist for an API integration.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sailresearch.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"zai-org/GLM-5.3\",\n \"max_tokens\": 300,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Give me a short launch checklist for an API integration.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "<string>",
"cache_control": {
"type": "ephemeral"
}
}
],
"model": "<string>",
"stop_reason": "end_turn",
"stop_sequence": "<string>",
"usage": {
"input_tokens": 123,
"output_tokens": 123
}
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>"
},
"request_id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Anthropic-compatible idempotency header. Same semantics as Idempotency-Key; used on the /messages endpoint to match Anthropic's conventions.
255Body
x >= 11Show child attributes
Show child attributes
System prompt: a string, or an array of text blocks.
0 <= x <= 10 <= x <= 1Show child attributes
Show child attributes
Show child attributes
Show child attributes
Tool definitions the model may call. Responses include tool_use blocks; return outcomes as tool_result content blocks in a follow-up message.
Controls tool use: auto, any, tool, or none.
Extended thinking configuration; translated to the model's reasoning.
When true, returns Anthropic Server-Sent Events after generation completes. This is not incremental token delivery.
Optional string metadata. completion_window controls scheduling; completion_webhook/webhook_token configure completion webhooks; supercache_write stores a reusable prompt prefix.
Show child attributes
Show child attributes
Anthropic server-side context-editing config (Claude Code sends it automatically). Accepted for compatibility but ignored: Sail forwards the full context each turn.
Response
Anthropic-compatible message response. Returns a single JSON object by default, or an Anthropic Server-Sent Events stream when stream: true.
message assistant 1- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
end_turn, max_tokens, tool_use, stop_sequence, refusal, model_context_window_exceeded Show child attributes
Show child attributes