Asking

Put your agent behind anything — a ticket queue, an inbox, a webhook — without a browser in sight.

One request, one answer

POST /v1/agents/:publicId/chat with a message (1–4000 characters) and, usually, a conversationId of your own (up to 64).

bash
curl -X POST https://api.tigerbase.cloud/v1/agents/a1b2c3d4…/chat \
  -H "Authorization: Bearer $TIGERBASE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message":"Where is my order?","conversationId":"ticket-900"}'
201 Created
{
  "answer": "Order 4471 shipped on Tuesday and should arrive Thursday.",
  "messageId": "k3v9q2…",
  "conversationId": "ticket-900",
  "handedOff": false,
  "confirmation": null
}
Your system holds the thread id. Tigerbase holds the memory behind it.

Not streaming, on purpose

The widget streams because somebody is watching it paint — an answer that arrives a word at a time reads as thinking. Your server is going to join the pieces back together anyway, so a stream here would be a complication with no reader. One request, one finished answer — give your HTTP client a timeout long enough for the model to finish.

What comes back

answerThe finished reply.
messageIdWhat the server stored this answer under. Null when you passed no conversationId — nothing was stored, so there is nothing to refer back to.
conversationIdWhat you passed, echoed back. Null if you passed none.
handedOffThe agent decided it was stuck and summoned a person. Worth checking — see below.
confirmationA capability that asks first stopped the turn and nothing ran yet: { id, toolName, description, args }. Answer it with confirm() — see below. Null when nothing was asked.

conversationId is the whole point

It is your reference — a ticket number, a customer id, a thread key from your own system. Pass the same one again and the agent continues the conversation.

typescript
await tigerbase.ask(id, "My order is 4471.", { conversationId: "ticket-900" });
// → "Got it — I've noted that your order number is 4471."

await tigerbase.ask(id, "What was my order number?", { conversationId: "ticket-900" });
// → "Your order number is 4471."

await tigerbase.ask(id, "What was my order number?", { conversationId: "ticket-901" });
// → "I'm not seeing any order information…"   ← a different thread entirely

WarningLeaving it out is a decision, not a default to drift into

Without it the turn is answered and not remembered. That is right for a one-shot classification and wrong for a conversation — and it fails silently, because every individual answer looks fine. If a customer ever sends a second message, you need an id.

TipUse an id you already have

A ticket number or a customer id means the conversation lines up with the record it belongs to, and you can find it again later without storing a mapping. A fresh UUID per request is the same as passing nothing, with extra steps.

These conversations have their own channel

A thread started here shows up in conversations() as api:your-id — not as a web visitor.

typescript
const recent = await tigerbase.conversations(agent.publicId);
// [{ visitor: "api:ticket-900", channel: "api", messages: 4, … },
//  { visitor: "tb-bba2ef31-…",  channel: "web", messages: 2, … }]

// Pass the visitor back exactly as given, prefix included.
const thread = await tigerbase.conversation(agent.publicId, "api:ticket-900");

NoteWhy it is not just a web conversation

The id is yours to choose, and browser ids live in the same table. A CRM that numbers a ticket the way a browser happens to be numbered would otherwise hand two different people the same conversation. The prefix is part of the id, so pass it back unchanged.

Check handedOff

typescript
const reply = await tigerbase.ask(agent.publicId, question, {
  conversationId: `ticket-${ticket.id}`,
});

if (reply.handedOff) {
  // The agent has deliberately gone quiet. Asking again gets you nothing.
  await assignToHuman(ticket);
}

When an agent decides it cannot answer, it summons a person and stops answering — two voices replying to one question is worse than a wait. A caller that ignores this keeps asking and wonders why the replies stopped. The person then answers through the handoff routes.

The limits are the same ones

This route costs the account exactly what a widget message costs, because it is the same model call. The plan's per-minute rate, its monthly allowance and its ceiling on simultaneous conversations all apply. All three answer 429; the SDK tells them apart as rate_limited, monthly_limit and too_many_conversations, and keeps the server's limit object on the error.

429 Too Many Requests
{
  "statusCode": 429,
  "error": "Too Many Requests",
  "message": "Too many messages right now. Please try again in 12 second(s).",
  "limit": { "kind": "rate", "limit": 30, "retryAfterSeconds": 12 }
}
limit.kind: "rate"The per-minute rate. Carries retryAfterSeconds, measured by the server's own window — the SDK puts it on the error.
limit.kind: "monthly"The period's allowance is spent. Carries used and resetsAt. Retrying before resetsAt changes nothing.
limit.kind: "concurrency"Too many conversations open at once. Carries open. Try again shortly.

WarningA batch job will find the rate limit

Looping over a thousand tickets is exactly the shape that hits it. Wait retryAfterSeconds on rate_limited, and run the loop with a small amount of concurrency rather than none or all of it. Stop the loop on monthly_limit: no wait brings it back before error.limit.resetsAt.

Answer a confirmation

A capability with Requires Confirmation does not run on the model's word. The answer comes back with confirmation instead; you decide — or ask your customer — and send the answer. The id works once, for ten minutes, and only under the conversationId it was asked in, so a turn without one gets id: null and cannot be confirmed.

typescript
const reply = await tigerbase.ask(agent.publicId, "Cancel order 4471", {
  conversationId: "ticket-900",
});

if (reply.confirmation?.id) {
  // reply.confirmation.description: "Cancel order 4471? This cannot be undone."
  const done = await tigerbase.confirm(agent.publicId, reply.confirmation.id, true, {
    conversationId: "ticket-900",
  });
  console.log(done.answer);
}

approve: false runs nothing, and the agent asks what to do instead. An id that was used, expired or belongs to another conversation answers 404, which the SDK reports as confirmation_expired.

When it cannot answer

403 — This agent is switched off.An inactive agent answers nobody, including you. It still appears in agents(). The SDK reports it as agent_inactive.
502 — The agent could not answer that.The model call failed. The detail stays in our logs. The SDK reports it as unknown with status 502; one retry after a short pause is reasonable.

Scope

Needs chat. A key with only read gets forbidden_scope — which is deliberate: a key minted for a nightly report has no business spending model quota.