Skip to content

Daytona Documentation

View as Markdown

Daytona is a secure and elastic infrastructure for running AI-generated code.

Daytona provides full composable computers — sandboxes — 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 AI, agent and reinforcement learning workflows.

Agents and developers interact with sandboxes programmatically using the SDKs, API, and CLI.

Agent Prompt
Help me set up Daytona in this project. Before writing any Daytona code, verify the setup: 1. Check that the Daytona SDK is installed for the language used in this project. If not, install it. Python: `pip install daytona` TypeScript: `npm install @daytona/sdk` Ruby: `gem install daytona` Go: `go get github.com/daytona/clients/sdk-go` Java: add the `io.daytona:sdk` dependency to `build.gradle.kts` or `pom.xml` 2. Check DAYTONA_API_KEY in the shell environment or in environment files. If not set, tell the user they need an API key and point them to https://app.daytona.io/dashboard/keys to create one. 3. Write a script that initializes the Daytona client, creates a sandbox, runs a "Hello World" program inside it, captures the output, and deletes the sandbox. 4. Run the script to verify the sandbox works.
  1. Create an account → app.daytona.io
  2. Get an API key → app.daytona.io/dashboard/keys
  3. Save the API key → DAYTONA_API_KEY environment variable or in a .env file.
Terminal window
DAYTONA_API_KEY=YOUR_API_KEY
  1. Install the Python SDK

    Terminal window
    pip install daytona
  2. Create a sandbox and run code

    # Import the Daytona SDK
    from daytona import Daytona, DaytonaConfig
    # Define the configuration
    config = DaytonaConfig(api_key="YOUR_API_KEY") # Replace with your API key
    # Initialize the Daytona client
    daytona = Daytona(config)
    # Create the Sandbox instance
    sandbox = daytona.create()
    # Run code
    response = sandbox.process.code_run('print("Hello World")')
    print(response.result)

Daytona provides core platform resources for managing sandboxes, environments, and storage.

Daytona provides a comprehensive set of resources for developers and agents to get started and build on the platform. You can find the following resources in the documentation: