Daytona.API Key reference
ApiKey
Section titled “ApiKey”Source:
packages/daytona/src/ApiKey.ts
A Daytona API key with a fixed set of permissions. Give each app the narrowest key it needs; Daytona checks every request against it.
The runtime bindings (Daytona.CreateSandbox, Daytona.CreateVolume, …)
mint one of these per host for you, with only the permissions the
binding needs. Declare one yourself for CI or for a program outside
alchemy.
Daytona shows a key’s value only once, so alchemy stores it in state as
a Redacted value. Keys can’t be edited: changing any prop mints a new
key and deletes the old one.
Creating keys needs a signed-in profile, or an API key with
manage:api_keys (Daytona’s managed API keys, enabled on request);
otherwise Daytona refuses with ManagedApiKeysNotEnabled.
ApiKey: Creating a Key
Section titled “ApiKey: Creating a Key”A key that can only create and delete sandboxes
const key = yield* Daytona.ApiKey("Ci", { permissions: ["write:sandboxes", "delete:sandboxes"],});A key that expires
const key = yield* Daytona.ApiKey("Preview", { permissions: ["write:sandboxes"], expiresAt: "2027-01-01T00:00:00Z",});