Embeds
3 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.
A signed, expiring iframe URL for the sandbox's terminal or desktop#
POST
/v1/sandboxes/{id}/embedscope sandboxes:writeThe page posts {source: "kosa8", type} messages to the listed origins: ready, exited {code}, approval_requested {approval}, expired. See docs/guides/cloud-embed.
Parametersidrequiredpath · stringSandbox id (sbx_…)
mode"view" | "interact"view (default): watch only, enforced by the server; interact: mouse and keyboard too
ui"terminal" | "desktop"terminal (default), or desktop (the kosa8-desktop image's noVNC)
ttl_sintegerHow long the URL works (default 3600), never past the sandbox's delete_after Min 60. Max 604800.
originsrequiredarray of stringThe origins that may frame it (CSP frame-ancestors) and receive its postMessage events, such as https://app.example.com
commandarray of stringTerminal only: the program to show instead of the default (a login shell; view mode: the sandbox's tmux session, read-only)
201400401403404409501
curl -s -X POST https://api.kosa8.com/v1/sandboxes/$SBX/embed \ -H "Authorization: Bearer $KOSA8_API_KEY" \ -H 'Content-Type: application/json' -d @body.json
The sandbox's live embeds (no URLs)#
GET
Parameters/v1/sandboxes/{id}/embedsscope sandboxes:readidrequiredpath · stringSandbox id (sbx_…)
200401403404
curl -s -X GET https://api.kosa8.com/v1/sandboxes/$SBX/embeds \ -H "Authorization: Bearer $KOSA8_API_KEY"
End an embed's URL before it expires#
DELETE
Parameters/v1/sandboxes/{id}/embeds/{embed_id}scope sandboxes:writeidrequiredpath · stringSandbox id (sbx_…)
embed_idrequiredpath · stringEmbed id (emb_…)
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/sandboxes/$SBX/embeds/$EMBED_ID \ -H "Authorization: Bearer $KOSA8_API_KEY"