Skip to content
中文

Create a session

POST/browserbase/v1/sessions● Supported

Browserbase

Request parameters

  • projectIdstringoptional

    The Project ID. Can be found in Settings. Optional - if not provided, the project will be inferred from the API key.

  • extensionIdstringoptional○ Unsupported

    This configuration is unavailable.

  • browserSettingsobjectoptional
    Expand sub-fields (14)
    • contextobjectoptional
      Expand sub-fields (2)
      • idstringrequired

        The Context ID.

      • persistbooleanoptional

        Whether or not to persist the context after browsing. Defaults to false.

    • extensionIdstringoptional○ Unsupported

      This configuration is unavailable.

    • viewportobjectoptional
      Expand sub-fields (2)
      • widthintegeroptional

        The width of the browser.

      • heightintegeroptional

        The height of the browser.

    • blockAdsbooleanoptional◐ Partially supported

      Accepted but ignored; does not enable this capability.

    • solveCaptchasbooleanoptional◐ Partially supported

      Accepted but ignored; does not enable this capability.

    • recordSessionbooleanoptional◐ Partially supported

      Accepted but ignored; does not enable this capability.

    • logSessionbooleanoptional◐ Partially supported

      Accepted but ignored; does not enable this capability.

    • advancedStealthbooleanoptional○ Unsupported

      This configuration is unavailable.

    • verifiedbooleanoptional○ Unsupported

      This configuration is unavailable.

    • captchaImageSelectorstringoptional

      Custom selector for captcha image. See Custom Captcha Solving

    • captchaInputSelectorstringoptional

      Custom selector for captcha input. See Custom Captcha Solving

    • osstringoptional○ Unsupported

      This configuration is unavailable.

      values windowsmaclinuxmobiletablet
    • allowedDomainsarrayoptional○ Unsupported
      default []

      This configuration is unavailable.

    • ignoreCertificateErrorsbooleanoptional○ Unsupported

      This configuration is unavailable.

  • timeoutintegeroptional

    Duration in seconds after which the session will automatically end. Defaults to the Project's defaultTimeout. Minimum 60 seconds, maximum 21600 seconds (6 hours).

  • keepAlivebooleanoptional

    Set to true to keep the session alive even after disconnections. Available on the Hobby Plan and above.

  • proxiesunionoptional◐ Partially supported

    Omission, 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.

  • proxySettingsobjectoptional

    Supplementary proxy settings. Optional.

    Expand sub-fields (1)
    • caCertificatesarrayoptional
      default []

      The TLS certificate IDs to trust. Optional.

  • regionstringoptional◐ Partially supported
    default "us-west-2"

    Accepted but ignored; does not enable this capability.

    values us-west-2us-east-1eu-central-1ap-southeast-1
  • userMetadataobjectoptional

    Arbitrary 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());

Connection guide

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.