Chat completions
curl --request POST \
--url https://app.frogbot.ai/api/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [
{}
],
"stream": true,
"temperature": 123,
"max_tokens": 123,
"tools": [
{}
],
"tool_choice": {},
"mcp_servers": [
{}
],
"thinking": {},
"reasoning_effort": "<string>",
"cached_content": "<string>",
"generation_config": {},
"safety_settings": [
{}
]
}
'import requests
url = "https://app.frogbot.ai/api/v1/chat/completions"
payload = {
"model": "<string>",
"messages": [{}],
"stream": True,
"temperature": 123,
"max_tokens": 123,
"tools": [{}],
"tool_choice": {},
"mcp_servers": [{}],
"thinking": {},
"reasoning_effort": "<string>",
"cached_content": "<string>",
"generation_config": {},
"safety_settings": [{}]
}
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>',
messages: [{}],
stream: true,
temperature: 123,
max_tokens: 123,
tools: [{}],
tool_choice: {},
mcp_servers: [{}],
thinking: {},
reasoning_effort: '<string>',
cached_content: '<string>',
generation_config: {},
safety_settings: [{}]
})
};
fetch('https://app.frogbot.ai/api/v1/chat/completions', 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/chat/completions",
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>',
'messages' => [
[
]
],
'stream' => true,
'temperature' => 123,
'max_tokens' => 123,
'tools' => [
[
]
],
'tool_choice' => [
],
'mcp_servers' => [
[
]
],
'thinking' => [
],
'reasoning_effort' => '<string>',
'cached_content' => '<string>',
'generation_config' => [
],
'safety_settings' => [
[
]
]
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"mcp_servers\": [\n {}\n ],\n \"thinking\": {},\n \"reasoning_effort\": \"<string>\",\n \"cached_content\": \"<string>\",\n \"generation_config\": {},\n \"safety_settings\": [\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://app.frogbot.ai/api/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"mcp_servers\": [\n {}\n ],\n \"thinking\": {},\n \"reasoning_effort\": \"<string>\",\n \"cached_content\": \"<string>\",\n \"generation_config\": {},\n \"safety_settings\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.frogbot.ai/api/v1/chat/completions")
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 \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"mcp_servers\": [\n {}\n ],\n \"thinking\": {},\n \"reasoning_effort\": \"<string>\",\n \"cached_content\": \"<string>\",\n \"generation_config\": {},\n \"safety_settings\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4o",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 8,
"total_tokens": 20
}
}
Inference API
Chat completions
Create completions with streaming and tool calling
POST
/
api
/
v1
/
chat
/
completions
Chat completions
curl --request POST \
--url https://app.frogbot.ai/api/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"messages": [
{}
],
"stream": true,
"temperature": 123,
"max_tokens": 123,
"tools": [
{}
],
"tool_choice": {},
"mcp_servers": [
{}
],
"thinking": {},
"reasoning_effort": "<string>",
"cached_content": "<string>",
"generation_config": {},
"safety_settings": [
{}
]
}
'import requests
url = "https://app.frogbot.ai/api/v1/chat/completions"
payload = {
"model": "<string>",
"messages": [{}],
"stream": True,
"temperature": 123,
"max_tokens": 123,
"tools": [{}],
"tool_choice": {},
"mcp_servers": [{}],
"thinking": {},
"reasoning_effort": "<string>",
"cached_content": "<string>",
"generation_config": {},
"safety_settings": [{}]
}
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>',
messages: [{}],
stream: true,
temperature: 123,
max_tokens: 123,
tools: [{}],
tool_choice: {},
mcp_servers: [{}],
thinking: {},
reasoning_effort: '<string>',
cached_content: '<string>',
generation_config: {},
safety_settings: [{}]
})
};
fetch('https://app.frogbot.ai/api/v1/chat/completions', 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/chat/completions",
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>',
'messages' => [
[
]
],
'stream' => true,
'temperature' => 123,
'max_tokens' => 123,
'tools' => [
[
]
],
'tool_choice' => [
],
'mcp_servers' => [
[
]
],
'thinking' => [
],
'reasoning_effort' => '<string>',
'cached_content' => '<string>',
'generation_config' => [
],
'safety_settings' => [
[
]
]
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"mcp_servers\": [\n {}\n ],\n \"thinking\": {},\n \"reasoning_effort\": \"<string>\",\n \"cached_content\": \"<string>\",\n \"generation_config\": {},\n \"safety_settings\": [\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://app.frogbot.ai/api/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"mcp_servers\": [\n {}\n ],\n \"thinking\": {},\n \"reasoning_effort\": \"<string>\",\n \"cached_content\": \"<string>\",\n \"generation_config\": {},\n \"safety_settings\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.frogbot.ai/api/v1/chat/completions")
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 \"messages\": [\n {}\n ],\n \"stream\": true,\n \"temperature\": 123,\n \"max_tokens\": 123,\n \"tools\": [\n {}\n ],\n \"tool_choice\": {},\n \"mcp_servers\": [\n {}\n ],\n \"thinking\": {},\n \"reasoning_effort\": \"<string>\",\n \"cached_content\": \"<string>\",\n \"generation_config\": {},\n \"safety_settings\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4o",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 8,
"total_tokens": 20
}
}
Create a chat completion. Supports streaming, tool calling, and MCP server integration across all providers.
Authenticate
Use an API key in theAuthorization header.
curl https://app.frogbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $FROGBOT_API_KEY"
Request body
string
required
Model ID to use for completion. See available chat models for the full list.
array
required
Conversation history as an array of message objects.
[
{ "role": "system", "content": "You are a helpful assistant." },
{ "role": "user", "content": "Hello!" }
]
boolean
default:"false"
Enable Server-Sent Events streaming for the response.
number
Sampling temperature between 0 and 2. Higher values make output more random.
integer
Maximum tokens to generate in the completion.
array
List of tools the model may call. Supports OpenAI function tools.
[
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": { "type": "string" }
},
"required": ["location"]
}
}
}
]
string | object
Controls tool calling. Options:
auto, none, required, or a specific
tool.array
MCP server addresses for server-side tool execution.
["dedalus-labs/brave-search", "dedalus-labs/github-api"]
object
Extended thinking configuration for Anthropic models.
{ "type": "enabled", "budget_tokens": 2048 }
string
Constrains effort on reasoning for supported reasoning models. Higher values use more compute, improving quality at the cost of latency and tokens.Options:
low, medium, high"medium"
string
Pre-created Google or Vertex cache resource to use as context, in
cachedContents/{id} format. When omitted, prompt_cache_key is used as the cache resource for Google and Vertex models. Cache resource creation and management happen directly through Google, outside the gateway.object
Google generationConfig object. Merged with auto-generated config. Use for Google-specific params like
candidateCount or responseMimeType.{
"candidateCount": 2,
"responseMimeType": "application/json"
}
array
Google safety settings for harm categories and thresholds.
[
{
"category": "HARM_CATEGORY_HARASSMENT",
"threshold": "BLOCK_NONE"
}
]
Response
string
Unique identifier for the completion.
string
Always
chat.completion.integer
Unix timestamp of when the completion was created.
string
The model used for the completion.
array
object
array
List of MCP tools executed server-side, if any.
Examples
curl https://app.frogbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $FROGBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "What is the capital of France?"}
]
}'
curl https://app.frogbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $FROGBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-5-20250929",
"stream": true,
"messages": [
{"role": "user", "content": "Write a haiku about coding"}
]
}'
curl https://app.frogbot.ai/api/v1/chat/completions \
-H "Authorization: Bearer $FROGBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [
{"role": "user", "content": "What is the weather in Tokyo?"}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}
}
]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://app.frogbot.ai/api/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://app.frogbot.ai/api/v1",
apiKey: "YOUR_API_KEY",
});
const response = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"model": "gpt-4o",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is Paris."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 8,
"total_tokens": 20
}
}