Skip to main content

boxxkite-client

PyPI

A Python client for a hosted boxxkite control-plane — create sandboxes, run commands, edit files, over HTTP. Not the boxxkite package itself (boxxkite-sandbox, which embeds SandboxManager against your own Kubernetes cluster) — use this to talk to someone else's running control-plane, hosted or self-hosted, over its API.

Install

pip install boxxkite-client
pip install boxxkite-client[langchain]  # for create_sandbox_tools

Quickstart

from boxxkite_client import BoxxkiteClient

client = BoxxkiteClient(base_url="https://your-control-plane.example.com", api_key="bxk_live_...")

with client.sandbox(label="demo") as sb:
    result = sb.exec("python3 -c 'print(1 + 1)'")
    print(result["stdout"])  # "2\n"

    sb.file_create("notes.txt", "hello from boxxkite-client\n")
    print(sb.view("notes.txt")["content"])
# sandbox is destroyed automatically here, even if an exception was raised above

Also available: AsyncBoxxkiteClient (same shapes, async/await), file/directory search (ls/glob/grep), long-running background processes (start_process/get_process_output/stop_process), signed preview URLs for exposing a port, an audit-log feed (get_log/watch), interactive human takeover over a raw WebSocket, desktop (GUI) takeover over the same raw-WebSocket pattern, secret management (create_secret/list_secrets/delete_secret, for use via create_sandbox(secret_names=[...])), filesystem snapshot management (create_snapshot/list_snapshots/get_snapshot/restore_snapshot/ delete_snapshot), and a create_sandbox_tools() LangChain factory. Full reference with examples for all of these: docs/API.md.

Error handling

Every non-2xx response raises BoxxkiteApiError (.status_code, .code, .message). A network-level failure raises BoxxkiteConnectionError. Both subclass BoxxkiteError.

from boxxkite_client import BoxxkiteApiError

try:
    client.exec(sandbox["id"], "echo hi")
except BoxxkiteApiError as exc:
    if exc.code == "concurrent_sandbox_limit_reached":
        ...  # back off, destroy an old session, etc.

Retries

Automatic retry is off by default. Pass a RetryConfig to enable it; RetryConfig() carries sensible defaults (2 retries, exponential backoff with full jitter, Retry-After honored):

from boxxkite_client import BoxxkiteClient, RetryConfig

client = BoxxkiteClient(base_url="...", api_key="...", retry=RetryConfig())

Only idempotent verbs (GET/HEAD/PUT/DELETE/OPTIONS) are retried, and only on a connection failure or a transient status (429, 500, 502, 503, 504) — a non-idempotent POST (create-sandbox/secret/webhook) is never retried, so this can't double-create a resource. AsyncBoxxkiteClient takes the same retry= argument and awaits its backoff. Every field of RetryConfig is tunable if the defaults don't fit.

Development

pip install -e ".[dev,langchain]"
pytest tests/

Tests mock the control-plane with httpx.MockTransport — no real deployment needed.

Related tools

Moving an in-progress local Claude Code/Codex CLI/opencode/Cursor session (full conversation history, not just a diff) into a fresh boxxkite sandbox is handled by boxxkite handoff <tool>, part of the main boxxkite CLI and built on this SDK — see ../docs/handoff-adapters.md.

See the root README for what boxxkite is and the full self-hosting story.

Questions, bug reports, or need a usage-limit bump? Join the Discord.

Metadata

Release files for boxxkite-client 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boxxkite-client 0.6.0
File Size Uploaded
boxxkite_client-0.6.0.tar.gz 43.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for boxxkite-client 0.6.0
File Interpreter ABI Platform
boxxkite_client-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.6 kB

Release files / boxxkite_client-0.6.0.tar.gz

Download URL boxxkite_client-0.6.0.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6bdece0b38816056ccae53ca9d0ff8b9233770df88ac5b453bf0b19891b56840
BLAKE2b-256 checksum
How to use checksums
896890eb07b9aff35d2ed319a2a2d438dd6fcdcb0e16ecdde9fb1b9741f105b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / boxxkite_client-0.6.0-py3-none-any.whl

Download URL boxxkite_client-0.6.0-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5134799e16bfc829404424e7dd1c0cc4f624e888f8b4ac2e24e4662b50aaae5d
BLAKE2b-256 checksum
How to use checksums
e684a66d4eaf6b5299fb7e6cbfc427f1421e615861674c150dae03fc4c3dfc39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

0.8.0

2 release files

0.7.0

2 release files

This release

0.6.0 This release

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page