Create Session
curl --request POST \
--url https://api.example.com/v1/sessionsimport requests
url = "https://api.example.com/v1/sessions"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/sessions"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/sessions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodySessions
Create Session
Create a browser session with a CDP WebSocket endpoint
POST
/
v1
/
sessions
Create Session
curl --request POST \
--url https://api.example.com/v1/sessionsimport requests
url = "https://api.example.com/v1/sessions"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/sessions"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/sessions")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCreate a stealthed browser session. Returns a WebSocket URL for Playwright/Puppeteer connection.
Request
Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your API key |
Content-Type | Yes | application/json |
Body
| Field | Type | Default | Description |
|---|---|---|---|
maxDurationMs | number | 3600000 | Maximum session lifetime in ms (60s - 60min) |
{
"maxDurationMs": 600000
}
Response
201 Created
{
"success": true,
"data": {
"sessionId": "ses_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"wsEndpoint": "wss://api.reader.dev/v1/sessions/ses_a1b2.../cdp?token=abc123...",
"token": "abc123def456...",
"status": "active",
"createdAt": "2026-04-30T12:00:00.000Z",
"expiresAt": "2026-04-30T13:00:00.000Z"
}
}
Fields
| Field | Description |
|---|---|
sessionId | Unique session identifier |
wsEndpoint | CDP WebSocket URL - pass to chromium.connectOverCDP() |
token | Auth token embedded in wsEndpoint (for WebSocket proxy) |
status | Always "active" on creation |
createdAt | ISO 8601 timestamp |
expiresAt | When the session will auto-close |
Usage
Playwright
const session = await reader.sessions.create();
const browser = await chromium.connectOverCDP(session.wsEndpoint);
Puppeteer
const session = await reader.sessions.create();
const browser = await connect({ browserWSEndpoint: session.wsEndpoint });
Errors
| Code | Status | Description |
|---|---|---|
insufficient_credits | 402 | Not enough credits (sessions cost 1 credit/min) |
rate_limited | 429 | Too many requests |
upstream_unavailable | 502 | Browser engine unavailable |
Credits
Sessions charge 1 credit per minute, starting immediately on creation. Credits are deducted in real-time. If credits run out, the session is automatically stopped.⌘I

