Concepts
'API tokens (API keys): list, revoke, delete, rotate'
Official Kody doc
Kody API tokens (kody_at_…, sometimes called API keys) authenticate the
Open API, the CLI, and CI. There is no account UI for them: you
manage them with these Open API operations.
| Task | operationId | Needs scope |
|---|---|---|
| List your tokens | tokenList | token:read |
| Inspect one token | tokenGet | token:read |
| Revoke a token | tokenRevoke | token:delete |
| Rotate a token | tokenRotate | token:delete |
| Mint a token | tokenCreate | none |
| Revoke the calling token | tokenRevokeCurrent | none |
Scopes apply when the caller is itself an API token. The MCP api tool runs as
you, so it can list and revoke any of your tokens.
Revoke a token
List tokens and find the one to revoke by
name,scopes, orlast_used_at:{ "operationId": "tokenList" }Revoke it by
id(the part afterkody_at_and before_):{ "operationId": "tokenRevoke", "params": { "token_id": "<id>" } }
Revoking is how you delete a token. Revocation is immediate. Anything still
using the token gets 401 API token was revoked.
Where to call these
- MCP
apitool (preferred for connected agents): pass the JSON above. - CLI:
npx @kodycodes/cli api tokenListandnpx @kodycodes/cli api tokenRevoke --params '{"token_id":"<id>"}'afternpx @kodycodes/cli login(see Local CLI execute). Every command picks--token, thenKODY_API_TOKEN, then the one saved CLI credential (kody loginorkody auth bootstrap).kody whoamireports that same pick. A leftover token from an older CLI's separate API-token slot is moved into the saved credential when nothing else is saved and the command names no org; a command run with--orgorKODY_ORGnever adopts it, because that old token has no org. A terminalkody logintries to delete it and says so when it could not. A desktop login (KODY_CREDENTIAL_SOURCE=login) never reads or adopts that old slot. - HTTPS:
GET /v1/tokensandDELETE /v1/tokens/{token_id}on api.kody.codes with a token that holdstoken:read/token:delete.
Token operations are not kody.* capabilities, so execute (hosted or
--local) cannot call them, and search lists this guide rather than a
capability.
Only search and execute in your tool list?
Kody's MCP server advertises search, execute, and api to every signed-in
account on every plan; nothing gates api by tier, scope, or client. If your
agent only sees search and execute, its MCP client has not picked up the
current tool list.
- ChatGPT: ChatGPT does not refresh Kody's tool list after reconnect, so
apistays missing. Use the Kody CLI (see Connect your agent):npx @kodycodes/cli api tokenListandnpx @kodycodes/cli api tokenRevoke --params '{"token_id":"<id>"}'. - Other clients: refresh the Kody server's tools (reconnect it, or restart
the client) and
apiappears. Until then, use the CLI commands above.