Katama·Docs
StatsWorkspace ↗

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

FieldTypeRequiredNotes
kindstringyesUse "chat".
promptstringyesLong input is capped server-side to what the chosen model can take.
modelstringnoLeave 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 idCredits per reply
chat-haiku1
chat-sonnet2
chat-opus4

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