Create a session with top-level keepAlive:true if it should remain available after a CDP client disconnects. Keep a finite timeout and save the session ID.
curl -X POST "https://api.tooluse.net/v1/browsers/sessions" \
-H "Authorization: Bearer $TOOLUSE_API_KEY" \
-H "Idempotency-Key: tooluse-example-001" \
-H "Content-Type: application/json" \
-d '{"timeout":600,"keepAlive":true}'
After reconnecting, read the session before using a returned connection URL. An expired or ended session cannot resume. Explicitly release a keep-alive session when the work finishes:
curl -X POST "https://api.tooluse.net/v1/browsers/sessions/$SESSION_ID" \
-H "Authorization: Bearer $TOOLUSE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":"REQUEST_RELEASE"}'