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 objectdisable_default_proxy: optional boolean; Kernel only. Disables Kernel's default residential stealth proxy so traffic uses direct egress. Mutually exclusive with residential_proxy.start_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.disable_default_proxy when the default managed proxy cannot reach the target (for example ERR_TUNNEL_CONNECTION_FAILED). It cannot be combined with residential_proxy. When both start_url and disable_default_proxy are set, Libretto Cloud still opens start_url after switching to direct egress, so clients should treat the start URL as preloaded.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>" } }'