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

HTTP API / Sign-in

Sign-in

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

Start a browser sign-in for the CLI or desktop app (device authorization, RFC 8628)#

POST/v1/auth/devicepublic
JSON body
clientrequired"cli" | "desktop"
—
namerequiredstring
This computer's hostname Max length 64.
source"cli_hint" | "cli_cloud"
Optional: what started the sign-in (the kosa8 CLI sets it); recorded as a new org's sign-up source
Responses
200400429
curl -s -X POST https://api.kosa8.com/v1/auth/device \
  -H 'Content-Type: application/json' -d @body.json

The kosa8 CLI reports a Cloud hint shown or a --cloud handoff (anonymous; a key, if sent, adds the org). Allowed names and values only, body at most 512 bytes, rate-limited per network#

POST/v1/cli-eventspublic
JSON body
namerequired"cloud_hint_shown" | "cloud_handoff" | "cloud_handoff_login"
—
reason"gpu" | "too_big" | "parallel" | "no_local" | "share"
cloud_hint_shown: required; cloud_handoff: the hint that preceded it, if any
cmd"run" | "sandbox_create"
cloud_handoff and cloud_handoff_login
stage"started" | "completed" | "failed"
cloud_handoff_login
signed_inboolean
cloud_handoff: whether the CLI was already signed in
osrequiredstring
—
archrequiredstring
—
versionrequiredstring
—
install_idrequiredstring
A random per-install id; stored only as a keyed hash
Responses
202400413429
curl -s -X POST https://api.kosa8.com/v1/cli-events \
  -H 'Content-Type: application/json' -d @body.json

Poll for the sign-in's API key: 428 authorization_pending, 429 slow_down, 403 access_denied, 410 expired_token; 200 once, then 410#

POST/v1/auth/device/tokenpublic
JSON body
device_coderequiredstring
—
Responses
200400403410428429
curl -s -X POST https://api.kosa8.com/v1/auth/device/token \
  -H 'Content-Type: application/json' -d @body.json

The sign-in a code belongs to (the /device page). Needs a person signed in to the dashboard, not an API key#

GET/v1/auth/device/pendingany key
Parameters
user_codequery · string
ABCD-EFGH; any case, dash optional
Responses
200400401403404410
curl -s -X GET https://api.kosa8.com/v1/auth/device/pending \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Approve: makes an API key named after the device for the approver. Dashboard session only#

POST/v1/auth/device/approvescope keys:manage
JSON body
user_coderequiredstring
—
Responses
200400401403404409410
curl -s -X POST https://api.kosa8.com/v1/auth/device/approve \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Deny: the device's next poll gets 403 access_denied. Dashboard session only#

POST/v1/auth/device/denyany key
JSON body
user_coderequiredstring
—
Responses
200400401403404409410
curl -s -X POST https://api.kosa8.com/v1/auth/device/deny \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

What the consent page shows for an OAuth authorization request (the query of /oauth/authorize). Dashboard session only#

GET/v1/oauth/authorizeany key
Parameters
client_idquery · string
As sent to /oauth/authorize
redirect_uriquery · string
As sent to /oauth/authorize
response_typequery · string
As sent to /oauth/authorize
statequery · string
As sent to /oauth/authorize
code_challengequery · string
As sent to /oauth/authorize
code_challenge_methodquery · string
As sent to /oauth/authorize
scopequery · string
As sent to /oauth/authorize
resourcequery · string
As sent to /oauth/authorize
Responses
200400401403
curl -s -X GET https://api.kosa8.com/v1/oauth/authorize \
  -H "Authorization: Bearer $KOSA8_API_KEY"

Approve: returns redirect_to, the client's redirect_uri with a 60-second, single-use code and the state. Dashboard session only#

POST/v1/oauth/authorize/approveany key
JSON body
client_idrequiredstring
—
redirect_urirequiredstring
—
response_typerequired"code"
—
staterequiredstring
—
code_challengerequiredstring
—
code_challenge_methodrequired"S256"
—
scopestring
—
resourcestring
—
scopesarray of string
The ones the person kept, of those asked for; at most what their role holds
Responses
200400401403
curl -s -X POST https://api.kosa8.com/v1/oauth/authorize/approve \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Deny: returns redirect_to with error=access_denied. Dashboard session only#

POST/v1/oauth/authorize/denyany key
Responses
200400401403
curl -s -X POST https://api.kosa8.com/v1/oauth/authorize/deny \
  -H "Authorization: Bearer $KOSA8_API_KEY" \
  -H 'Content-Type: application/json' -d @body.json

Dynamic client registration (RFC 7591) for MCP clients. redirect_uris: https, http on localhost/127.0.0.1/[::1], or an app's own scheme; no fragments. Rate-limited per network#

POST/oauth/registerpublic
JSON body
redirect_urisrequiredarray of string
—
client_namestring
Max length 100.
client_uristring
—
token_endpoint_auth_method"none" | "client_secret_post" | "client_secret_basic"
Default client_secret_basic (RFC 7591); MCP clients usually send none
grant_typesarray of "authorization_code" | "refresh_token"
—
response_typesarray of "code"
—
Responses
201400429
curl -s -X POST https://api.kosa8.com/oauth/register \
  -H 'Content-Type: application/json' -d @body.json

OAuth 2.1 token endpoint (application/x-www-form-urlencoded): authorization_code with PKCE (code_verifier) and resource, or refresh_token. Access tokens last 1 h and work only at /mcp; refresh tokens last 30 days and rotate on every use (a reused one revokes the grant)#

POST/oauth/tokenpublic
Responses
200400401
curl -s -X POST https://api.kosa8.com/oauth/token

Token revocation (RFC 7009): a refresh token ends its grant, an access token only itself. 200 whether or not the token was known#

POST/oauth/revokepublic
Responses
200400401
curl -s -X POST https://api.kosa8.com/oauth/revoke

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