POST/api/agents/chatno auth

Chat 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

NameTypeDescription
idrequiredstringThe agent ID.
messagerequiredstringThe message, up to 1000 characters. Optional only when `image` is set.
imagestringA data URL (`data:image/…;base64,…`) for vision. Roughly 1 MB max.
anonSessionIdstringReturned by a previous call. Send it back to continue the same conversation for a visitor with no account.
sectionstringWhich part of the site the question came from — one of `features`, `data`, `pricing`, `faq`. Anything else is ignored.

Response

NameTypeDescription
replyrequiredstringThe agent’s message.
cardsarrayResult cards: `{ title, subtitle, tag, image?, href? }`.
capturedobjectFacts learned this turn, as `{ field: value }`.
vibestringDetected tone, e.g. `open`, `decisive`, `overwhelmed`.
actionobjectAn action the agent performed: `{ type, label, data }`.
anonSessionIdstringPresent 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

  • 400Missing `id`, or neither `message` nor `image`.
  • 402The owner is out of credits (`code: "INSUFFICIENT_CREDITS"`).
  • 404No such agent.
  • 413The image is too large.
  • 429Rate 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.

Other endpoints

No key needed to start

Create an agent and this endpoint works against it immediately.

Create an agent free

Agents

More

🏪
Find Providers
👤
Profile
FAQ