For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
WebsiteDashboard
DocsAPI Reference
DocsAPI Reference
  • Overview
    • Introduction
    • Quickstart
    • Core Concepts
  • Sessions
    • Browser Sessions
    • Sandbox Sessions
    • Command Execution
  • Guides
    • Local Project Mode
    • Browser Automation
    • Browser Extensions
    • Remote Workspace Development
    • CI/CD Integration
    • GitHub Actions Runner
    • Persistent Workspaces
    • Agent Integration
  • Developer Tools
    • CLI Reference
    • TypeScript SDK
    • Python SDK
    • MCP Integration
    • Port Forwarding
    • File Transfer
    • SSH Access
  • Platform
    • Accounts & Teams
    • Workspaces
    • Jobs
    • Audit
    • Pricing
  • API Reference
    • REST API Overview
  • CHASM
    • Assistants
LogoLogo
WebsiteDashboard
On this page
  • Install
  • Create a client
  • Sessions
  • Command execution
  • Workspaces
  • Proxy selection
  • Files
  • Browser CDP
  • Organization context
  • Notes
Developer Tools

Python SDK

||View as Markdown|
Was this page helpful?
Edit this page
Previous

TypeScript SDK

Next

MCP Integration

Built with

The official Python SDK provides access to the Chaser API for session management, workspaces, command execution, file operations, browser CDP, accounts, billing, webhooks, audit, and jobs.

Install

$pip install chaser-sdk
$
$# Optional: CDP WebSocket support
$pip install "chaser-sdk[cdp]"

Create a client

1from chaser_sdk import ChaserClient
2
3client = ChaserClient(api_key="sk_...", account="personal")

Sessions

1# Create a sandbox session
2session = client.sessions.create(
3 session_type="sandbox",
4 workspace="my-project",
5)
6
7client.sessions.wait_until_ready(session["id"])
8
9# Create a browser session
10browser = client.sessions.create(
11 session_type="browser",
12 ephemeral=True,
13)

Keyword arguments are the preferred style. The legacy payload-dict form still works for backward compatibility.

Command execution

1# Run in an existing session
2result = client.exec.in_session(
3 session["id"],
4 command="npm ci && npm test",
5 cwd="/workspace",
6)
7
8# Auto-provisioned ephemeral sandbox
9result = client.exec.run(
10 ephemeral=True,
11 image="node:20-bookworm",
12 command="python3 -c 'print(42)'",
13)

Workspaces

1workspace = client.workspaces.create(
2 name="frontend-app",
3 session_type="sandbox",
4 image="ghcr.io/example/dev:latest",
5)

Proxy selection

1session = client.sessions.create(
2 session_type="sandbox",
3 ephemeral=True,
4 proxy="socks5h://user:pass@proxy.example.com:1080",
5)

Files

1client.files.upload_text(session["id"], "/workspace/hello.txt", "hello")
2text = client.files.download_text(session["id"], "/workspace/hello.txt")

Browser CDP

1# Get the WebSocket URL
2ws_url = client.browser.cdp_websocket_url(browser["id"])
3
4# With the cdp extra: open a connection
5cdp = client.browser.connect(browser["id"])
6print(cdp.send("Browser.getVersion"))
7cdp.close()

Organization context

1org_client = client.with_account("Acme Engineering")
2workspaces = org_client.workspaces.list()

Notes

  • The SDK is stdlib-first — basic usage requires no extra dependencies
  • pip install "chaser-sdk[cdp]" adds WebSocket CDP support
  • Use the root-level proxy field when creating proxied sessions
  • The SDK covers the core Chaser API surface. It does not include CHASM assistant management.