execute

Run one ESM module in Kody's hosted sandbox.

Run one ESM module in Kody's hosted sandbox. Same inputs and result envelope as the MCP execute tool (content, structuredContent, isError). Requires Authorization: Bearer kody_at_… with org:execute. JSON bodies follow the Open API 5 MiB cap. Older CLIs keep using MCP execute; this route does not accept MCP OAuth.

Org permission: org:execute.

post/v1/execute

Request

  • Base URL: https://api.kody.codes
  • URL: https://api.kody.codes/v1/execute
  • Auth: HTTP bearer

Request body

codestring

Single ESM module string with a default export. Imports may be npm packages compatible with the Cloudflare Workers runtime.

invokestring

Published package export to run (kody:@owner/name/export). Omit code when this is set.

paramsobject

JSON object passed to the default export.

responseLimitinteger
conversationIdstring

Optional short conversation identifier. Ties related calls together. If you already have a conversationId from an earlier response in the same conversation, pass it back unchanged. Otherwise omit this field to receive a server-generated ID, then reuse the returned conversationId on subsequent calls - this enables optimizations like reduced response size. Do not invent your own conversationId.

idempotencyKeystring
credentialsobject

Optional credential picks by need key, for credential(key) / credentials(key) in this run: { github: "work", google: ["work", "personal"], x: { name: "work", scope: "org" } }. A string is a credential name; add scope when an org and a personal credential share the name; an array picks several for credentials(key), and [] picks none. Picks choose only among credentials you can Use.

Response

Success.

structuredContentobject required
isErrorboolean required

Changes

No recorded changes to this operation across all 2 revisions of this API.