Daytona
Daytona provides secure and elastic infrastructure for running AI-generated code in isolated sandboxes.
Categories: Developer Tools, Artificial Intelligence
Type: daytona/v1
Connections
Version: 1
Bearer Token
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| token | API Key | STRING | Your Daytona API key. | true |
| baseUrl | Base URL | STRING | The Daytona API base URL. Change only for self-hosted deployments. | true |
Connection Setup
- Sign in to the Daytona Dashboard and open the Keys page.
- Click Create Key.
- Enter a name for the key (e.g., ByteChef), set its expiration date, and select the
write:sandboxesanddelete:sandboxespermissions. - Click Create and copy the key.
- In ByteChef, create a Daytona connection and paste the key into API Key.
- Leave Base URL set to
https://app.daytona.io/apiunless you run a self-hosted Daytona deployment, in which case enter its API URL.
Actions
Execute Code
Name: executeCode
Generates and runs code in a secure, isolated Daytona sandbox and returns its output. Use this to execute AI-generated code (data analysis, calculations, scripts) safely and get the result back.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| language | Language | STRING Optionspython, typescript, javascript, bash | The programming language of the code to execute. | true |
| code | Code | STRING | The source code to execute in the sandbox. | true |
| sandboxId | Sandbox ID | STRING | Run in an existing sandbox to preserve state across turns. Leave empty to create a fresh, ephemeral sandbox for this run. A reused sandbox is never deleted by this action. | false |
| keepSandbox | Keep Sandbox | BOOLEAN Optionstrue, false | When creating a new sandbox, keep it alive after the run (instead of deleting it) so it can be reused via its returned Sandbox ID. Ignored when a Sandbox ID is supplied. | false |
| timeout | Timeout | INTEGER | Maximum time in seconds to wait for the code to finish executing. | false |
Example JSON Structure
{
"label" : "Execute Code",
"name" : "executeCode",
"parameters" : {
"language" : "",
"code" : "",
"sandboxId" : "",
"keepSandbox" : false,
"timeout" : 1
},
"type" : "daytona/v1/executeCode"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| exitCode | INTEGER | The exit code of the executed code (0 indicates success). |
| stdout | STRING | The standard output produced by the code. |
| success | BOOLEAN Optionstrue, false | Whether the code finished with a zero exit code. |
| sandboxId | STRING | The sandbox the code ran in (reuse it to preserve state). |
| charts | ARRAY Items[] | Chart artifacts (e.g. matplotlib) captured during execution, if any. |
Output Example
{
"exitCode" : 1,
"stdout" : "",
"success" : false,
"sandboxId" : "",
"charts" : [ ]
}Create Sandbox
Name: createSandbox
Creates a persistent, isolated Daytona sandbox and returns its ID. Reuse the ID across executeCode and uploadFile calls to preserve state, then delete it with deleteSandbox when done.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| language | Language | STRING Optionspython, typescript, javascript, bash | The default language runtime for the sandbox. | false |
Example JSON Structure
{
"label" : "Create Sandbox",
"name" : "createSandbox",
"parameters" : {
"language" : ""
},
"type" : "daytona/v1/createSandbox"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| sandboxId | STRING | The ID of the created sandbox. |
Output Example
{
"sandboxId" : ""
}Delete Sandbox
Name: deleteSandbox
Deletes a Daytona sandbox and frees its resources.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| sandboxId | Sandbox ID | STRING | The ID of the sandbox to delete. | true |
Example JSON Structure
{
"label" : "Delete Sandbox",
"name" : "deleteSandbox",
"parameters" : {
"sandboxId" : ""
},
"type" : "daytona/v1/deleteSandbox"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| deleted | BOOLEAN Optionstrue, false | Whether the sandbox was deleted. |
Output Example
{
"deleted" : false
}Upload File
Name: uploadFile
Uploads a file into a Daytona sandbox at the given path.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| sandboxId | Sandbox ID | STRING | The ID of the sandbox to upload the file into. | true |
| path | Path | STRING | The absolute destination path inside the sandbox (e.g. /home/daytona/data.csv). | true |
| file | File | FILE_ENTRY | The file to upload. | true |
Example JSON Structure
{
"label" : "Upload File",
"name" : "uploadFile",
"parameters" : {
"sandboxId" : "",
"path" : "",
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
},
"type" : "daytona/v1/uploadFile"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| path | STRING | The destination path the file was uploaded to. |
Output Example
{
"path" : ""
}Additional Instructions
Running code from an AI Agent
Execute Code is also available as a tool for the AI Agent. Add it under the agent's tools, and the agent can write code (Python, TypeScript, JavaScript or Bash), run it in an isolated Daytona sandbox, and use the output in its answer. This is useful for data analysis, calculations and scripts that the model should not try to compute in its head.
The tool returns exitCode, stdout, success, sandboxId and any charts the code produced (for example, matplotlib plots).
Sandbox lifecycle
By default, Execute Code creates a new sandbox, runs the code and deletes the sandbox when the run finishes, so nothing carries over between runs.
To keep files, installed packages and variables between runs:
- Create a sandbox with Create Sandbox, or run Execute Code with Keep Sandbox enabled. Both return a
sandboxId. - Pass that
sandboxIdto later Execute Code and Upload File calls. A sandbox passed in this way is never deleted by Execute Code. - Delete the sandbox with Delete Sandbox when you are done. Sandboxes you keep count against your Daytona usage until you delete them.
How is this guide?
Last updated on