curl --request POST \
--url https://api.poyo.ai/v1/messages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time."
}
]
}
'import requests
url = "https://api.poyo.ai/v1/messages"
payload = {
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time."
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 1024,
messages: [
{
role: 'user',
content: 'Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.'
}
]
})
};
fetch('https://api.poyo.ai/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.poyo.ai/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-5-20250929',
'max_tokens' => 1024,
'messages' => [
[
'role' => 'user',
'content' => 'Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.poyo.ai/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-sonnet-4-5-20250929\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.poyo.ai/v1/messages")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-sonnet-4-5-20250929\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.poyo.ai/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"claude-sonnet-4-5-20250929\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"id": "msg_013zva2CMHNLnXJNN3QKQ2EF",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! I'm Claude. Nice to meet you."
}
],
"model": "claude-sonnet-4-5-20250929",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 10,
"output_tokens": 13
}
}
}Claude Messages API
Fully compatible with Claude Messages API format
curl --request POST \
--url https://api.poyo.ai/v1/messages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time."
}
]
}
'import requests
url = "https://api.poyo.ai/v1/messages"
payload = {
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time."
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'claude-sonnet-4-5-20250929',
max_tokens: 1024,
messages: [
{
role: 'user',
content: 'Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.'
}
]
})
};
fetch('https://api.poyo.ai/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.poyo.ai/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-5-20250929',
'max_tokens' => 1024,
'messages' => [
[
'role' => 'user',
'content' => 'Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.poyo.ai/v1/messages"
payload := strings.NewReader("{\n \"model\": \"claude-sonnet-4-5-20250929\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.poyo.ai/v1/messages")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"claude-sonnet-4-5-20250929\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.poyo.ai/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"claude-sonnet-4-5-20250929\",\n \"max_tokens\": 1024,\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Rewrite the following product announcement to be more gentle and user-friendly: We will have maintenance for 2 hours this weekend, services will be unavailable during this time.\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"id": "msg_013zva2CMHNLnXJNN3QKQ2EF",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Hello! I'm Claude. Nice to meet you."
}
],
"model": "claude-sonnet-4-5-20250929",
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 10,
"output_tokens": 13
}
}
}- Fully compatible with Claude Messages API format
- Supports multi-turn conversations and single queries
- Supports multimodal content including text and images
Usage Examples
Basic Conversation
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 256,
"messages": [
{"role": "user", "content": "Explain the meaning of 'rate limiting' in three sentences."}
]
}
Streaming Response
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 256,
"thinking": {
"type": "enabled",
"budget_tokens": 2048,
"display": "summarized"
},
"stream": true,
"messages": [
{"role": "user", "content": "Write a product update announcement under 80 words, professional yet friendly."}
]
}
Tool Use
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 256,
"tools": [
{
"name": "get_weather",
"description": "Get weather by city",
"input_schema": {
"type": "object",
"properties": {
"city": {"type": "string"}
},
"required": ["city"]
}
}
],
"tool_choice": "auto",
"messages": [
{"role": "user", "content": "Check the weather in Tokyo and provide a one-sentence travel suggestion."}
]
}
Structured Output With Cache
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 256,
"cache_control": {
"type": "ephemeral",
"ttl": "1h"
},
"output_config": {
"effort": "high",
"format": {
"type": "json_schema",
"schema": {
"type": "object",
"properties": {
"summary": {"type": "string"},
"tone": {"type": "string"}
},
"required": ["summary", "tone"]
}
}
},
"messages": [
{"role": "user", "content": "Summarize this release note and label its tone."}
]
}
Vision Understanding
{
"model": "claude-sonnet-4-5-20250929",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Describe the main subject and scene in the image, and provide an alt text for it."},
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": "BASE64_IMAGE_DATA"
}
}
]
}
]
}
Notes
- Use
max_tokensto control the output length. - Thinking tokens count toward
max_tokens. - Image input can use supported base64 media payloads.
Authorizations
API key for authentication.
Visit the API Key Management Page to get your API Key
Add to the request header:
x-api-key: YOUR_API_KEY
Body
Model name. Example: claude-sonnet-4-5-20250929.
"claude-sonnet-4-5-20250929"
List of conversation messages in order. Each message contains a role and content. Use user for user input and assistant for previous model output in multi-turn conversations. Example: [{"role": "user", "content": "Summarize the purpose of feature canary releases in two sentences."}].
Show child attributes
Show child attributes
Maximum number of tokens to generate.
x >= 11024
System prompt for the assistant. Supports a string or structured text blocks.
"You are a product announcement editor, keep it objective and concise."
Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
Show child attributes
Show child attributes
Whether to use streaming output.
false
Stop sequences. The model stops when it encounters any of these strings.
Additional metadata such as user_id.
Configuration options for the model's output, such as output format and effort level.
Show child attributes
Show child attributes
Configuration for Claude extended thinking. Use this field with the claude-opus-4-7-thinking model. Thinking tokens count toward max_tokens.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Tool definitions available to the model.
Show child attributes
Show child attributes
Controls tool usage behavior. Examples: auto, or an object such as {"type": "tool", "name": "get_weather"}.
"auto"
