One script creates a text agent, publishes it, starts a chat, sends a message, prints the reply and ends the chat. A text agent needs only a language-model provider key; it costs your own LLM spend plus the platform fee of $0.0001 per answered message.

Before you start

1

Get a personal access token

Dashboard: Organization → API Tokens. The value is shown once. Export it as TALQING_API_KEY. See authentication.
2

Add an OpenAI provider key

Dashboard: Build → Provider Keys. Without it, publishing fails with no OpenAI API key for this workspace - add one under Provider keys. See provider keys.

The whole script

What each call does

The same calls in cURL:

Streaming the reply

Add "stream": true and the same request answers as server-sent events: assistant.started, assistant.delta (chunks that append, not cumulative) and assistant.completed, an item.created per item, then one turn.result carrying the normal JSON body. See streaming.
cURL
To chat from a browser, your server starts the chat and mints a chat token (POST /v1/chats/{chat_id}/token), and the page uses TalqingChat from @talqing/client.

Next

Chats

Streaming, browser tokens, items and the chat lifecycle.

Tools

Give the agent something to call before it answers.