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
JSON body/v1/auth/devicepublicclientrequired"cli" | "desktop"—
namerequiredstringThis 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
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
JSON body/v1/cli-eventspublicnamerequired"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_inbooleancloud_handoff: whether the CLI was already signed in
osrequiredstring—
archrequiredstring—
versionrequiredstring—
install_idrequiredstringA random per-install id; stored only as a keyed hash
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
JSON body/v1/auth/device/tokenpublicdevice_coderequiredstring—
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
Parameters/v1/auth/device/pendingany keyuser_codequery · stringABCD-EFGH; any case, dash optional
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
JSON body/v1/auth/device/approvescope keys:manageuser_coderequiredstring—
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
JSON body/v1/auth/device/denyany keyuser_coderequiredstring—
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
Parameters/v1/oauth/authorizeany keyclient_idquery · stringAs sent to /oauth/authorize
redirect_uriquery · stringAs sent to /oauth/authorize
response_typequery · stringAs sent to /oauth/authorize
statequery · stringAs sent to /oauth/authorize
code_challengequery · stringAs sent to /oauth/authorize
code_challenge_methodquery · stringAs sent to /oauth/authorize
scopequery · stringAs sent to /oauth/authorize
resourcequery · stringAs sent to /oauth/authorize
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
JSON body/v1/oauth/authorize/approveany keyclient_idrequiredstring—
redirect_urirequiredstring—
response_typerequired"code"—
staterequiredstring—
code_challengerequiredstring—
code_challenge_methodrequired"S256"—
scopestring—
resourcestring—
scopesarray of stringThe ones the person kept, of those asked for; at most what their role holds
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
Responses/v1/oauth/authorize/denyany key200400401403
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
JSON body/oauth/registerpublicredirect_urisrequiredarray of string—
client_namestringMax 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"—
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
Responses/oauth/tokenpublic200400401
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
Responses/oauth/revokepublic200400401
curl -s -X POST https://api.kosa8.com/oauth/revoke