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=[...])), 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 session (full conversation history, not just a diff) into a fresh boxxkite sandbox is handled by the separate boxxkite-handoff CLI, built on this SDK — see ../docs/handoff-adapters.md and ../handoff-cli/README.md. Not yet published to PyPI.

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boxxkite_client-0.2.4.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

boxxkite_client-0.2.4-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file boxxkite_client-0.2.4.tar.gz.

File metadata

  • Download URL: boxxkite_client-0.2.4.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for boxxkite_client-0.2.4.tar.gz
Algorithm Hash digest
SHA256 9eb30ed376dd177c56601f7d509298bd66d6c7f2ed0445e5934da2b6dda36816
MD5 516752b88d8a0a3c724f01beb39dbcc0
BLAKE2b-256 9d8363d221b4440819cddc06145f8f821993393b0f41e04295812cccccb7002d

See more details on using hashes here.

File details

Details for the file boxxkite_client-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: boxxkite_client-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 25.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for boxxkite_client-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b62fb0b8a3c55534725c49e494f446075f9daf751ddfd3562d47c90ea32ce1fa
MD5 d043a8d1b55f17e914c11505443bddf5
BLAKE2b-256 049f7fd83d344b69b7ece86bd2b711cd1f242e631e8371d412fff72692ace2fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page