/api/agents/chatno authChat with an agent
The core endpoint — the same one the hosted site and the embed widget use. It answers in the visitor’s language, remembers them between calls, and returns the facts it captured so you can act on them.
Try it
curl -X POST "https://storkie.ai/api/agents/chat" \
-H "Content-Type: application/json" \
-d '{"id":"YOUR_AGENT_ID","message":"What do you do?"}'No Run button: every call bills the agent’s owner, and a button on a public page would let anyone spend a stranger’s credits.
Request body
| Name | Type | Description |
|---|---|---|
idrequired | string | The agent ID. |
messagerequired | string | The message, up to 1000 characters. Optional only when `image` is set. |
image | string | A data URL (`data:image/…;base64,…`) for vision. Roughly 1 MB max. |
anonSessionId | string | Returned by a previous call. Send it back to continue the same conversation for a visitor with no account. |
section | string | Which part of the site the question came from — one of `features`, `data`, `pricing`, `faq`. Anything else is ignored. |
Response
| Name | Type | Description |
|---|---|---|
replyrequired | string | The agent’s message. |
cards | array | Result cards: `{ title, subtitle, tag, image?, href? }`. |
captured | object | Facts learned this turn, as `{ field: value }`. |
vibe | string | Detected tone, e.g. `open`, `decisive`, `overwhelmed`. |
action | object | An action the agent performed: `{ type, label, data }`. |
anonSessionId | string | Present ONLY when one was minted. Store it and send it back next time. |
Worth knowing
- Conversation history is NOT a request parameter. The server rebuilds it from its own store for the identity making the call — a client-supplied transcript is forgeable on a public agent page, which made it a prompt-injection vector. Send `anonSessionId` back instead and memory works by itself.
- Captured facts are likewise never accepted from the client; they would let a visitor write arbitrary "facts" into the owner’s CRM.
- Every message is billed to the AGENT OWNER, not the caller.
Rate limit
20 requests / minute / IP
Errors
400— Missing `id`, or neither `message` nor `image`.402— The owner is out of credits (`code: "INSUFFICIENT_CREDITS"`).404— No such agent.413— The image is too large.429— Rate limited.
Questions
How do I keep conversation context?
You do not send it. The server rebuilds the conversation for the identity making the call. If a reply includes an anonSessionId, store it and send it back — that is what links the calls together.
Why can I not send the transcript myself?
It was accepted once and was withdrawn: a public agent page makes a client-supplied transcript forgeable, which made it a prompt-injection vector. The same applies to captured facts, which let a visitor write anything into the owner’s CRM.
Who pays for a message?
The agent owner, in credits. That is why there is no Run button on this page.
Do I need an API key?
No. This endpoint is public and rate limited by IP, which is how the embed widget works with no credentials.
What language does it answer in?
The visitor’s. It is detected from the message, not configured.