Chat
The same endpoint as images and video, with kind: "chat". Chat is the one kind with a free daily allowance, so the first replies of a day usually cost nothing.
Endpoint
POST /api/generate
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
kind | string | yes | Use "chat". |
prompt | string | yes | Long input is capped server-side to what the chosen model can take. |
model | string | no | Leave it out — or send the auto id — and Katama picks the model for you. |
The free allowance
Every account gets a number of free chat replies. While the allowance lasts, the reply is served by the automatically chosen model and creditsCharged comes back as 0. The allowance is claimed atomically, so opening a hundred tabs does not multiply it. Your remaining allowance is part of the credits response:
GET /api/credits
{
"balance": 2800,
"trial": { "chatCap": 10, "chatUsed": 0, "chatLeft": 10 }
}A 0 in
creditsCharged does not mean chat is free. It means this reply was covered by the allowance. Once it is used up, replies are priced per the table below.Models and what they cost
| Model id | Credits per reply |
|---|---|
chat-haiku | 1 |
chat-sonnet | 2 |
chat-opus | 4 |
Example
curl https://katama.ai/api/generate \
-H "Content-Type: application/json" \
-d '{
"kind": "chat",
"prompt": "Give me three shot ideas for a rainy-street product ad."
}'Next: Authentication · Plans & credits