Set it up
1
Configure ChatCLI
2
Start the gateway
3
Send a message
202 Accepted at once; the progress and the reply arrive at your callback URL.Environment variables
The request
POST to CHATCLI_WEBHOOK_PATH with Content-Type: application/json and the X-ChatCLI-Secret header:
The request body is limited to the audio size cap plus 1 MB, about 21 MB with the default
CHATCLI_GATEWAY_MAX_AUDIO_BYTES.
The callbacks
For each message the gateway posts JSON toCHATCLI_WEBHOOK_CALLBACK_URL, with Content-Type: application/json and the same X-ChatCLI-Secret header so your endpoint can check where it came from:
image_b64, and image_mime and image_filename when they are known.
A single message can produce several callbacks with this same shape: the “working on it” notice, progress updates while the agent works, and the final reply. There is no field telling them apart; the final reply is the last one. Any 2xx answer from your endpoint counts as delivered.
Security
- Keep the secret long and random, and serve the endpoint over HTTPS when it is reachable from other machines.
audio_urlandimage_urlare downloaded by the gateway itself, so whoever holds the secret can make the gateway fetch a URL from its own network.- Each message runs the agent with its tools and shell, without confirmations. Harden it with security mode.
Limits
- A reply is cut at 3500 characters and ends with
…. - Only text and images are posted back; voice replies are not sent on this channel.
See also
Chat gateway
How messages run, voice, images, continuity and the other channels.
Proactive messaging
Let the agent post to your callback on its own with
@send.