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

HTTP API / Previews

Previews

5 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 sandbox's preview URLs (no tokens)#

GET/v1/sandboxes/{id}/previewsscope sandboxes:read
Parameters
idrequiredpath · string
Sandbox id (sbx_…)
Responses
200401403404
curl -s -X GET https://api.kosa8.com/v1/sandboxes/$SBX/previews \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Open a port at its own https URL, private (signed link) unless public: true#

POST/v1/sandboxes/{id}/previewsscope sandboxes:write

The server must listen on 0.0.0.0, not 127.0.0.1. Opening a port that is already open answers 200 with a fresh link and applies public, wake and wake_per_hour. A sleeping sandbox's preview answers 503 until it is woken, unless wake is true: then the request wakes it (402 when the organization cannot pay for it, 429 past wake_per_hour).

Parameters
idrequiredpath · string
Sandbox id (sbx_…)
JSON body
portrequiredinteger
Min 1. Max 65535.
publicboolean
—
expires_in_sinteger
How long the link works, in seconds (default 3600) Min 60. Max 604800.
wakeboolean
Wake the sandbox on a request while it sleeps (default false)
wake_per_hourinteger
Cap on wakes by preview requests per rolling hour (default 12) Min 1. Max 120.
Responses
201400401403404409410501
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/previews \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json
POST/v1/sandboxes/{id}/previews/{port}/linkscope sandboxes:write
Parameters
idrequiredpath · string
Sandbox id (sbx_…)
portrequiredpath · string
The port in the sandbox, 1-65535
JSON body
expires_in_sinteger
How long the link works, in seconds (default 3600) Min 60. Max 604800.
Responses
200400401403404501
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/previews/$PORT/link \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Move the preview to a new address, ending every earlier link and cookie#

POST/v1/sandboxes/{id}/previews/{port}/rotatescope sandboxes:write
Parameters
idrequiredpath · string
Sandbox id (sbx_…)
portrequiredpath · string
The port in the sandbox, 1-65535
JSON body
expires_in_sinteger
How long the link works, in seconds (default 3600) Min 60. Max 604800.
Responses
200400401403404501
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/previews/$PORT/rotate \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Close the port's preview#

DELETE/v1/sandboxes/{id}/previews/{port}scope sandboxes:write
Parameters
idrequiredpath · string
Sandbox id (sbx_…)
portrequiredpath · string
The port in the sandbox, 1-65535
Responses
200400401403404
curl -s -X DELETE https://api.kosa8.com/v1/sandboxes/$SBX/previews/$PORT \
  -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