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

HTTP API

HTTP API reference

282 endpoints, one base URL, one header. The SDKs, the CLI and the dashboard all go through this API, so anything they do, you can do with curl.

kosa8 run --cloud python:3.12-slim python3 -c 'print(6 * 7)'
# Create a sandbox from the python template
SBX=$(curl -s https://api.kosa8.com/v1/sandboxes \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"template":"python","ttl_s":600}' | jq -r .sandbox.id)

# Run a command in it
curl -s 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)"]}'

# Delete it
curl -s -X DELETE https://api.kosa8.com/v1/sandboxes/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"
from kosa8 import Kosa8Cloud

cloud = Kosa8Cloud()  # reads KOSA8_API_KEY

with cloud.sandboxes.create(template="python", ttl_s=600) as box:
    r = box.exec(["python3", "-c", "print(6 * 7)"])
    print(r.exit_code, r.stdout)  # 0 42
# the sandbox is deleted when the block ends
import { Kosa8Cloud } from '@kosa8/sdk';

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

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

import (
	"context"
	"fmt"
	"log"

	kosa8 "github.com/kosa8ai/kosa8-go"
)

func main() {
	ctx := context.Background()
	cloud, err := kosa8.NewCloud(kosa8.CloudOptions{}) // reads KOSA8_API_KEY
	if err != nil {
		log.Fatal(err)
	}

	box, err := cloud.Sandboxes.Create(ctx, kosa8.CloudCreateOptions{Template: "python", TTLSeconds: 600})
	if err != nil {
		log.Fatal(err)
	}
	defer box.Delete(ctx)

	r, err := box.Exec(ctx, []string{"python3", "-c", "print(6 * 7)"}, nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Print(r.Stdout) // 42
}
require "kosa8"

cloud = Kosa8::Cloud.new # reads KOSA8_API_KEY

box = cloud.sandboxes.create(template: "python", ttl_s: 600)
begin
  r = box.exec(["python3", "-c", "print(6 * 7)"])
  puts r.exit_code, r.stdout # 0, 42
ensure
  box.delete
end
import com.kosa8.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Kosa8Cloud cloud = Kosa8Cloud.builder().build(); // reads KOSA8_API_KEY

        CloudSandbox box = cloud.sandboxes().create(
            new CloudOptions.Create().template("python").ttlSeconds(600));
        try {
            CloudExecResult r = box.exec("python3 -c 'print(6 * 7)'");
            System.out.println(r.exitCode() + " " + r.stdout()); // 0 42
        } finally {
            box.delete();
        }
    }
}

The basics#

Base URLhttps://api.kosa8.com. Sandboxes run in us-ash1 (Ashburn, Virginia).
AuthAuthorization: Bearer k8c_live_…: an API key, or a k8c_tok_… capability token. Keys and scopes
BodiesJSON in, JSON out; file bodies are raw bytes; a streamed exec answers NDJSON
Errors{"error": "code", "message": "…"}, with a stable error code. Errors and retries
Safe retriesSend Idempotency-Key on creates: for 24 hours a repeat gets the first answer
Machine-readableopenapi.json (OpenAPI 3.1), llms.txt, and an MCP server at /mcp

Sandboxes#

Serverless and compute#

RL, jobs and CI#

Organization#

Security#

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 · AI Agent Sandbox: Secure and Sovereign for Enterprise · Local models served by llamay · Agent gateway: MAQPNA