Daytona Documentation
Daytona is a secure and elastic infrastructure for running AI-generated code.
Daytona provides full composable computers — sandboxes — for AI agents with complete isolation, a dedicated kernel, filesystem, network stack, and allocated vCPU, RAM, and disk.
Sandboxes are the core component of the Daytona platform, spinning up in under 90ms from code to execution and running any code in Python, TypeScript, and JavaScript. Built on OCI/Docker compatibility, massive parallelization, and unlimited persistence, sandboxes deliver consistent, predictable environments for agent workflows.
Agents and developers interact with sandboxes programmatically using the Daytona SDKs, API, and CLI. Operations span sandbox lifecycle management, filesystem operations, process and code execution, and runtime configuration. Our stateful environment snapshots enable persistent agent operations across sessions, making Daytona the ideal foundation for AI agent architectures.
Get started
Section titled “Get started”- Create an account → app.daytona.io
- Get an API key → app.daytona.io/dashboard/keys
-
Install the Python SDK
Terminal window pip install daytona -
Create a sandbox and run code
# Import the Daytona SDKfrom daytona import Daytona, DaytonaConfig# Define the configurationconfig = DaytonaConfig(api_key="YOUR_API_KEY") # Replace with your API key# Initialize the Daytona clientdaytona = Daytona(config)# Create the Sandbox instancesandbox = daytona.create()# Run coderesponse = sandbox.process.code_run('print("Hello World")')print(response.result)
-
Install the TypeScript SDK
Terminal window npm install @daytona/sdk -
Create a sandbox and run code
// Import the Daytona SDKimport { Daytona } from '@daytona/sdk'// Initialize the Daytona clientconst daytona = new Daytona({ apiKey: 'YOUR_API_KEY' }) // Replace with your API key// Create the Sandbox instanceconst sandbox = await daytona.create()// Run codeconst response = await sandbox.process.codeRun('print("Hello World")')console.log(response.result)
-
Install the Ruby SDK
Terminal window gem install daytona -
Create a sandbox and run code
require 'daytona'# Initialize the Daytona clientconfig = Daytona::Config.new(api_key: 'YOUR_API_KEY') # Replace with your API key# Create the Daytona clientdaytona = Daytona::Daytona.new(config)# Create the Sandbox instancesandbox = daytona.create# Run coderesponse = sandbox.process.code_run(code: 'print("Hello World")')puts response.result
-
Install the Go SDK
Terminal window go get github.com/daytonaio/daytona/libs/sdk-go -
Create a sandbox and run code
package mainimport ("context""fmt""github.com/daytonaio/daytona/libs/sdk-go/pkg/daytona""github.com/daytonaio/daytona/libs/sdk-go/pkg/types")func main() {config := &types.DaytonaConfig{APIKey: "YOUR_API_KEY", // Replace with your API key}client, _ := daytona.NewClientWithConfig(config)ctx := context.Background()sandbox, _ := client.Create(ctx, nil)// Run coderesult, _ := sandbox.Process.CodeRun(ctx, `print("Hello World")`)fmt.Println(result.Result)}
-
Install the Java SDK
Gradle
Add the Daytona SDK dependency to your
build.gradle.kts:dependencies {implementation("io.daytona:sdk-java:0.1.0")}Maven
Add the Daytona SDK dependency to your
pom.xml:<dependency><groupId>io.daytona</groupId><artifactId>sdk-java</artifactId><version>0.1.0</version></dependency> -
Create a sandbox and run code
import io.daytona.sdk.Daytona;import io.daytona.sdk.Sandbox;import io.daytona.sdk.DaytonaConfig;import io.daytona.sdk.model.ExecuteResponse;public class Main {public static void main(String[] args) {DaytonaConfig config = new DaytonaConfig.Builder().apiKey("YOUR_API_KEY").build();try (Daytona daytona = new Daytona(config)) {Sandbox sandbox = daytona.create();// Run codeExecuteResponse response = sandbox.getProcess().codeRun("print(\"Hello World\")");System.out.println(response.getResult());}}}
-
Create a sandbox and run code
Terminal window # Create sandboxcurl https://app.daytona.io/api/sandbox \--request POST \--header 'Content-Type: application/json' \--header 'Authorization: Bearer YOUR_API_KEY' \--data '{}'# Run codecurl 'https://proxy.app.daytona.io/toolbox/{sandboxId}/process/code-run' \--request POST \--header 'Content-Type: application/json' \--data '{"code": "print(\"Hello World\")"}'
-
Create a sandbox and run code
Terminal window daytona create --name hellodaytona exec hello -- python3 -c 'print("Hello World")'
References
Section titled “References”- Daytona SDKs: TypeScript, Python, Ruby, Go, Java
- Daytona API: RESTful API (OpenAPI spec), Toolbox API (OpenAPI spec)
- Daytona CLI: Mac/Linux/Windows
- Daytona LLMs: llms.txt, llms-full.txt
- Daytona Skills: agent skills
npx skills add https://github.com/daytona/skills --skill daytona