Use the sessions API to create, inspect, and close hosted browser sessions directly.
x-api-key./v1/sessions/createtimeout_seconds: optional session timeout, default 3600, max 7200start_url: optional URL opened before CDP is returnedgpu: optional boolean GPU requestviewport: optional { width, height } viewportheadless: optional boolean browser moderesidential_proxy: optional residential proxy location objectstart_url over navigating with Playwright immediately after connect. Use residential_proxy for location-sensitive sessions that need traffic to originate from a specific residential proxy country, US state, city, ZIP code, or ASN. See Residential proxy locations for the supported fields and combination rules.successsession_idstatuscdp_urllive_view_url12345678curl -X POST "https://api.libretto.sh/v1/sessions/create" \ -H "x-api-key: $LIBRETTO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "json": { "timeout_seconds": 1800 } }'
/v1/sessions/getsession_id: session id returned from sessions/createsession_idstatuscdp_urllive_view_urlsessions/create returned a queued or starting session and you need to poll for the CDP URL or live view URL./v1/sessions/closesession_id: session id returned from sessions/createsuccessmessage12345678curl -X POST "https://api.libretto.sh/v1/sessions/close" \ -H "x-api-key: $LIBRETTO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "json": { "session_id": "<session-id>" } }'