Text to text
chatular-chat-apiSend 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
| Field | Type | What it is |
|---|---|---|
prompt | string | Your message. Required, unless you send images. |
threadId | string | Continue this chat. Leave it out to start a new one. |
images | array | Up 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. |
replyLanguage | string | Reply in this language, e.g. "Spanish". |
displayPrompt | string | What the chat saves and shows for this message. Put your own context in prompt and your user's words here. |