ChatStreamEvent.
Assemble the reply
Threading
PassthreadKey to resume a thread and history to supply prior turns explicitly:
Scoping
section scopes the turn to a page or section of the agent’s site (useful for contextual chat on a specific page). brandSlug selects among a multi-brand agent’s brands.
Rate limiting and billing
- The agent’s owner is billed for every completed turn. Your integration is spending someone else’s credits; keep that in mind before auto-firing prompts.
- Pass
client, a salted visitor hash your app mints (never a raw IP or email), to get per-visitor caps. - Without
client, the whole workspace shares a looser backstop. - A rate-limited turn returns
429. Back off and retry; do not retry-loop against it.