Messages
curl --request POST \
--url https://app.frogbot.ai/api/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"max_tokens": 123,
"messages": [
{}
],
"stream": true,
"system": {},
"temperature": 123,
"stop_sequences": [
{}
],
"tools": [
{}
],
"tool_choice": {}
}
'import requests
url = "https://app.frogbot.ai/api/v1/messages"
payload = {
"model": "<string>",
"max_tokens": 123,
"messages": [{}],
"stream": True,
"system": {},
"temperature": 123,
"stop_sequences": [{}],
"tools": [{}],
"tool_choice": {}
}
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: '<string>',
max_tokens: 123,
messages: [{}],
stream: true,
system: {},
temperature: 123,
stop_sequences: [{}],
tools: [{}],
tool_choice: {}
})
};
fetch('https://app.frogbot.ai/api/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://app.frogbot.ai/api/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' => '<string>',
'max_tokens' => 123,
'messages' => [
[
]
],
'stream' => true,
'system' => [
],
'temperature' => 123,
'stop_sequences' => [
[
]
],
'tools' => [
[
]
],
'tool_choice' => [
]
]),
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://app.frogbot.ai/api/v1/messages"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"system\": {},\n \"temperature\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\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://app.frogbot.ai/api/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"system\": {},\n \"temperature\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.frogbot.ai/api/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\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"system\": {},\n \"temperature\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"model": "claude-3-5-sonnet-20241022",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 10,
"output_tokens": 12
}
}
Inference API
Messages
Create messages with streaming and tool calling
POST
/
api
/
v1
/
messages
Messages
curl --request POST \
--url https://app.frogbot.ai/api/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"max_tokens": 123,
"messages": [
{}
],
"stream": true,
"system": {},
"temperature": 123,
"stop_sequences": [
{}
],
"tools": [
{}
],
"tool_choice": {}
}
'import requests
url = "https://app.frogbot.ai/api/v1/messages"
payload = {
"model": "<string>",
"max_tokens": 123,
"messages": [{}],
"stream": True,
"system": {},
"temperature": 123,
"stop_sequences": [{}],
"tools": [{}],
"tool_choice": {}
}
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: '<string>',
max_tokens: 123,
messages: [{}],
stream: true,
system: {},
temperature: 123,
stop_sequences: [{}],
tools: [{}],
tool_choice: {}
})
};
fetch('https://app.frogbot.ai/api/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://app.frogbot.ai/api/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' => '<string>',
'max_tokens' => 123,
'messages' => [
[
]
],
'stream' => true,
'system' => [
],
'temperature' => 123,
'stop_sequences' => [
[
]
],
'tools' => [
[
]
],
'tool_choice' => [
]
]),
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://app.frogbot.ai/api/v1/messages"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"system\": {},\n \"temperature\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\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://app.frogbot.ai/api/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"system\": {},\n \"temperature\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.frogbot.ai/api/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\": \"<string>\",\n \"max_tokens\": 123,\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"system\": {},\n \"temperature\": 123,\n \"stop_sequences\": [\n {}\n ],\n \"tools\": [\n {}\n ],\n \"tool_choice\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"model": "claude-3-5-sonnet-20241022",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 10,
"output_tokens": 12
}
}
Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.
The Messages API can be used for either single queries or stateless multi-turn conversations.
Authenticate
Use an API key in theAuthorization header.
curl https://app.frogbot.ai/api/v1/messages \
-H "Authorization: Bearer $FROGBOT_API_KEY"
Request body
string
required
Anthropic model ID to use. See available models for the full list.
integer
required
The maximum number of tokens to generate before stopping.
array
required
Conversation turns as an array of
{ role, content } objects.[
{ "role": "user", "content": "Hello, Claude" }
]
content may be a string or an array of content blocks (e.g. { "type": "text", "text": "..." }).boolean
default:"false"
Enable Server-Sent Events streaming for the response.
string | array
System prompt.
number
Sampling temperature.
array
Custom stop sequences.
array
List of tools the model may call.
object
Controls tool calling behavior.
Examples
curl https://app.frogbot.ai/api/v1/messages \
-H "Authorization: Bearer $FROGBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 256,
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
curl -N https://app.frogbot.ai/api/v1/messages \
-H "Authorization: Bearer $FROGBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 256,
"stream": true,
"messages": [
{"role": "user", "content": "Write a haiku about proxies"}
]
}'
Response
Returns an Anthropic-compatiblemessage object. If stream=true, the response is an SSE stream (text/event-stream).
{
"id": "msg_01XFDUDYJgAACzvnptvVoYEL",
"type": "message",
"role": "assistant",
"model": "claude-3-5-sonnet-20241022",
"content": [
{
"type": "text",
"text": "Hello! How can I help you today?"
}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 10,
"output_tokens": 12
}
}