Concepts
Open API and local execute
Official Kody doc
Open API and local execute are behind the mcp-api-tool and local-execute
feature flags (experiments cohort in production, plus per-user overrides).
Signed-in users who are not already enabled can turn them on from this page.
They may change or go away.
What they are
- Open API — JSON HTTP at api.kody.codes
(
/openapi.jsonand/v1/*). Interactive docs: api-docs.kody.codes. - MCP
apitool — run one Open API operation (operationId+params) from a connected agent whenmcp-api-toolis on. Use it to mint, list, and revoke scoped API tokens (tokenCreate/tokenList/tokenRevoke). There is no account UI for tokens. - Local execute —
@kodycodes/cli execute --localruns your module in a local workerd and forwards eachkody:runtimecall through the CapabilityProxy (/v1/capability-proxy/sessionand/v1/capability-proxy/call). Needs thelocal-executeflag and a token that holds thelocal-executescope.
How to get access
- Experiments — turn on experiments at
/account/experiments. Production already enablesmcp-api-toolandlocal-executefor theexperiments_opt_inaudience. - This page — signed-in users can opt in with the button above. That writes per-user on overrides for both flags without joining the broader experiments cohort.
First local run
With MCP
apiavailable, mint a short-lived token (value returned once):{ "operationId": "tokenCreate", "params": { "name": "kody-cli", "scopes": ["local-execute", "account:read"] } }Or from a shell already holding
KODY_API_TOKENwithtokens:writeandlocal-execute: use the CLI / MCPapihelpers the same way. Prefer MCPtokenCreatefor the first token.Export the value (do not paste it back into chat):
export KODY_API_TOKEN='kody_at_…'Run a local module:
npx @kodycodes/cli execute --local --code 'export default async function main() { return await kody.metaGetCurrentUser({}) }'
List and revoke tokens with MCP api (tokenList, tokenRevoke) or the same
operations over HTTP. See the CLI package for flags such as --token.
Metering
Local CPU is not counted as execute or dynamic_worker_day; capabilities you
call through the proxy still meter normally.
Where to go next
- api-docs.kody.codes — interactive OpenAPI
- Runtime and efficiency — how cloud execute meters worker days
- Contributor detail: Open API architecture