Chat
curl --request POST \
--url https://api.puppeteerai.com/chat \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"thread_id": "<string>",
"message": "<string>",
"puppeteer_config_name": "<string>",
"streaming": false,
"config_version_id": "<string>",
"start_new_conversation": false,
"simulate": {
"initial_messages": [
"<string>"
],
"max_turns": 123,
"agent_type": "<string>",
"industry": "<string>",
"behavioural_prompt": "<string>",
"topic": "<string>",
"create": false,
"evaluate": false
},
"user_type": "<string>"
}
'import requests
url = "https://api.puppeteerai.com/chat"
payload = {
"thread_id": "<string>",
"message": "<string>",
"puppeteer_config_name": "<string>",
"streaming": False,
"config_version_id": "<string>",
"start_new_conversation": False,
"simulate": {
"initial_messages": ["<string>"],
"max_turns": 123,
"agent_type": "<string>",
"industry": "<string>",
"behavioural_prompt": "<string>",
"topic": "<string>",
"create": False,
"evaluate": False
},
"user_type": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
thread_id: '<string>',
message: '<string>',
puppeteer_config_name: '<string>',
streaming: false,
config_version_id: '<string>',
start_new_conversation: false,
simulate: {
initial_messages: ['<string>'],
max_turns: 123,
agent_type: '<string>',
industry: '<string>',
behavioural_prompt: '<string>',
topic: '<string>',
create: false,
evaluate: false
},
user_type: '<string>'
})
};
fetch('https://api.puppeteerai.com/chat', 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.puppeteerai.com/chat",
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([
'thread_id' => '<string>',
'message' => '<string>',
'puppeteer_config_name' => '<string>',
'streaming' => false,
'config_version_id' => '<string>',
'start_new_conversation' => false,
'simulate' => [
'initial_messages' => [
'<string>'
],
'max_turns' => 123,
'agent_type' => '<string>',
'industry' => '<string>',
'behavioural_prompt' => '<string>',
'topic' => '<string>',
'create' => false,
'evaluate' => false
],
'user_type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.puppeteerai.com/chat"
payload := strings.NewReader("{\n \"thread_id\": \"<string>\",\n \"message\": \"<string>\",\n \"puppeteer_config_name\": \"<string>\",\n \"streaming\": false,\n \"config_version_id\": \"<string>\",\n \"start_new_conversation\": false,\n \"simulate\": {\n \"initial_messages\": [\n \"<string>\"\n ],\n \"max_turns\": 123,\n \"agent_type\": \"<string>\",\n \"industry\": \"<string>\",\n \"behavioural_prompt\": \"<string>\",\n \"topic\": \"<string>\",\n \"create\": false,\n \"evaluate\": false\n },\n \"user_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.puppeteerai.com/chat")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"thread_id\": \"<string>\",\n \"message\": \"<string>\",\n \"puppeteer_config_name\": \"<string>\",\n \"streaming\": false,\n \"config_version_id\": \"<string>\",\n \"start_new_conversation\": false,\n \"simulate\": {\n \"initial_messages\": [\n \"<string>\"\n ],\n \"max_turns\": 123,\n \"agent_type\": \"<string>\",\n \"industry\": \"<string>\",\n \"behavioural_prompt\": \"<string>\",\n \"topic\": \"<string>\",\n \"create\": false,\n \"evaluate\": false\n },\n \"user_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puppeteerai.com/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"thread_id\": \"<string>\",\n \"message\": \"<string>\",\n \"puppeteer_config_name\": \"<string>\",\n \"streaming\": false,\n \"config_version_id\": \"<string>\",\n \"start_new_conversation\": false,\n \"simulate\": {\n \"initial_messages\": [\n \"<string>\"\n ],\n \"max_turns\": 123,\n \"agent_type\": \"<string>\",\n \"industry\": \"<string>\",\n \"behavioural_prompt\": \"<string>\",\n \"topic\": \"<string>\",\n \"create\": false,\n \"evaluate\": false\n },\n \"user_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"extras": {
"user_message_id": "<string>",
"conversation_id": 123,
"reply_message_id": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Messages
Chat
Send a user message to a thread and get back an AI response.
POST
/
chat
Chat
curl --request POST \
--url https://api.puppeteerai.com/chat \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"thread_id": "<string>",
"message": "<string>",
"puppeteer_config_name": "<string>",
"streaming": false,
"config_version_id": "<string>",
"start_new_conversation": false,
"simulate": {
"initial_messages": [
"<string>"
],
"max_turns": 123,
"agent_type": "<string>",
"industry": "<string>",
"behavioural_prompt": "<string>",
"topic": "<string>",
"create": false,
"evaluate": false
},
"user_type": "<string>"
}
'import requests
url = "https://api.puppeteerai.com/chat"
payload = {
"thread_id": "<string>",
"message": "<string>",
"puppeteer_config_name": "<string>",
"streaming": False,
"config_version_id": "<string>",
"start_new_conversation": False,
"simulate": {
"initial_messages": ["<string>"],
"max_turns": 123,
"agent_type": "<string>",
"industry": "<string>",
"behavioural_prompt": "<string>",
"topic": "<string>",
"create": False,
"evaluate": False
},
"user_type": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
thread_id: '<string>',
message: '<string>',
puppeteer_config_name: '<string>',
streaming: false,
config_version_id: '<string>',
start_new_conversation: false,
simulate: {
initial_messages: ['<string>'],
max_turns: 123,
agent_type: '<string>',
industry: '<string>',
behavioural_prompt: '<string>',
topic: '<string>',
create: false,
evaluate: false
},
user_type: '<string>'
})
};
fetch('https://api.puppeteerai.com/chat', 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.puppeteerai.com/chat",
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([
'thread_id' => '<string>',
'message' => '<string>',
'puppeteer_config_name' => '<string>',
'streaming' => false,
'config_version_id' => '<string>',
'start_new_conversation' => false,
'simulate' => [
'initial_messages' => [
'<string>'
],
'max_turns' => 123,
'agent_type' => '<string>',
'industry' => '<string>',
'behavioural_prompt' => '<string>',
'topic' => '<string>',
'create' => false,
'evaluate' => false
],
'user_type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.puppeteerai.com/chat"
payload := strings.NewReader("{\n \"thread_id\": \"<string>\",\n \"message\": \"<string>\",\n \"puppeteer_config_name\": \"<string>\",\n \"streaming\": false,\n \"config_version_id\": \"<string>\",\n \"start_new_conversation\": false,\n \"simulate\": {\n \"initial_messages\": [\n \"<string>\"\n ],\n \"max_turns\": 123,\n \"agent_type\": \"<string>\",\n \"industry\": \"<string>\",\n \"behavioural_prompt\": \"<string>\",\n \"topic\": \"<string>\",\n \"create\": false,\n \"evaluate\": false\n },\n \"user_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.puppeteerai.com/chat")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"thread_id\": \"<string>\",\n \"message\": \"<string>\",\n \"puppeteer_config_name\": \"<string>\",\n \"streaming\": false,\n \"config_version_id\": \"<string>\",\n \"start_new_conversation\": false,\n \"simulate\": {\n \"initial_messages\": [\n \"<string>\"\n ],\n \"max_turns\": 123,\n \"agent_type\": \"<string>\",\n \"industry\": \"<string>\",\n \"behavioural_prompt\": \"<string>\",\n \"topic\": \"<string>\",\n \"create\": false,\n \"evaluate\": false\n },\n \"user_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puppeteerai.com/chat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"thread_id\": \"<string>\",\n \"message\": \"<string>\",\n \"puppeteer_config_name\": \"<string>\",\n \"streaming\": false,\n \"config_version_id\": \"<string>\",\n \"start_new_conversation\": false,\n \"simulate\": {\n \"initial_messages\": [\n \"<string>\"\n ],\n \"max_turns\": 123,\n \"agent_type\": \"<string>\",\n \"industry\": \"<string>\",\n \"behavioural_prompt\": \"<string>\",\n \"topic\": \"<string>\",\n \"create\": false,\n \"evaluate\": false\n },\n \"user_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"extras": {
"user_message_id": "<string>",
"conversation_id": 123,
"reply_message_id": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Headers
Body
application/json
The unique identifier for the thread you're sending a message in.
The message sent by the user.
The name of the Puppeteer project this thread belongs to.
Whether to stream the response back with HTTP streaming.
Whether this message is the first in a new conversation inside the thread.
Show child attributes
Show child attributes
⌘I