How do I reconnect to a stream without missing or repeating steps?
One connection lasts up to 10 minutes, and networks drop. To resume:
- Keep a counter
after. After eachstepevent, setafter = data.index + 1. - When the connection ends without a
doneevent (atimeoutevent, an error or a dropped socket), reconnect:
curl -N "https://api.agent.clatterlabs.xyz/v1/runs/RUN_ID/events?after=12" \
-H "Authorization: Bearer $CLATTER_API_KEY" \
-H "X-Clatter-Account: $CLATTER_ACCOUNT_ID"
- Stop when you receive
done.
The docs include complete Python and JavaScript clients that do exactly this.
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.