Create a session
/browserbase/v1/sessions● SupportedRequest parameters
projectIdstringoptionalThe Project ID. Can be found in Settings. Optional - if not provided, the project will be inferred from the API key.
extensionIdstringoptional○ UnsupportedThis configuration is unavailable.
browserSettingsobjectoptionalExpand sub-fields (14)
contextobjectoptionalExpand sub-fields (2)
idstringrequiredThe Context ID.
persistbooleanoptionalWhether or not to persist the context after browsing. Defaults to
false.
extensionIdstringoptional○ UnsupportedThis configuration is unavailable.
viewportobjectoptionalExpand sub-fields (2)
widthintegeroptionalThe width of the browser.
heightintegeroptionalThe height of the browser.
blockAdsbooleanoptional◐ Partially supportedAccepted but ignored; does not enable this capability.
solveCaptchasbooleanoptional◐ Partially supportedAccepted but ignored; does not enable this capability.
recordSessionbooleanoptional◐ Partially supportedAccepted but ignored; does not enable this capability.
logSessionbooleanoptional◐ Partially supportedAccepted but ignored; does not enable this capability.
advancedStealthbooleanoptional○ UnsupportedThis configuration is unavailable.
verifiedbooleanoptional○ UnsupportedThis configuration is unavailable.
captchaImageSelectorstringoptionalCustom selector for captcha image. See Custom Captcha Solving
captchaInputSelectorstringoptionalCustom selector for captcha input. See Custom Captcha Solving
osstringoptional○ UnsupportedThis configuration is unavailable.
allowedDomainsarrayoptional○ UnsupportedThis configuration is unavailable.
ignoreCertificateErrorsbooleanoptional○ UnsupportedThis configuration is unavailable.
timeoutintegeroptionalDuration in seconds after which the session will automatically end. Defaults to the Project's
defaultTimeout. Minimum 60 seconds, maximum 21600 seconds (6 hours).keepAlivebooleanoptionalSet to true to keep the session alive even after disconnections. Available on the Hobby Plan and above.
proxiesunionoptional◐ Partially supportedOmission, false or [{type: 'none'}] uses the default exit. One {type: 'external', server, username?, password? | password_secret?} exits through your HTTP proxy and needs the capability opened for your organization (otherwise 501 PROVIDER_UNSUPPORTED). Other types, socks5 or several entries return 501; missing fields, internal addresses and use with BYOB return 400 INVALID_PARAMS. See /developers/browser/proxies.
proxySettingsobjectoptionalSupplementary proxy settings. Optional.
Expand sub-fields (1)
caCertificatesarrayoptionalThe TLS certificate IDs to trust. Optional.
regionstringoptional◐ Partially supportedAccepted but ignored; does not enable this capability.
userMetadataobjectoptionalArbitrary user metadata to attach to the session. To learn more about user metadata, see User Metadata.
Returns
201
Only the capabilities in the service guide are available; some upstream options are unavailable.
Errors contain statusCode, error and message; the native API adds code. The request ID is in X-Request-Id. Errors
Request example
curl
curl -X POST "https://api.deepraxis.com/browserbase/v1/sessions" \
-H "X-BB-API-Key: $PRAXIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"timeout":300}'Python
import os, requests
response = requests.request("POST", f"https://api.deepraxis.com/browserbase/v1/sessions",
headers={"X-BB-API-Key": os.environ["PRAXIS_API_KEY"]},
json={"timeout":300}
)
print(response.status_code, response.text)TypeScript
const response = await fetch(`https://api.deepraxis.com/browserbase/v1/sessions`, {
method: "POST",
headers: { "X-BB-API-Key": `${process.env.PRAXIS_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({"timeout":300}),
});
console.log(response.status, await response.text());Stealth options, extensions and Selenium are unavailable; proxies accept only the external type and need the capability opened for your organization. region and solveCaptchas are accepted but ignored; region selection and CAPTCHA solving are not provided.
Response
HTTP 201
The request has succeeded and a new resource has been created as a result.
application/json
| Name | Type | Description |
|---|---|---|
| id | string | |
| createdAt | string | |
| updatedAt | string | |
| projectId | string | The Project ID linked to the Session. |
| startedAt | string | |
| endedAt | string | |
| expiresAt | string | |
| status | string | |
| proxyBytes | integer | Bytes used via the Proxy |
| keepAlive | boolean | Indicates if the Session was created to be kept alive upon disconnections |
| contextId | string | Optional. The Context linked to the Session. |
| region | string | The region where the Session is running. |
| userMetadata | object | Arbitrary user metadata to attach to the session. To learn more about user metadata, see User Metadata. |
| connectUrl | string | WebSocket URL to connect to the Session. |
| seleniumRemoteUrl | string | HTTP URL to connect to the Session. |
| signingKey | string | Signing key to use when connecting to the Session via HTTP. |