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

HTTP API / API keys

API keys

9 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 keys (never secrets)#

GET/v1/api-keysscope keys:manage
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/api-keys \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Create a key; the secret is shown once#

POST/v1/api-keysscope keys:manage
JSON body
namerequiredstring
—
scopesarray of string
—
expires_in_sinteger
Min 300. Max 31536000.
Responses
201400401403
curl -s -X POST https://api.kosa8.com/v1/api-keys \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Revoke a key now#

DELETE/v1/api-keys/{id}scope keys:manage
Parameters
idrequiredpath · string
Id
Responses
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/api-keys/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"

New key with the same name and scopes; the old one lives grace_s more#

POST/v1/api-keys/{id}/rotatescope keys:manage
Parameters
idrequiredpath · string
Id
JSON body
grace_sinteger
Min 0. Max 86400.
Responses
201401403404
curl -s -X POST https://api.kosa8.com/v1/api-keys/$SBX/rotate \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

List capability tokens (never secrets): every one in the org with keys:manage, else the ones this key or person made#

GET/v1/tokensany key
Parameters
allquery · "1"
Also the last day's revoked and expired ones
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/tokens \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Make a short-lived capability token (at most 24 h) limited to some scopes and, optionally, some sandboxes; the secret is shown once#

POST/v1/tokensany key

A token holds only scopes its maker holds, from sandboxes:read, sandboxes:write and functions:invoke. With sandbox_ids it reaches only those sandboxes; with labels only sandboxes carrying every label, and a sandbox it creates gets them. A limited token answers 403 token_restricted on every other route. It stops when the key that made it is revoked, when its member leaves, and while the org is frozen. A token cannot make tokens.

JSON body
scopesrequiredarray of "sandboxes:read" | "sandboxes:write" | "functions:invoke"
—
sandbox_idsarray of string
Sandboxes (sbx_…) of this org it may reach
labelsobject
Labels every sandbox it reaches must carry; it may create sandboxes, which get them
ttl_sinteger
Lifetime in seconds; default 3600 Min 60. Max 86400.
namestring
Max length 64.
Responses
201400401403404429
curl -s -X POST https://api.kosa8.com/v1/tokens \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Revoke a capability token; it stops at once#

DELETE/v1/tokens/{id}any key
Parameters
idrequiredpath · string
Id
Responses
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/tokens/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Apps connected through OAuth (Claude, ChatGPT, Codex, …): the org's with keys:manage, else your own#

GET/v1/oauth/grantsany key
Responses
200401403
curl -s -X GET https://api.kosa8.com/v1/oauth/grants \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Disconnect an app: its access and refresh tokens stop at once#

DELETE/v1/oauth/grants/{id}any key
Parameters
idrequiredpath · string
Id
Responses
200401403404
curl -s -X DELETE https://api.kosa8.com/v1/oauth/grants/$SBX \
  -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