curl --request POST \
--url https://ai.cubeuaeai.com/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "claude-sonnet-4-6",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"system": "<string>",
"metadata": {
"user_id": "<string>"
},
"stop_sequences": [
"<string>"
],
"temperature": 1,
"top_p": 0.5,
"top_k": 1,
"stream": false,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"tool_choice": {
"name": "<string>"
},
"thinking": {
"budget_tokens": 1025
}
}
'import requests
url = "https://ai.cubeuaeai.com/v1/messages"
payload = {
"model": "claude-sonnet-4-6",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"system": "<string>",
"metadata": { "user_id": "<string>" },
"stop_sequences": ["<string>"],
"temperature": 1,
"top_p": 0.5,
"top_k": 1,
"stream": False,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"tool_choice": { "name": "<string>" },
"thinking": { "budget_tokens": 1025 }
}
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: 'claude-sonnet-4-6',
messages: [{role: 'user', content: 'Hello, Claude!'}],
max_tokens: 1024,
system: '<string>',
metadata: {user_id: '<string>'},
stop_sequences: ['<string>'],
temperature: 1,
top_p: 0.5,
top_k: 1,
stream: false,
tools: [{name: '<string>', input_schema: {}, description: '<string>'}],
tool_choice: {name: '<string>'},
thinking: {budget_tokens: 1025}
})
};
fetch('https://ai.cubeuaeai.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://ai.cubeuaeai.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' => 'claude-sonnet-4-6',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, Claude!'
]
],
'max_tokens' => 1024,
'system' => '<string>',
'metadata' => [
'user_id' => '<string>'
],
'stop_sequences' => [
'<string>'
],
'temperature' => 1,
'top_p' => 0.5,
'top_k' => 1,
'stream' => false,
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'description' => '<string>'
]
],
'tool_choice' => [
'name' => '<string>'
],
'thinking' => [
'budget_tokens' => 1025
]
]),
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://ai.cubeuaeai.com/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-sonnet-4-6\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"budget_tokens\": 1025\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://ai.cubeuaeai.com/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-sonnet-4-6\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"budget_tokens\": 1025\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.cubeuaeai.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\": \"claude-sonnet-4-6\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"budget_tokens\": 1025\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I help you?"
}
],
"model": "claude-sonnet-4-6",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123
},
"stop_sequence": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
}
}Create Message
Send a structured list of input messages, and the model will generate the next message in the conversation.
curl --request POST \
--url https://ai.cubeuaeai.com/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "claude-sonnet-4-6",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"system": "<string>",
"metadata": {
"user_id": "<string>"
},
"stop_sequences": [
"<string>"
],
"temperature": 1,
"top_p": 0.5,
"top_k": 1,
"stream": false,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"tool_choice": {
"name": "<string>"
},
"thinking": {
"budget_tokens": 1025
}
}
'import requests
url = "https://ai.cubeuaeai.com/v1/messages"
payload = {
"model": "claude-sonnet-4-6",
"messages": [
{
"role": "user",
"content": "Hello, Claude!"
}
],
"max_tokens": 1024,
"system": "<string>",
"metadata": { "user_id": "<string>" },
"stop_sequences": ["<string>"],
"temperature": 1,
"top_p": 0.5,
"top_k": 1,
"stream": False,
"tools": [
{
"name": "<string>",
"input_schema": {},
"description": "<string>"
}
],
"tool_choice": { "name": "<string>" },
"thinking": { "budget_tokens": 1025 }
}
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: 'claude-sonnet-4-6',
messages: [{role: 'user', content: 'Hello, Claude!'}],
max_tokens: 1024,
system: '<string>',
metadata: {user_id: '<string>'},
stop_sequences: ['<string>'],
temperature: 1,
top_p: 0.5,
top_k: 1,
stream: false,
tools: [{name: '<string>', input_schema: {}, description: '<string>'}],
tool_choice: {name: '<string>'},
thinking: {budget_tokens: 1025}
})
};
fetch('https://ai.cubeuaeai.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://ai.cubeuaeai.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' => 'claude-sonnet-4-6',
'messages' => [
[
'role' => 'user',
'content' => 'Hello, Claude!'
]
],
'max_tokens' => 1024,
'system' => '<string>',
'metadata' => [
'user_id' => '<string>'
],
'stop_sequences' => [
'<string>'
],
'temperature' => 1,
'top_p' => 0.5,
'top_k' => 1,
'stream' => false,
'tools' => [
[
'name' => '<string>',
'input_schema' => [
],
'description' => '<string>'
]
],
'tool_choice' => [
'name' => '<string>'
],
'thinking' => [
'budget_tokens' => 1025
]
]),
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://ai.cubeuaeai.com/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-sonnet-4-6\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"budget_tokens\": 1025\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://ai.cubeuaeai.com/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-sonnet-4-6\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"budget_tokens\": 1025\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.cubeuaeai.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\": \"claude-sonnet-4-6\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Hello, Claude!\"\n }\n ],\n \"max_tokens\": 1024,\n \"system\": \"<string>\",\n \"metadata\": {\n \"user_id\": \"<string>\"\n },\n \"stop_sequences\": [\n \"<string>\"\n ],\n \"temperature\": 1,\n \"top_p\": 0.5,\n \"top_k\": 1,\n \"stream\": false,\n \"tools\": [\n {\n \"name\": \"<string>\",\n \"input_schema\": {},\n \"description\": \"<string>\"\n }\n ],\n \"tool_choice\": {\n \"name\": \"<string>\"\n },\n \"thinking\": {\n \"budget_tokens\": 1025\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! How can I help you?"
}
],
"model": "claude-sonnet-4-6",
"stop_reason": "end_turn",
"usage": {
"input_tokens": 123,
"output_tokens": 123,
"cache_creation_input_tokens": 123,
"cache_read_input_tokens": 123
},
"stop_sequence": "<string>"
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
}
}{
"type": "error",
"error": {
"type": "<string>",
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The model used for completion.
claude-sonnet-4-6, claude-sonnet-4-5-20250929, claude-sonnet-4-20250514, claude-opus-4-6, claude-opus-4-5-20251101, claude-opus-4-1-20250805, claude-opus-4-20250514, claude-haiku-4-5-20251001, claude-3-7-sonnet-20250219, claude-3-5-sonnet-20241022 "claude-sonnet-4-6"
List of input messages. Each message includes a role and content.
1Show child attributes
Show child attributes
[
{
"role": "user",
"content": "Hello, Claude!"
}
]
Maximum number of tokens to generate before stopping.
x >= 11024
System prompt. Provides context and instructions for Claude.
An object that describes request metadata.
Show child attributes
Show child attributes
Custom text sequences. The model stops generating when it encounters them.
Randomness injected into the response. Range: 0.0 to 1.0.
0 <= x <= 11
Use nucleus sampling. Prefer either temperature or top_p, not both.
0 <= x <= 1Sample only from the top K options for each subsequent token.
x >= 0Whether to incrementally stream the response using server-sent events (SSE).
Tool definitions the model can use.
Show child attributes
Show child attributes
Controls how the model uses the provided tools.
Show child attributes
Show child attributes
Extended thinking configuration. When enabled, the model thinks deeply before replying.
Show child attributes
Show child attributes
Response
Message created successfully
"msg_01XFDUDYJgAACzvnptvVoYEL"
"message"
"assistant"
Show child attributes
Show child attributes
[
{
"type": "text",
"text": "Hello! How can I help you?"
}
]
"claude-sonnet-4-6"
end_turn, max_tokens, stop_sequence, tool_use, null Show child attributes
Show child attributes