C
Chatty

Quickstart

1. Create a bot

Log in to the Chatty Dashboard and create a new bot. Train it with a few URLs or text snippets.

2. Generate an API key

Go to Settings → API Keys and click New Key.

The API key is shown once — copy it immediately. If you lose it, revoke and generate a new one.

Your key looks like: chatty_sk_a3f9b2c1d8e4f5g6...

3. Make your first call

cURL
curl -X POST https://api.personaliai.com/api/v1/chat \
  -H "Authorization: Bearer chatty_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello! What can you help me with?",
    "session_id": "quickstart-1"
  }'
Python
import httpx
 
response = httpx.post(
    "https://api.personaliai.com/api/v1/chat",
    headers={"Authorization": "Bearer chatty_sk_your_key_here"},
    json={"text": "Hello!", "session_id": "quickstart-1"},
)
print(response.json()["reply"])
Node.js
const res = await fetch(
  "https://api.personaliai.com/api/v1/chat",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer chatty_sk_your_key_here",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ text: "Hello!", session_id: "quickstart-1" }),
  }
);
const { reply, session_id } = await res.json();
console.log(reply);
PHP
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://api.personaliai.com/api/v1/chat",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer chatty_sk_your_key_here",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "text" => "Hello!",
        "session_id" => "quickstart-1",
    ]),
]);
$data = json_decode(curl_exec($ch), true);
echo $data["reply"];

4. The response

{
  "reply": "Hi! I'm your AI assistant. I can help with product questions, pricing, support, and more. What would you like to know?",
  "session_id": "quickstart-1"
}

Save your session_id! Pass the same ID in every subsequent request to continue the conversation. The bot remembers the full history within a session.

5. Continue the conversation

curl -X POST https://api.personaliai.com/api/v1/chat \
  -H "Authorization: Bearer chatty_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "Tell me about pricing.", "session_id": "quickstart-1"}'

The bot replies with full context of the prior exchange.