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

HTTP API / Swarms

Swarms

6 endpoints at https://api.kosa8.com, sent with Authorization: Bearer $KOSA8_API_KEY. Generated from the API's own OpenAPI description, which a test holds to the router.

The organization's swarms, newest first, without counters#

GET/v1/swarmsscope sandboxes:read
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/swarms \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Checkpoint a sandbox and fork it into a named swarm under one egress policy#

POST/v1/swarmsscope sandboxes:write

The checkpoint and the fork are the same calls as POST /v1/sandboxes/{id}/checkpoints and /fork, with the same payment, quota and fork limits. Members are labelled swarm, swarm.member and swarm.parent. If a member's egress policy cannot be applied, every member is deleted (502 egress_failed).

JSON body
namerequiredstring
—
from_sandbox_idrequiredstring
A running or sleeping sandbox
countrequiredinteger
Min 1. Max 100.
egressobject
The members' egress policy. Default: the parent's own, else the organization's
egress.internetboolean
false: nothing leaves but what allow and presets name. Default true when nothing is listed
egress.allowarray of string
Hostnames (exact), *.domain wildcards (any depth below, not the domain), IPv4 addresses or CIDRs
egress.denyarray of string
Refused even where allow covers them. A name is refused at DNS; a CIDR for every packet
egress.presetsarray of "common" | "npm" | "pypi" | "github" | "go" | "crates" | "rubygems" | "maven" …
—
Responses
201400401402403404409429501502503
curl -s -X POST https://api.kosa8.com/v1/swarms \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

A swarm with each running member's egress counters and anomalies#

GET/v1/swarms/{id}scope sandboxes:read

?stats=0 skips the counters. Counters come from the host: packets refused by egress and bytes out since the member last booted. Anomalies found (denied_burst: >= 20 refused; egress_spike: bytes out > 10x the median and > 1 MiB) are kept and written once to the audit log as swarm.anomaly. rare_host needs the hosts each member contacted, which kosa8 Cloud hosts do not report.

Parameters
idrequiredpath · string
Swarm id (swm_…) or name
Responses
200401403404
curl -s -X GET https://api.kosa8.com/v1/swarms/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Put every running member to sleep (state kept)#

POST/v1/swarms/{id}/pausescope sandboxes:write
Parameters
idrequiredpath · string
Swarm id (swm_…) or name
Responses
200401403404
curl -s -X POST https://api.kosa8.com/v1/swarms/$SBX/pause \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Wake every sleeping member#

POST/v1/swarms/{id}/resumescope sandboxes:write
Parameters
idrequiredpath · string
Swarm id (swm_…) or name
Responses
200401403404409
curl -s -X POST https://api.kosa8.com/v1/swarms/$SBX/resume \
  -H "Authorization: Bearer $KOSA8_API_KEY"

The kill switch: every running member to sleep and the swarm marked killed#

POST/v1/swarms/{id}/killscope sandboxes:write

Works while the organization is frozen. A killed swarm's name can be used again.

Parameters
idrequiredpath · string
Swarm id (swm_…) or name
rmquery · "1"
1: delete every member instead
Responses
200401403404
curl -s -X POST https://api.kosa8.com/v1/swarms/$SBX/kill \
  -H "Authorization: Bearer $KOSA8_API_KEY"

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