kosa8 docs Dashboard
esc
↑ ↓ move↵ openRuns in your browser; nothing you type is sent anywhere.

Guides / kosa8 Cloud

kosa8 Cloud

The same sealed sandboxes, running on kosa8's hosts instead of your own machine. Nothing to install: sign in at app.kosa8.com, make an API key, and create a sandbox from code in about a second.

Create your account#

Open app.kosa8.com. Under New to kosa8 Cloud? enter your email and a password (any address works, Gmail included; a team or company name is optional), and press Create account. From then on you sign in with that email and password; Email me a link to set it on the sign-in page resets a forgotten one.

You also get the organization's first admin API key (it starts k8c_live_). It is shown once, so put it in your password manager before you continue.

Start free, then pick a plan#

A new organization starts on the free Starter tier, no card, once the sign-up email is confirmed: $10 of usage, 2 sandboxes running at once, each up to 2 vCPU and 4 GB, 60-minute sessions, no time limit, with outbound network limited to an allow-list (package registries, GitHub, Hugging Face, model APIs). It stops hard at its limit (402 starter_limit, 429 at the running limit) and never sends a bill. For more, go to Billing and pick Solo, Pro, Team or Scale, monthly or yearly; checkout is through Polar (enter the 6-digit code we emailed first: checkout waits for a confirmed address). Each plan includes Cloud sandbox-hours each month and sets its limits (compare them); use above the included hours is metered per second up to a spend cap you set, on by default at $50, with alerts at 50, 75 and 100%. A new account runs at most $50 a month above its plan until 30 days after its first payment. A failed renewal pauses new work at once, with no grace (402 payment_failed), until it is paid; running work and data are kept. Organizations made before 16 November 2026 keep working as they are until 1 December 2026, then need a plan for new work.

Make an API key for your code#

In API keys, create a key for each app or agent, so you can revoke one without the others. The SDKs read it from KOSA8_API_KEY:

$ export KOSA8_API_KEY=k8c_live_…

From the terminal, kosa8 login signs this machine in without copying a key: it shows a short code, you confirm it in your browser, and the key it makes is kept in ~/.kosa8/cloud.json for the kosa8 cloud commands and the desktop app. kosa8 whoami shows which account and organization are signed in.

$ kosa8 login

Create a sandbox and run something#

Python (pip install kosa8):

from kosa8 import Kosa8Cloud

cloud = Kosa8Cloud()  # reads KOSA8_API_KEY

box = cloud.sandboxes.create(template="python", sleep_after_s=600)
r = box.exec(["python3", "-c", "print(6 * 7)"])
print(r.exit_code, r.stdout)    # 0 42
box.sleep()                     # costs only snapshot storage while asleep
box.exec("ls /workspace")       # wakes it, files and all
box.delete()

JavaScript and TypeScript (npm install @kosa8/sdk):

import { Kosa8Cloud } from '@kosa8/sdk';

const cloud = new Kosa8Cloud(); // reads KOSA8_API_KEY

const box = await cloud.sandboxes.create({ template: 'python' });
const r = await box.exec(['python3', '-c', 'print(6 * 7)']);
console.log(r.exitCode, r.stdout); // 0 "42\n"
await box.delete();

Go, Ruby and Java have the same Cloud client under their own names: Go's kosa8.NewCloud(kosa8.CloudOptions{}), Ruby's Kosa8::Cloud.new and Java's Kosa8Cloud (Maven com.kosa8:kosa8:0.6.0). Python and JavaScript are at 0.7.0, Go at v0.6.1, Ruby and Java at 0.6.0; see the SDKs. The Cloud clients create, list, run commands in, sleep, wake and delete sandboxes, and they checkpoint, rewind, fork and move files too (POST /v1/sandboxes/{id}/checkpoints, /rewind, /fork and /files). On kosa8 Cloud a sandbox keeps up to 10 checkpoints, forks up to 1,000 copies a call (100 at a time on the sandbox's host, the rest on other hosts when there are any; see fork); files stream at any size (100 MB a request through the API; send parts with offset=, or use the direct files_url).

Plain HTTP#

The API is at https://api.kosa8.com. Send the key as a bearer token:

curl -s -X POST https://api.kosa8.com/v1/sandboxes \
  -H "Authorization: Bearer $KOSA8_API_KEY" -H 'Content-Type: application/json' \
  -d '{"template":"python"}'
# {"sandbox":{"id":"sbx_…","state":"running","template":"python","region":"us-ash1",…}}

curl -s -X POST https://api.kosa8.com/v1/sandboxes/sbx_…/exec \
  -H "Authorization: Bearer $KOSA8_API_KEY" -H 'Content-Type: application/json' \
  -d '{"cmd":["python3","-c","print(6 * 7)"]}'
# {"exit":0,"stdout":"42\n","stderr":"",…}

curl -s -X DELETE https://api.kosa8.com/v1/sandboxes/sbx_… \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Each exec in the template's image, streamed or not, runs in the sandbox's long-lived exec container on the sandbox's disk: files under /workspace persist between commands, and later commands see the same /tmp and the processes earlier ones left running. That container is not guaranteed: if it has to be replaced, or an exec names another image, the command runs in a fresh container that shares only /workspace (a persistent sandbox never does). An exec answered as one JSON object runs at most 90 seconds; past that the command is stopped and the answer is 504 exec_timeout. For longer commands (installs, test suites, builds) add "stream": true: the answer is NDJSON lines as the command prints ({"stream":"stdout","data":"<base64>"}, then {"done":true,"exit":0}), and it is not held to the 90-second limit. While the command prints nothing, an empty stdout frame with "heartbeat":true arrives every 15 seconds, so a silent build or benchmark step keeps its connection; skip those frames.

An exec answered as one JSON object keeps the first and the last 1 MiB of each of stdout and stderr. When a stream was longer, its middle is replaced by a line [k8agent: N bytes of output dropped] and the answer says so: "stdout_truncated":true (or stderr_truncated), with stdout_bytes and stderr_bytes, what the command printed in all. A streamed exec is never cut; for big output stream it, or write it to a file and download that.

Three more create and exec fields are in Snapshots, background commands and env: "env":{…} at create sets variables for every command, "background":true on an exec answers 202 at once and leaves the command running (its output read later from GET /v1/sandboxes/{id}/exec/{exec_id}), and POST /v1/sandboxes/{id}/snapshots saves a snapshot that outlives the sandbox, to create new ones from with {"snapshot":"snap_…"}.

Persistent sandboxes#

For agents, CI jobs and anything that sets a machine up in several steps, create the sandbox with "persistent": true. Every command, streamed or not, then runs in one long-lived container: packages from apt-get or apk, $HOME, /var/lib and the rest of the filesystem stay between commands, and a process started in the background keeps running after the command returns, until you delete the sandbox. While one runs, the sandbox does not go to sleep.

curl -s -X POST https://api.kosa8.com/v1/sandboxes \
  -H "Authorization: Bearer $KOSA8_API_KEY" -H 'Content-Type: application/json' \
  -d '{"template":"node","persistent":true}'

# install once, use later
-d '{"cmd":["sh","-c","apk add --no-cache jq && jq --version"]}'
# start a server in the background; the exec returns at once
-d '{"cmd":["sh","-c","nohup node server.js >/tmp/server.log 2>&1 &"]}'
# a later command still sees it
-d '{"cmd":["sh","-c","wget -qO- localhost:3000"]}'

A persistent sandbox's commands take no image: they all run in its own. If a command kills the container itself, the next command starts it again from the image; /workspace is kept, the rest starts over.

Sizes, images and disk#

A template's sandboxes are small (1 vCPU) and start warm. For bigger work, name a size, an OCI image and a disk_gb at create:

curl -s -X POST https://api.kosa8.com/v1/sandboxes \
  -H "Authorization: Bearer $KOSA8_API_KEY" -H 'Content-Type: application/json' \
  -d '{"size":"4x8","image":"debian:13-slim","disk_gb":40,"persistent":true,"name":"build-1"}'
# 202 {"sandbox":{"id":"sbx_…","state":"creating","cpus":4,"mem_mb":8192,"disk_gb":40,…}}

Sizes are 0.25x0.5, 0.5x1, 1x2, 2x4, 4x8, 8x16 and 16x32 (vCPU x GiB). The three small sizes are for fleets of mostly idle sandboxes (RL rollouts, evals): the guest has one whole vCPU (two for 1x2), of which 0.25, 0.5 or 1 is reserved and billed, and it bursts to the whole vCPU while the host has idle CPU, unbilled. They keep fork, checkpoints, sleep and persistence, and start warm from their own pools. Unless the size and image match a pool a host keeps warm (then it is 201 running at once; see warm sized starts), the sandbox boots cold, so the answer is 202 with "state":"creating": poll GET /v1/sandboxes/{id} until it says running (a command sent sooner gets 409 starting). A small image is up in seconds; a large one is pulled on its first boot and can take a few minutes. The disk holds / and /workspace (8 to 200 GB, default 32). It counts against the plan's sandbox-hours by its vCPUs, from when it is up. Each host keeps a quarter of its CPUs for small sandboxes, so it runs at most 24 vCPUs of sized ones (six 4x8); past that a create answers 503 no_capacity. GET /v1/sandboxes?name=build-1 finds a sandbox by its name.

git. The python and node templates have git (and bash). The base template is plain Alpine without it: add it with apk add --no-cache git in a persistent sandbox, use the python or node template, or create from an image that has it (Debian and Ubuntu based CI and toolchain images usually do, for example ghcr.io/starslingdev/sandbox-benchmarks-toolchain:v8).

Dedicated cores#

Add "cpu":"dedicated" to a sized create and every vCPU is a whole physical core of its own: pinned to the core, its second hardware thread left idle rather than given to another sandbox, on the host's fastest cores, with the guest seeing N cores of one thread and its memory on 2 MiB hugepages. It is for work whose timing matters, such as benchmarks and latency-sensitive builds.

curl -s -X POST https://api.kosa8.com/v1/sandboxes \
  -H "Authorization: Bearer $KOSA8_API_KEY" -H 'Content-Type: application/json' \
  -d '{"size":"4x8","cpu":"dedicated","image":"debian:13-slim"}'
# 501 {"error":"not_available","message":"dedicated cores are not offered yet; …",…}

A host has only a few cores to give this way, so when none are free the create answers 503 no_capacity instead of sharing them. A dedicated sandbox never sleeps and cannot be checkpointed, rewound or forked (409 dedicated); delete it when you are done. Dedicated cores are not offered yet: until they are, the create answers 501 not_available.

Other routes: GET /v1/sandboxes (newest first, at most 500 a page: pass limit, and follow next_cursor as cursor until it is null), GET /v1/sandboxes/{id}, POST /v1/sandboxes/{id}/sleep and /wake. Errors are JSON with a stable code. The ones that stop a create, a wake or a command, and what to do:

AnswerMeansNext step
402 plan_requiredThe organization has no plan yet.In app.kosa8.com, Billing → pick a plan.
402 plan_limitA limit of the plan is reached: sandbox-hours this month, sandboxes running at once, the largest size, persistent sandboxes or snapshots kept. The body names it (limit_name, limit, used) and the plan that includes more (next_plan). For sandbox-hours and sandboxes running at once, options lists both ways past it, cheapest monthly cost first: an add-on pack and the next plan up (kind, label, monthly_usd, url), with pack_url.Free one up (sleep or delete a sandbox, delete a snapshot), wait for next month's hours, add a pack, or upgrade in Billing.
402 plan_featureThe feature is on a higher plan (feature, next_plan).Upgrade in Billing.
402 payment_requiredA renewal failed or a charge was declined.Update the card in Billing → Manage billing.
402 spending_cap_reachedThis month's spend reached the cap an owner set. The cap is optional and off by default.Raise or clear the cap in Settings.
423 org_frozenAn owner or admin froze the organization in the Security Center.An owner or admin unfreezes it there. Reads, deletes and sleeps still work.
429 quota_exceededThe organization reached a running limit kosa8 set for it (its own max_running), or, before plan limits apply, the default limit of sandboxes running or paused (sleeping ones do not count, but waking one counts it again).Delete or sleep one, or write to contact@kosa8.com for a higher limit.
503 no_capacityThe hosts are full right now. kosa8 adds hosts when it needs them; this is not a plan limit.Wait the Retry-After seconds and try again. Do not upgrade for it.
503 database_busykosa8 Cloud's database was overloaded and the call did not finish. The body says retryable: true and retry_after (seconds), as does the Retry-After header.Wait that long and send it again. The SDKs and the CLI do this for calls that are safe to repeat (GET, PUT, DELETE, and creates with an Idempotency-Key); check before you repeat a command.
504 exec_timeoutA command without stream ran past 90 seconds and was stopped.Run it again with "stream": true, or split it into shorter commands.

Every 402 carries upgrade_url and agent_message, a sentence an AI agent relays to its person word for word. The SDKs raise these as their payment-required (402) and rate-limit (429) errors, for example Python's Kosa8PaymentRequiredError and Kosa8RateLimitError.

Overflow capacity#

When kosa8's own hosts have no room, a plain create may run on kosa8's overflow capacity (Cloudflare Containers) instead of answering 503. It is the same API, at the same price as the size you asked for. The sandbox's region reads cf-auto. It runs the base, python and node templates (or the alpine, python:3.12-alpine and node:22-alpine images) at up to 4 vCPUs and 12 GiB, from the plain Alpine images: there the python and node templates have no bash, git or pytest, with exec (buffered and streamed), files and timeout_s. It is the first choice for a small size only while no kosa8 host offers that size.

What is the same there: create, delete, exec (buffered and streamed, with timeout_s), background commands (start, status, stop and timeout_s), files at any path, env at create, sizes up to 4 vCPUs and 12 GiB, and billing. A hosted job's rollouts may run there too: the solver as a background command, and the grader in the solved sandbox itself after every other process in it is ended, under a seal that refuses every network socket (in place of a sealed fork).

What differs on overflow capacity:

  • There is no fork, checkpoints, rewind, snapshots, sleep and wake, file links, ports, previews, terminal, metrics, logs or POST /v1/sandboxes/{id}/grade (it needs a fork). Those calls answer 501 not_available, saying why.
  • It never sleeps. A sandbox with no call and no command running for 3 minutes is ended, and its files are not kept; GET /v1/sandboxes/{id} says so in last_error. A running background command counts as work. Keep work that must survive on a kosa8 host.
  • Small sizes get their reserved CPU share and no burst: 0.25x0.5 runs at a quarter of a vCPU, where a kosa8 host lets it burst to a whole one. Memory is Cloudflare's next instance size up (at least what you asked for).
  • The whole container's filesystem lasts between commands (on a kosa8 host, only /workspace does, unless the sandbox is persistent).
  • Persistent, Docker, dedicated, GPU, secrets and egress-policy sandboxes, other images and templates (benchmark environments, desktop, universal-*, your own), a disk_gb over 20, a named region and benchmark jobs always wait for a kosa8 host.
  • Egress is capped at 5 GB per sandbox, and a sandbox lives at most 24 hours.

How much fits there. Overflow capacity is bounded by the vCPUs and memory of the Cloudflare instances its sandboxes run on, so sizes mix: each sandbox counts as the instance it gets (0.25x0.5 a basic instance, a quarter of a vCPU and 1 GiB; 0.5x1 half a vCPU and 4 GiB; 1x2 and the templates 1 vCPU and 6 GiB; 2x4 2 vCPUs and 8 GiB). It also holds at most a set number of sandboxes at once, and takes no new ones once its monthly spend limit is reached. When it is full, a create answers 503 as it would without it.

Templates and regions#

TemplateWhat is in itSize
baseAlpine Linux (the default)1 vCPU, 256 MiB
pythonPython 3.12 on Debian (python:3.12-slim) with bash, git, curl, pip, pytest and uv1 vCPU, 256 MiB
nodeNode.js 22 on Alpine with bash, git and the GNU tools1 vCPU, 384 MiB

A template creates a small sandbox of the size above; for a bigger one, name a size (see Sizes, images and disk). GET /v1/templates returns each template's current size and the regions that offer it.

What the base template has. It is plain Alpine: the shell is busybox sh, and there is no bash, python3 or git. Run commands as ["sh", "-c", "…"], not bash -c, and use the python or node template when you need those. Unless the sandbox is persistent, only /workspace persists from one exec to the next, so install into /workspace (for example pip install --target /workspace/lib), or install and use it in the same exec.

Sandboxes are kept warm, so creating one takes about a second. They run in one region today: us-ash1 (Ashburn, Virginia, US). A sandbox placed on overflow capacity reports the region cf-auto.

What it costs#

kosa8 Cloud is part of every plan. Each plan includes Cloud sandbox-hours each month: an hour of a standard 2 vCPU / 4 GB sandbox running is one sandbox-hour, and other sizes count by vCPU (a 1 vCPU sandbox, such as one from the base or python template, uses half an hour an hour; a 4 vCPU one, two). Function calls count the same way. A sleeping sandbox uses none; the next command wakes it. Hours reset each month and do not roll over; on Team and Scale they are per person and pooled. Use above the included hours is metered per second ($0.048 per vCPU-hour and $0.0154 per GiB-hour of memory) up to your spend cap, which is on by default at $50 and which you can raise or lower in Billing; alerts go out at 50, 75 and 100%. At the cap new sandboxes are refused and running work keeps going. If your first bill surprises you, write to us: we forgive a first surprise bill. The free Starter tier has no overage: it stops at its limit.

Browser sandboxes (headless Chromium over CDP) are billed per second at the browser-hour rate on the pricing page, and each browser-hour also counts as an hour of the smallest sandbox (0.25 vCPU) against the plan's sandbox-hours.

SoloProTeamScale
Sandbox-hours a month100500500 a person1,000 a person
Sandboxes running at once21025up to 1,000
Largest sandbox2 vCPU / 4 GB4 vCPU / 8 GB8 vCPU / 16 GB16 vCPU / 32 GB
Persistent sandboxes1525100
Snapshots kept5502501,000

Limits are hard: past one, new work is refused with 402 plan_limit, and a feature on a higher plan with 402 plan_feature. Upgrade any time in Billing; the new limits apply at once. Swarms, pipelines and functions come with Pro; single sign-on (OIDC), audit export and SIEM, members and roles with Team; SAML and SCIM, dedicated cores and capacity held for you with Scale. The limits apply from December 2026. Billing in the dashboard shows the month's hours and sandboxes against the plan. Plans, their prices and the yearly discount are at kosa8.com/pricing. Each plan is sold monthly or yearly.

Add-on packs#

To raise one limit without changing plan, add a pack: +100 sandbox-hours or +10 sandboxes running at once, priced on the pricing page. Packs are monthly, work on any plan and stack: a limit is the plan's plus every pack held. Add or remove them in Billing, with kosa8 cloud addons add hours_100, or through the API (GET/POST /v1/billing/addons, DELETE /v1/billing/addons/{addon}). The first pack of a kind opens a checkout; more are added to it and charged now. A removed pack stops at the end of the period it is paid for.

When the hosts are full, a create or a wake answers 503 no_capacity with a Retry-After header: kosa8 adds hosts when it needs them, so wait and retry. It is not a plan limit, and upgrading does not change it.

The dashboard#

TabFor
SandboxesWhat is running, asleep or stopped, and what each has cost.
FunctionsDeploy a handler and call it; each call runs in its own sandbox.
API keysMake and revoke keys. A leaked key: revoke it here first.
Own hostsRun sandboxes on your own servers, managed from the same dashboard: Bring your own cloud.
Team & SSOInvite people, or connect Okta, Entra ID or Google Workspace by OIDC or SAML 2.0, with SCIM 2.0 provisioning (setup).
Settings / UsageDefault template and region, sleep timer, spending cap, the bill.
Affiliate programApply for 20% of the payments of the teams you bring, for 12 months (referrals have closed); see Affiliate program.

Connect agents and tools#

  • MCP server: give Claude Code, Cursor or Codex cloud sandboxes with one command, claude mcp add --transport http --scope user kosa8-cloud https://api.kosa8.com/mcp --header "Authorization: Bearer $KOSA8_API_KEY", or kosa8 cloud mcp.
  • OpenAPI and llms.txt: the API described for code generators and AI agents.
  • GitHub Action: run a command in a sandbox from a workflow.
  • Browser sandboxes: a headless Chromium your agent drives with Playwright or Puppeteer over CDP, or through the MCP browser_* tools.
  • AI Gateway (early access): model calls through kosa8 and Cloudflare AI Gateway, with provider keys that never enter the sandbox and spend per sandbox.
  • Webhook recipes: verify deliveries and forward failures and the spending cap to Slack. Plan events (plan.purchased, plan.changed, plan_limit.near, plan_limit.reached, plan_feature.blocked, hours.reset, capacity.unavailable and the rest) are listed under Webhook events for plans; each is also an audit-log entry.

Cloud or your own machine?#

kosa8 on your own computer (Install) is the same sandbox with no network hop and nothing leaving the machine. Use the cloud when your code runs somewhere without kosa8 installed (a server, a CI job, a hosted agent), or when you want many sandboxes at once without a big machine of your own.

From a local command: --cloud#

When a local command asks for something this machine cannot give, add --cloud to run the same command on kosa8 Cloud. Not signed in yet, it runs kosa8 login first and then carries on.

$ kosa8 sandbox create --cloud --cpus 4 --memory 8192 --ttl 2h web
On kosa8 Cloud: kosa8 cloud sandbox create --name web --size 4x8 --ttl 2h
$ kosa8 run --cloud python:3.12-slim python3 -c 'print(1+1)'
$ kosa8 run --cloud -it alpine sh
  • kosa8 sandbox create --cloud is kosa8 cloud sandbox create with the flags translated: --cpus and --memory become the smallest Cloud size that holds them (2x4, 4x8, 8x16 or 16x32, vCPUs x GiB), --auto-stop becomes --sleep-after, --egress deny becomes --no-internet, --egress-allow becomes --allow, and the name, --template, --disk, --ttl and KEY=VALUE labels carry over. A flag Cloud has no equivalent for (--mount, --gpu, --pcap, --backend, --auto-delete, --ephemeral, --egress fakenet, a classification label) is refused by name, and nothing is created.
  • kosa8 run --cloud IMAGE COMMAND makes a cloud sandbox of IMAGE, runs the command (with -it, an interactive terminal), exits with its exit code and deletes the sandbox, as a foreground kosa8 run keeps nothing. -e carries over; -p, -d, --name and --network are refused (open a port with kosa8 cloud preview open ID PORT).
  • kosa8 Cloud has no GPUs yet, so --gpu with --cloud is refused.

At the moment a local command hits one of these limits, kosa8 prints one line after the error naming the Cloud command for it:

  • Too big: a sandbox with more CPUs or memory than this machine has, refused by the engine (up to 16 vCPUs and 32 GiB on Cloud).
  • Many at once: the engine out of room with other sandboxes already running.
  • Cannot run locally: no /dev/kvm, an Intel Mac, or a Mac without the Hypervisor framework.
  • GPU: --gpu where no GPU can be handed over (every Mac). Cloud has none either, so the line says so and where to ask for one.
  • Sharing: a local kosa8 sandbox preview link opens only on this machine; at most once a day, kosa8 names kosa8 cloud preview open for a link that works anywhere.
$ kosa8 sandbox create --cpus 12 --memory 24576 big
kosa8: invalid VM configuration: … “memorySize” is greater than “maximumAllowedMemorySize”. …
This machine has 10 CPUs and 16 GiB of memory; kosa8 Cloud runs up to 16 vCPUs and 32 GiB. Run it on kosa8 Cloud: kosa8 cloud sandbox create --name big --size 16x32 (kosa8 login first, or add --cloud to the command you ran)

The line goes to stderr, only when both stdout and stderr are a terminal. It never appears with --json, in CI (CI set), or with KOSA8_NO_UPGRADE_HINTS=1; set KOSA8_NO_CLOUD_HINTS=1 to turn off just these. A hint that is shown, and a --cloud run, is reported to kosa8 Cloud as a count (the reason, the command, OS, CPU type, version and a random install ID; never your commands, paths or email); set KOSA8_NO_TELEMETRY=1 or DO_NOT_TRACK=1 to turn that off.

Something wrong or missing? Write to contact@kosa8.com.

The kosa8 weekly

Agent security news, one industry deep-dive and a hands-on challenge, every Monday. Unsubscribe in one click.

© 2026 kosa8 · kosa8.com · Zero Trust cybersecurity infrastructure for AI agents · Local models served by llamay · Agent gateway: MAQPNA