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.7.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.7.0
File Size Uploaded
boxxkite_client-0.7.0.tar.gz 46.6 kB Details

Built distribution (wheel)

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

Total release size: 75.2 kB

Release files / boxxkite_client-0.7.0.tar.gz

Download URL boxxkite_client-0.7.0.tar.gz
Size 46.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c76438e8723b48c5e06cd91779de27828d4b5ce7071f425d7b580de997c414c3
BLAKE2b-256 checksum
How to use checksums
6ffa8e6395394d42f551cc50e073a0d599b432df0b44f93c71e951119497a722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

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

Download URL boxxkite_client-0.7.0-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9769276c0cee1641bc652b889a254a2d24cd432234bf389969f95e974bbb1927
BLAKE2b-256 checksum
How to use checksums
4434e316083040e5c28ea153f69ac5c38f604f0cb85c24c3cf4972f8415bdf9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

0.8.0

2 release files

This release

0.7.0 This release

2 release files

0.6.0

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