Integration
Rust SDK
boxkite-client talks to a hosted control-plane over HTTP/WebSocket. Async-first (tokio), mirroring the same /v1/* REST API sdk-python/sdk-js wrap, with builder-pattern options structs instead of keyword arguments.
Install
Cargo.toml
[dependencies]
boxkite-client = "0.1"
tokio = { version = "1", features = ["full"] }Quickstart
main.rs
use boxkite_client::{Client, CreateSandboxOptions, ExecOptions};
#[tokio::main]
async fn main() -> Result<(), boxkite_client::BoxkiteError> {
let client = Client::new("https://your-control-plane.example.com", "bxk_live_...")?;
let sandbox = client
.create_sandbox(CreateSandboxOptions::new().label("demo"))
.await?;
let result = client
.exec(&sandbox.id, "python3 -c 'print(1 + 1)'", ExecOptions::new())
.await?;
println!("{}", result.stdout); // "2\n"
client.destroy_sandbox(&sandbox.id).await?;
Ok(())
}Client::new(base_url, api_key) covers the common case; use Client::builder() for a custom timeout or a preconfigured reqwest::Client. See Sandboxes for every field CreateSandboxOptions builds.
Every capability, from this client
- Sandboxes —
create_sandbox/create_sandbox_batch/get_sandbox/list_sandboxes/destroy_sandbox - Process & exec —
execplus process-management methods, mirroring the Python/JS shapes - File system —
file_create/view/str_replace/ls/glob/grep - Custom sandbox images — image create/get/list/delete
- Independent storage volumes — volume create/get/list/delete
- Audit log & takeover — log streaming and human-takeover over WebSocket
Error handling
Every fallible call returns Result<T, BoxkiteError> — a non-2xx response or a connection-level failure both surface through the same error type, so ? composes cleanly through a whole sandbox session.