Skip to content NewFaster GitHub Actions runners: a machine for every job in under a second.Faster GitHub Actions runnersSee how →
Developers

Use Bonya from anywhere. One API underneath.

Call the REST API from any language, script it with the bonya CLI, build on the Python, TypeScript and Go SDKs, or give it to your AI agent through the MCP server. One API key works in all of them.

REST APICLIPython, TypeScript and Go SDKsMCP server
$ brew install bonyai/tap/bonya # or $ curl -fsSL https://get.bonya.ai/install.sh | sh $ bonya login # opens your browser $ bonya create web ✓ sb-4f1c9a2b3c4d5e running · 142 ms $ bonya exec web -- uname -a Linux web 6.1 x86_64 GNU/Linux
api.bonya.aiQuickstart →
REST API

Plain HTTPS, from any language.

Every product is a JSON API at api.bonya.ai. The CLI, the SDKs, the MCP server and the console all use it, so anything they can do, you can do with an HTTP client.

  • Authenticate with a personal API key as a Bearer token
  • Send an Idempotency-Key on create calls, so a retry never creates two
  • Act for a team with the X-Bonya-Organization-ID header
  • Streaming exec and terminal sessions over WebSocket
curl
$ curl -X POST https://api.bonya.ai/v1/sandbox \ -H "Authorization: Bearer $BONYA_API_KEY" \ -H "Idempotency-Key: build-1842" \ -d '{ "name": "web", "size": "large", "image": "python:3.12-slim", "network": { "mode": "allowlist", "allow": [{ "domain": "pypi.org" }] }, "env": { "CI": "1" } }' { "id": "sb-4f1c9a2b3c4d5e", "state": "running", … }
CLI

bonya, in your terminal.

One binary for macOS and Linux. Log in once in the browser and drive sandboxes, jobs and schedules from your shell, your scripts and your CI.

  • Sandboxes, exec, files, sessions, previews, snapshots and forks
  • Jobs, cron schedules, templates and organizations
  • An interactive shell in any sandbox with bonya console
  • In CI, set BONYA_API_KEY and skip the login
brew install bonyai/tap/bonya
curl -fsSL https://get.bonya.ai/install.sh | sh
zsh · bonya
$ bonya login # opens your browser $ bonya create web $ bonya exec web --env CI=1 -- npm test $ bonya console web # interactive shell $ bonya session create web dev -- npm run dev $ bonya preview create web 3000 $ bonya snapshot create web --name green $ bonya list $ bonya delete web
MCP server

Give your AI agent a computer.

The Bonya MCP server gives any Model Context Protocol client tools for your Bonya account. Your agent creates sandboxes, runs code, writes files and sends you preview links, with no code on your side.

  • Works with Claude Code, Claude Desktop, Cursor, Windsurf, Cline, Codex CLI and Gemini CLI
  • Tools for sandboxes, exec and files, sessions, previews, snapshots, jobs and schedules, templates and secrets
  • Runs on demand with npx. Nothing to install
  • The key goes in the client's MCP settings, never in your code
npx -y @bonya-ai/bonya-mcp
// Claude Desktop, Cursor, Windsurf, Cline, … { "mcpServers": { "bonya": { "command": "npx", "args": ["-y", "@bonya-ai/bonya-mcp"], "env": { "BONYA_API_KEY": "byk_..." } } } }
Python SDK

Sandboxes from Python.

A typed, synchronous client. Context managers delete what you create, so a script never leaves a sandbox running.

  • Python 3.10 or newer, fully typed
  • Exec with live output, files, sessions, previews, snapshots and forks
  • Jobs, cron schedules, templates and secrets
  • Retries with idempotency keys built in
pip install bonya
agent.py
from bonya import Bonya with Bonya() as client: # reads BONYA_API_KEY with client.create_sandbox(image="python:3.12-slim") as sb: sb.write_file("/tmp/main.py", code) r = sb.exec(["python", "/tmp/main.py"], check=True) print(r.stdout) pv = sb.create_preview(8000, auth="public") print(pv.url) # the sandbox is deleted here
TypeScript SDK

Sandboxes from TypeScript and JavaScript.

Promise-based client for Node. Ships ESM with bundled type declarations.

  • Node 18.17 or newer
  • Exec with live output, files, sessions, previews, snapshots and forks
  • Jobs, cron schedules, templates and secrets
  • Typed errors you can catch by kind
npm install @bonya-ai/bonya
agent.ts
import { Bonya } from "@bonya-ai/bonya"; const client = new Bonya(); // reads BONYA_API_KEY const sb = await client.createSandbox({ image: "node:22-slim" }); await sb.writeFile("/tmp/index.js", code); const r = await sb.exec(["node", "/tmp/index.js"], { check: true }); console.log(r.stdout); await sb.delete(); client.close();
Go SDK

Sandboxes from Go.

An idiomatic client: every call takes a context, and options are plain structs.

  • Go 1.24 or newer
  • Exec, files, sessions, previews, snapshots, forks and keepalive
  • Jobs, cron schedules, templates, secrets and registry connections
  • Pause a sandbox warm or cold from code
go get github.com/bonyai/go-sdk
main.go
c, _ := bonya.NewClient() // reads BONYA_API_KEY sb, _ := c.Create(ctx, bonya.CreateOptions{ Name: "web", Image: "python:3.12-slim"}) res, _ := sb.Exec(ctx, "python", "-m", "pytest", "-q") fmt.Println(res.Stdout) pv, _ := sb.CreatePreview(ctx, 8000, bonya.PreviewOptions{Auth: bonya.PreviewPublic}) fmt.Println(pv.URL) sb.Pause(ctx, bonya.PauseCold) // files kept, $0 CPU
Configuration

One key, every channel.

The CLI, the SDKs and the MCP server read the same environment variables. Set them once and switch between channels freely.

About API keys
Variable
What it does
Default
BONYA_API_KEY
Your personal API key. Create one in the console. bonya login saves a key for the CLI only.
Required
BONYA_ORGANIZATION_ID
Act for a team organization instead of your own.
Your personal organization
BONYA_ENDPOINT
The API address.
https://api.bonya.ai
Coding agent

Not sure where to start?

Ask your coding agent. With the MCP server or the CLI, it can do the whole thing for you.

Create a Bonya sandbox, clone this repo into it, run the tests, start the dev server in a session, and send me a preview URL for port 3000.
MCP needs BONYA_API_KEY. The CLI also works after bonya login
FAQ

Developer questions.

Anything else, ask us directly.

Talk to our team
Which one should I use?

For an AI agent in Claude, Cursor or another MCP client, use the MCP server. For your own app, use the SDK for your language, or the REST API from anything else. For scripts, CI and trying things by hand, use the CLI.

Do the CLI, SDKs or MCP server cost anything?

No. They are free. You pay only for the compute you use, at the same rates whichever way you call it.

Can they all do the same things?

They all use the same REST API, so a sandbox created from one shows up in all the others and in the console. Each covers sandboxes, exec, files, sessions, previews, snapshots, jobs and schedules. The REST API is where new features arrive first.

My language has no SDK. Can I still use Bonya?

Yes. Call the REST API at api.bonya.ai with any HTTP client. The API reference lists every endpoint with examples.

How do I get an API key?

Create one in the console at console.bonya.ai, or run bonya login and the CLI signs you in through your browser. Keys start with byk_.

Start building on Bonya.

Free on the Solo plan. Pick a channel and run your first sandbox in minutes.