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

HTTP API / kosa8 AI

kosa8 AI

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

Ask kosa8: answers from the docs and your live status, with links and proposed actions#

POST/v1/askscope sandboxes:read

kosa8 AI runs on Cloudflare Workers AI through kosa8's AI gateway: no model key, and the text stays within Cloudflare. Its output is data: it never approves, merges, deletes or widens access, and proposed actions are buttons that run the normal flows. Each model call is metered like other gateway use, capped per hour, and identical inputs are answered from a cache. Send Accept: text/event-stream (or stream: true) for server-sent events: meta, delta {text}, then done (the JSON below) or error. Capped per member per hour (429 ask_rate_limit with retry_after_s); 503 ai_off when switched off.

JSON body
questionrequiredstring
1-2000 characters
pagestring | null
The app page asked from, e.g. billing
repostring | null
owner/name, for a Do it for me task
historyarray of object
Up to 4 earlier turns
streamboolean
—
Responses
200400401403429503
curl -s -X POST https://api.kosa8.com/v1/ask \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Why it failed: one line on why, one suggested fix, and the failure class#

POST/v1/ai/explainscope sandboxes:read

kosa8 AI runs on Cloudflare Workers AI through kosa8's AI gateway: no model key, and the text stays within Cloudflare. Its output is data: it never approves, merges, deletes or widens access, and proposed actions are buttons that run the normal flows. Each model call is metered like other gateway use, capped per hour, and identical inputs are answered from a cache. When the model is capped or off, kosa8's rules answer (source: rules).

JSON body
kindrequired"bot_run" | "pipeline_run" | "agent_task" | "gh_trigger"
—
idrequiredstring
The run's, task's or request's id
Responses
200400401403404
curl -s -X POST https://api.kosa8.com/v1/ai/explain \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

One-click agent tasks: Fix a failing test, Explain this error, Summarize this repo, Write a README#

GET/v1/agent/templatesscope sandboxes:read

kosa8 AI runs on Cloudflare Workers AI through kosa8's AI gateway: no model key, and the text stays within Cloudflare. Its output is data: it never approves, merges, deletes or widens access, and proposed actions are buttons that run the normal flows. Each model call is metered like other gateway use, capped per hour, and identical inputs are answered from a cache.

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

Recent kosa8 AI agent tasks#

GET/v1/agent/tasksscope sandboxes:read

kosa8 AI runs on Cloudflare Workers AI through kosa8's AI gateway: no model key, and the text stays within Cloudflare. Its output is data: it never approves, merges, deletes or widens access, and proposed actions are buttons that run the normal flows. Each model call is metered like other gateway use, capped per hour, and identical inputs are answered from a cache.

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

Start a kosa8 AI agent task on a repo or a sandbox; changes come back as a draft pull request#

POST/v1/agent/tasksscope sandboxes:write

kosa8 AI runs on Cloudflare Workers AI through kosa8's AI gateway: no model key, and the text stays within Cloudflare. Its output is data: it never approves, merges, deletes or widens access, and proposed actions are buttons that run the normal flows. Each model call is metered like other gateway use, capped per hour, and identical inputs are answered from a cache. Send repo (owner/name through your GitHub connection) or sandbox_id. The agent runs in a sandbox; its short-lived kosa8 AI token is held by the egress broker, never in the sandbox. Draft pull requests only. 10 tasks an hour and 3 at once per organization (429 agent_rate_limit). Poll GET /v1/agent/tasks/{id}.

JSON body
taskstring
What to do, in one sentence
templatestring | null
A template id instead of, or with, task
repostring | null
owner/name
refstring | null
Branch, tag or commit
sandbox_idstring | null
sbx_…
draft_prboolean
Default true; false keeps the changes in the sandbox
Responses
202400401402403404429503
curl -s -X POST https://api.kosa8.com/v1/agent/tasks \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

One agent task, with its steps rail, result and cost#

GET/v1/agent/tasks/{id}scope sandboxes:read

kosa8 AI runs on Cloudflare Workers AI through kosa8's AI gateway: no model key, and the text stays within Cloudflare. Its output is data: it never approves, merges, deletes or widens access, and proposed actions are buttons that run the normal flows. Each model call is metered like other gateway use, capped per hour, and identical inputs are answered from a cache.

Parameters
idrequiredpath · string
Task id (agt_…)
Responses
200401403404
curl -s -X GET https://api.kosa8.com/v1/agent/tasks/$SBX \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Stop an agent task; its own sandbox is deleted#

POST/v1/agent/tasks/{id}/cancelscope sandboxes:write

kosa8 AI runs on Cloudflare Workers AI through kosa8's AI gateway: no model key, and the text stays within Cloudflare. Its output is data: it never approves, merges, deletes or widens access, and proposed actions are buttons that run the normal flows. Each model call is metered like other gateway use, capped per hour, and identical inputs are answered from a cache.

Parameters
idrequiredpath · string
Task id (agt_…)
Responses
200401403404409
curl -s -X POST https://api.kosa8.com/v1/agent/tasks/$SBX/cancel \
  -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 · Zero Trust cybersecurity infrastructure for AI agents · Local models served by llamay · Agent gateway: MAQPNA