Create a Session
curl -X POST "https://api.driver.dev/v1/browser/session" \
-H "Authorization: Bearer $DRIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"hosted"}'
import os
import requests
resp = requests.post(
"https://api.driver.dev/v1/browser/session",
headers={
"Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}",
"Content-Type": "application/json",
},
json={"type": "hosted"},
)
resp.raise_for_status()
session = resp.json()
print(session["sessionId"], session["cdpUrl"])
import BrowsercashSDK from "@browsercash/sdk";
const client = new BrowsercashSDK({
apiKey: process.env.DRIVER_API_KEY!,
baseURL: "https://api.driver.dev",
});
const session = await client.browser.session.create({ type: "hosted" });
console.log(session.sessionId, session.cdpUrl);
Response
{
"sessionId": "example-session-id",
"status": "active",
"servedBy": "node-id",
"createdAt": "2026-06-10T01:15:17.157Z",
"stoppedAt": null,
"cdpUrl": "wss://...",
"note": null
}
Session Options
| Parameter | Type | Description |
|---|---|---|
type | string | Use hosted. |
country | string | Two-letter ISO country code, such as US. |
nodeId | string | Create the session on a specific previously used hosted node. Overrides country. |
duration | integer | Session duration in seconds. Must be greater than 60 and no more than 3600. |
windowSize | string | Initial browser dimensions as WIDTHxHEIGHT, such as 1920x1080. |
proxyUrl | string | SOCKS5 proxy URL for the session. Cannot be used with nodeId. |
profile | object | Browser profile: { "name": "...", "persist": true }. |
fast | boolean | Attempts faster startup when the request is eligible. |
captchaSolver | boolean | Enables the built-in CAPTCHA solver for the session. |
extensionIds | string[] | Chrome extension IDs to load. Requires extension access for your account. |
Session notes are updated with
PATCH /v1/browser/session?sessionId=.... Do not rely on note during create; current create responses return note: null.Example with Options
curl -X POST "https://api.driver.dev/v1/browser/session" \
-H "Authorization: Bearer $DRIVER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"country": "US",
"type": "hosted",
"duration": 600,
"windowSize": "1920x1080",
"profile": {
"name": "my-profile",
"persist": true
}
}'
resp = requests.post(
"https://api.driver.dev/v1/browser/session",
headers={
"Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}",
"Content-Type": "application/json",
},
json={
"country": "US",
"type": "hosted",
"duration": 600,
"windowSize": "1920x1080",
"profile": {
"name": "my-profile",
"persist": True,
},
},
)
const session = await client.browser.session.create({
country: "US",
type: "hosted",
duration: 600,
windowSize: "1920x1080",
profile: {
name: "my-profile",
persist: true,
},
});