Daytona Run code and commands in secure cloud sandboxes
Integrate Daytona into your workflow to run AI-generated code in secure, isolated sandboxes. Create and manage sandboxes, execute shell commands, run Python, JavaScript, or TypeScript code, transfer files, and clone Git repositories.
Create a new Daytona sandbox for running AI-generated code in isolation
参数 类型 必填 描述 apiKeystring 是 Daytona API key snapshotstring 否 ID or name of the snapshot to create the sandbox from (uses default if empty) namestring 否 Name for the sandbox (defaults to the sandbox ID) targetstring 否 Region where the sandbox will be created (e.g., us, eu) userstring 否 User associated with the sandbox envjson 否 Environment variables to set in the sandbox as key-value pairs labelsjson 否 Labels to attach to the sandbox as key-value pairs cpunumber 否 CPU cores to allocate to the sandbox memorynumber 否 Memory to allocate to the sandbox in GB disknumber 否 Disk space to allocate to the sandbox in GB autoStopIntervalnumber 否 Auto-stop interval in minutes (0 disables auto-stop) autoArchiveIntervalnumber 否 Auto-archive interval in minutes (0 uses the maximum interval) autoDeleteIntervalnumber 否 Auto-delete interval in minutes (negative disables, 0 deletes immediately on stop) publicboolean 否 Whether the sandbox HTTP preview is publicly accessible
参数 类型 描述 sandboxjson The created sandbox
List Daytona sandboxes in the organization
参数 类型 必填 描述 apiKeystring 是 Daytona API key limitnumber 否 Maximum number of sandboxes to return (1-200) namestring 否 Filter sandboxes by name prefix (case-insensitive) labelsjson 否 Filter sandboxes by labels as key-value pairs cursorstring 否 Pagination cursor from a previous response
参数 类型 描述 sandboxesarray Sandboxes in the organization nextCursorstring Cursor for the next page of results
Get details of a Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID or name of the sandbox
参数 类型 描述 sandboxjson The sandbox details
Start a stopped Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID or name of the sandbox
参数 类型 描述 sandboxjson The started sandbox
Stop a running Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID or name of the sandbox
参数 类型 描述 sandboxjson The stopped sandbox
Delete a Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID or name of the sandbox
参数 类型 描述 sandboxjson The deleted sandbox
Execute a shell command inside a Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID of the sandbox to execute the command in commandstring 是 Shell command to execute cwdstring 否 Working directory for the command (defaults to the sandbox working directory) envjson 否 Environment variables to set for the command as key-value pairs timeoutnumber 否 Timeout in seconds (defaults to 10 seconds)
参数 类型 描述 exitCodenumber Exit code of the command (-1 if missing from the response) resultstring Combined stdout/stderr output of the command
Run Python, JavaScript, or TypeScript code inside a Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID of the sandbox to run the code in codestring 是 Code to run languagestring 是 Language of the code: python, javascript, or typescript envjson 否 Environment variables to set for the run as key-value pairs timeoutnumber 否 Timeout in seconds (defaults to 10 seconds)
参数 类型 描述 exitCodenumber Exit code of the code run (-1 if missing from the response) resultstring Combined stdout/stderr output of the code run artifactsjson Artifacts produced by the run (e.g., matplotlib charts)
Upload a file to a Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID of the sandbox to upload the file to destinationPathstring 是 Destination path in the sandbox (a trailing slash uploads into that directory using the file name) filefile 否 The file to upload fileContentstring 否 Legacy: base64 encoded file content fileNamestring 否 Optional file name override
参数 类型 描述 uploadedPathstring Path of the uploaded file in the sandbox namestring Name of the uploaded file sizenumber Size of the uploaded file in bytes
Download a file from a Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID of the sandbox to download the file from filePathstring 是 Path of the file in the sandbox
参数 类型 描述 filefile Downloaded file stored in execution files namestring Name of the downloaded file mimeTypestring MIME type of the downloaded file sizenumber Size of the downloaded file in bytes
List files in a directory of a Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID of the sandbox to list files in pathstring 否 Directory path to list (defaults to the sandbox working directory)
参数 类型 描述 filesarray Files and directories at the given path ↳ name string File or directory name ↳ isDir boolean Whether the entry is a directory ↳ size number Size in bytes ↳ mode string File mode string ↳ permissions string Permission string ↳ owner string Owning user ↳ group string Owning group ↳ modifiedAt string Last modification timestamp
Clone a Git repository into a Daytona sandbox
参数 类型 必填 描述 apiKeystring 是 Daytona API key sandboxIdstring 是 ID of the sandbox to clone the repository into urlstring 是 URL of the Git repository to clone pathstring 是 Path in the sandbox to clone the repository into branchstring 否 Branch to clone (defaults to the default branch) commitIdstring 否 Specific commit to check out after cloning usernamestring 否 Username for authenticating to private repositories passwordstring 否 Password or personal access token for private repositories
参数 类型 描述 repoUrlstring URL of the cloned repository clonePathstring Path the repository was cloned into