Skip to main content
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>"
}
]
}

Headers

Authorization
string
required

Body

application/json
thread_id
string
required

The unique identifier for the thread you're sending a message in.

message
string
required

The message sent by the user.

puppeteer_config_name
string
required

The name of the Puppeteer project this thread belongs to.

streaming
boolean | null
default:false

Whether to stream the response back with HTTP streaming.

config_version_id
string | null
start_new_conversation
boolean | null
default:false

Whether this message is the first in a new conversation inside the thread.

simulate
SimulatedMessage · object | null
user_type
string | null

Response

Successful Response

message
string
required

The AI's response to the message.

extras
ChatExtras · object
required

Metadata about the created messages and conversation.