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

HTTP API / Functions

Functions

14 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.

List functions#

GET/v1/functionsscope functions:invoke
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/functions \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Deploy or replace a function (bumps version)#

PUT/v1/functions/{name}scope functions:deploy

201 when the name is new (version 1); 200 when it replaces a deployed function.

Parameters
namerequiredpath · string
Function name
JSON body
runtimerequired"python3.12" | "node22"
—
coderequiredstring
The source, at most 1 MiB
envobject
Names not starting with K8_; 16 KiB in all
timeout_sinteger
Default 30. Min 1. Max 90.
web"off" | "public" | "key"
Default "off".
schedulestring | null
A five-field cron expression (UTC), or null for none
Responses
200201400401403413
curl -s -X PUT https://api.kosa8.com/v1/functions/$NAME \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Get a function with its code#

GET/v1/functions/{name}scope functions:deploy
Parameters
namerequiredpath · string
Function name
Responses
200401403404
curl -s -X GET https://api.kosa8.com/v1/functions/$NAME \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Delete a function#

DELETE/v1/functions/{name}scope functions:deploy
Parameters
namerequiredpath · string
Function name
Responses
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/functions/$NAME \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Call a function: {event} → result, logs, timings#

POST/v1/functions/{name}/invokescope functions:invoke
Parameters
namerequiredpath · string
Function name
JSON body
eventobject
—
Responses
200401402403404
curl -s -X POST https://api.kosa8.com/v1/functions/$NAME/invoke \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Call a function on up to 100 events#

POST/v1/functions/{name}/mapscope functions:invoke
Parameters
namerequiredpath · string
Function name
JSON body
eventsrequiredarray of object
—
concurrencyinteger
Max 16.
Responses
200401402403404
curl -s -X POST https://api.kosa8.com/v1/functions/$NAME/map \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Recent calls, newest first#

GET/v1/functions/{name}/invocationsscope functions:invoke
Parameters
namerequiredpath · string
Function name
limitquery · integer
How many
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/functions/$NAME/invocations \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Run code or a command in a fresh sandbox, one call: output, exit code and files back, sandbox deleted#

POST/v1/runscope sandboxes:write

Billed per second like any sandbox. A command that exits non-zero is a 200 with status failed; 4xx/5xx carry hint (the next step) and docs.

JSON body
codestring
Source to run; written to filename (main.<ext>) in /workspace
commandstring | array of string
A shell string, or a list of strings; with code, runs instead of the language's own command
language"python" | "node" | "typescript" | "bash" | "sh"
Default: from filename, else python
filenamestring
—
templatestring
Default: the language's (python, node, base)
filesobject | array of object
{path: text} or [{path, content, encoding: utf8|base64}]; paths are under /workspace
envobject
—
sizestring
—
timeout_sinteger
Default 60. Min 1. Max 3600.
streamboolean | "ndjson" | "sse"
true or ndjson: NDJSON frames as it prints; sse: server-sent events (or send Accept: text/event-stream)
outputsarray of string
Files to send back, base64, 4 MiB together
shareboolean | object
true: a public read-only run card (command, output, duration; never env or files). {public, code} also shows the code.
Responses
200400401402403413429
curl -s -X POST https://api.kosa8.com/v1/run \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

The org's recent runs, newest first (kept 30 days)#

GET/v1/runsscope sandboxes:read
Parameters
limitquery · integer
How many, up to 100
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/runs \
  -H "Authorization: Bearer $KOSA8_API_KEY"

One run, with the saved tail of its output#

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

Publish or unpublish a run's read-only card#

POST/v1/runs/{id}/sharescope sandboxes:write
Parameters
idrequiredpath · string
Run id (sr_…)
JSON body
publicrequiredboolean
—
codeboolean
—
Responses
200400401403404
curl -s -X POST https://api.kosa8.com/v1/runs/$SBX/share \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

A run card's model (serverless run, job or RL run) for the org's members#

GET/v1/cards/{id}scope sandboxes:read
Parameters
idrequiredpath · string
sr_…, job_… or run_…
Responses
200401403404
curl -s -X GET https://api.kosa8.com/v1/cards/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Publish or unpublish a job's read-only card#

POST/v1/jobs/{id}/sharescope sandboxes:write
Parameters
idrequiredpath · string
Job id
JSON body
publicrequiredboolean
—
Responses
200400401403404
curl -s -X POST https://api.kosa8.com/v1/jobs/$SBX/share \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Publish or unpublish an RL run's read-only card#

POST/v1/rl/runs/{id}/sharescope sandboxes:write
Parameters
idrequiredpath · string
RL run id
JSON body
publicrequiredboolean
—
Responses
200400401403404
curl -s -X POST https://api.kosa8.com/v1/rl/runs/$SBX/share \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

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