boxxkite-client
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/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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boxxkite_client-0.3.0.tar.gz.
File metadata
- Download URL: boxxkite_client-0.3.0.tar.gz
- Upload date:
- Size: 41.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abd7fb33c40d3335b63dc740c3d397b61fedd91d69b2fe01b39c38ac385c3cc9
|
|
| MD5 |
bc171d71b9b5991d5149f1aa5d687315
|
|
| BLAKE2b-256 |
fe5e8079795482e686d3cff43464ae9257eecf3db2d567d1c9bcd73a62e9b422
|
File details
Details for the file boxxkite_client-0.3.0-py3-none-any.whl.
File metadata
- Download URL: boxxkite_client-0.3.0-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8511a15754b6840ddbabdd1c80c51523d7c915f4c863b5185007e09c16f9a14f
|
|
| MD5 |
9b983fd4181b5464bbaf677f7e8a53c1
|
|
| BLAKE2b-256 |
649508447f83d39657106f79ff5a7ec5dbc89b5657d3cb5ffe87fe3fb06c7bca
|