Chatular

Text to text

chatular-chat-api

Send a message and read the reply as it is written.

Address
POST /api/chat
Input
Text
Output
Text
curl -N https://api.chatular.ai/api/chat \  -H "Authorization: Bearer YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{"prompt":"Write a tagline for a sneaker shop"}'
The reply, as it is written
data: {"type":"start","threadId":null}

data: {"type":"delta","text":"Step into"}

data: {"type":"delta","text":" your next."}

data: {"type":"done","text":"Step into your next.","threadId":"k3J9…","inputTokens":812,"outputTokens":9}

What you send

FieldTypeWhat it is
promptstringYour message. Required, unless you send images.
threadIdstringContinue this chat. Leave it out to start a new one.
imagesarrayUp to 5 pictures, each { base64, mimeType, thumb }: PNG, JPEG, WebP or GIF, the whole request under 20 MB. mimeType is required; thumb is an optional small preview, in base64, saved with the chat.
replyLanguagestringReply in this language, e.g. "Spanish".
displayPromptstringWhat the chat saves and shows for this message. Put your own context in prompt and your user's words here.