daytona-sdk 0.161.0


pip install daytona-sdk

  Latest version

Released: Apr 03, 2026

Project Links

Meta
Author: Daytona Platforms Inc.
Requires Python: >=3.9,<4.0

Classifiers

Development Status
  • 3 - Alpha

Intended Audience
  • Developers

Programming Language
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

Daytona Python SDK

The official Python SDK for Daytona, an open-source, secure and elastic infrastructure for running AI-generated code. Daytona provides full composable computers โ€” sandboxes โ€” that you can manage programmatically using the Daytona SDK.

The SDK provides an interface for sandbox management, file system operations, Git operations, language server protocol support, process and code execution, and computer use. For more information, see the documentation.

Installation

Install the package using pip:

pip install daytona

Get API key

Generate an API key from the Daytona Dashboard โ†— to authenticate SDK requests and access Daytona services. For more information, see the API keys documentation.

Configuration

Configure the SDK using environment variables or by passing a configuration object:

  • DAYTONA_API_KEY: Your Daytona API key
  • DAYTONA_API_URL: The Daytona API URL
  • DAYTONA_TARGET: Your target region environment (e.g. us, eu)
from daytona import Daytona, DaytonaConfig

# Initialize with environment variables
daytona = Daytona()

# Initialize with configuration object
config = DaytonaConfig(
    api_key="YOUR_API_KEY",
    api_url="YOUR_API_URL",
    target="us"
)

Create a sandbox

Create a sandbox to run your code securely in an isolated environment.

from daytona import Daytona, DaytonaConfig

config = DaytonaConfig(api_key="YOUR_API_KEY")
daytona = Daytona(config)
sandbox = daytona.create()
response = sandbox.process.code_run('print("Hello World")')

Examples and guides

Daytona provides examples and guides for common sandbox operations, best practices, and a wide range of topics, from basic usage to advanced topics, showcasing various types of integrations between Daytona and other tools.

Create a sandbox with custom resources

Create a sandbox with custom resources (CPU, memory, disk).

from daytona import Daytona, CreateSandboxFromImageParams, Image, Resources

daytona = Daytona()
sandbox = daytona.create(
    CreateSandboxFromImageParams(
        image=Image.debian_slim("3.12"),
        resources=Resources(cpu=2, memory=4, disk=8)
    )
)

Create an ephemeral sandbox

Create an ephemeral sandbox that is automatically deleted when stopped.

from daytona import Daytona, CreateSandboxFromSnapshotParams

daytona = Daytona()
sandbox = daytona.create(
    CreateSandboxFromSnapshotParams(ephemeral=True, auto_stop_interval=5)
)

Create a sandbox from a snapshot

Create a sandbox from a snapshot.

from daytona import Daytona, CreateSandboxFromSnapshotParams

daytona = Daytona()
sandbox = daytona.create(
    CreateSandboxFromSnapshotParams(
        snapshot="my-snapshot-name",
        language="python"
    )
)

Execute Commands

Execute commands in the sandbox.

# Execute a shell command
response = sandbox.process.exec('echo "Hello, World!"')
print(response.result)

# Run Python code
response = sandbox.process.code_run('''
x = 10
y = 20
print(f"Sum: {x + y}")
''')
print(response.result)

File Operations

Upload, download, and search files in the sandbox.

# Upload a file
sandbox.fs.upload_file(b'Hello, World!', 'path/to/file.txt')

# Download a file
content = sandbox.fs.download_file('path/to/file.txt')

# Search for files
matches = sandbox.fs.find_files(root_dir, 'search_pattern')

Git Operations

Clone, list branches, and add files to the sandbox.

# Clone a repository
sandbox.git.clone('https://github.com/example/repo', 'path/to/clone')

# List branches
branches = sandbox.git.branches('path/to/repo')

# Add files
sandbox.git.add('path/to/repo', ['file1.txt', 'file2.txt'])

Language Server Protocol

Create and start a language server to get code completions, document symbols, and more.

# Create and start a language server
lsp = sandbox.create_lsp_server('python', 'path/to/project')
lsp.start()

# Notify the lsp for the file
lsp.did_open('path/to/file.py')

# Get document symbols
symbols = lsp.document_symbols('path/to/file.py')

# Get completions
completions = lsp.completions('path/to/file.py', {"line": 10, "character": 15})

Contributing

Daytona is Open Source under the Apache License 2.0, and is the copyright of its contributors. If you would like to contribute to the software, read the Developer Certificate of Origin Version 1.1 (https://developercertificate.org/). Afterwards, navigate to the contributing guide to get started.

Code in _sync directory shouldn't be edited directly. It should be generated from the corresponding async code in the _async directory using the sync_generator.py script.

0.161.0 Apr 03, 2026
0.160.0 Apr 02, 2026
0.159.0 Mar 31, 2026
0.159.0a2 Mar 30, 2026
0.158.1 Mar 30, 2026
0.158.0 Mar 27, 2026
0.157.0 Mar 26, 2026
0.155.1a2 Mar 26, 2026
0.155.1a1 Mar 25, 2026
0.155.0 Mar 24, 2026
0.154.0 Mar 24, 2026
0.153.0 Mar 19, 2026
0.152.1 Mar 18, 2026
0.152.0 Mar 17, 2026
0.151.0 Mar 13, 2026
0.150.0 Mar 10, 2026
0.149.0 Mar 05, 2026
0.149.0rc2 Mar 04, 2026
0.149.0rc1 Mar 03, 2026
0.149.0a2 Mar 04, 2026
0.149.0a1 Mar 03, 2026
0.148.0 Feb 27, 2026
0.147.0 Feb 27, 2026
0.146.1rc3 Feb 26, 2026
0.146.1rc2 Feb 26, 2026
0.146.1rc1 Feb 26, 2026
0.146.0 Feb 25, 2026
0.145.0 Feb 24, 2026
0.144.0 Feb 20, 2026
0.143.0 Feb 13, 2026
0.142.0 Feb 12, 2026
0.141.0 Feb 11, 2026
0.140.0 Feb 10, 2026
0.139.0 Feb 03, 2026
0.138.0 Jan 30, 2026
0.136.0 Jan 28, 2026
0.135.0 Jan 26, 2026
0.134.0 Jan 21, 2026
0.133.0 Jan 20, 2026
0.132.0 Jan 18, 2026
0.131.0rc4 Jan 16, 2026
0.131.0rc3 Jan 16, 2026
0.131.0rc2 Jan 16, 2026
0.131.0rc1 Jan 16, 2026
0.131.0a3 Mar 03, 2026
0.131.0a2 Feb 09, 2026
0.131.0a1 Jan 17, 2026
0.130.0 Jan 12, 2026
0.129.0 Jan 08, 2026
0.128.2a1 Dec 26, 2025
0.128.1 Dec 23, 2025
0.128.0 Dec 23, 2025
0.127.0 Dec 19, 2025
0.127.0rc2 Dec 19, 2025
0.127.0rc1 Dec 19, 2025
0.125.1a3 Dec 18, 2025
0.125.1a2 Dec 17, 2025
0.125.1a1 Dec 17, 2025
0.125.0 Dec 15, 2025
0.125.0rc1 Dec 12, 2025
0.124.0 Dec 11, 2025
0.123.0 Dec 09, 2025
0.122.0 Dec 09, 2025
0.121.0 Dec 03, 2025
0.120.0 Dec 01, 2025
0.119.0 Nov 27, 2025
0.118.0 Nov 27, 2025
0.118.0a1 Nov 24, 2025
0.117.0 Nov 22, 2025
0.116.0 Nov 21, 2025
0.116.0a1 Nov 21, 2025
0.115.2 Nov 19, 2025
0.115.1 Nov 19, 2025
0.115.1a7 Nov 14, 2025
0.115.0 Nov 14, 2025
0.114.0 Nov 13, 2025
0.114.0a1 Nov 10, 2025
0.113.2 Nov 13, 2025
0.113.1 Nov 07, 2025
0.113.0 Nov 06, 2025
0.112.3 Nov 05, 2025
0.112.3a2 Nov 04, 2025
0.112.3a1 Nov 03, 2025
0.112.2 Oct 31, 2025
0.112.2rc1 Oct 28, 2025
0.112.1 Oct 27, 2025
0.112.0 Oct 24, 2025
0.112.0.dev4317853 Oct 28, 2025
0.112.0.dev462455 Oct 20, 2025
0.111.1 Oct 21, 2025
0.111.0 Oct 18, 2025
0.110.2 Oct 14, 2025
0.110.1 Oct 11, 2025
0.110.0 Oct 11, 2025
0.109.0 Oct 09, 2025
0.109.0a2 Oct 09, 2025
0.109.0a1 Oct 08, 2025
0.108.1 Oct 07, 2025
0.108.1rc1 Oct 07, 2025
0.108.0 Oct 03, 2025
0.108.0rc1 Oct 03, 2025
0.107.1 Oct 02, 2025
0.107.0rc2 Sep 30, 2025
0.107.0rc1 Sep 26, 2025
0.106.5 Oct 01, 2025
0.106.4 Sep 30, 2025
0.106.1 Sep 26, 2025
0.106.0a3 Sep 26, 2025
0.106.0a2 Sep 26, 2025
0.106.0a1 Sep 26, 2025
0.105.1 Sep 25, 2025
0.105.0 Sep 25, 2025
0.104.0rc2 Sep 22, 2025
0.104.0rc1 Sep 22, 2025
0.103.0 Sep 19, 2025
0.103.0rc3 Sep 17, 2025
0.103.0rc2 Sep 17, 2025
0.103.0rc1 Sep 17, 2025
0.102.0 Sep 17, 2025
0.102.0rc2 Sep 12, 2025
0.102.0rc1 Sep 11, 2025
0.28.0rc1 Sep 09, 2025
0.27.1 Sep 11, 2025
0.27.0 Sep 08, 2025
0.27.0rc1 Sep 05, 2025
0.26.0 Sep 03, 2025
0.26.0rc2 Sep 01, 2025
0.26.0rc1 Aug 20, 2025
0.26.0a12 Aug 14, 2025
0.26.0a11 Aug 14, 2025
0.25.6 Aug 25, 2025
0.25.5 Aug 06, 2025
0.25.4 Aug 01, 2025
0.25.3 Aug 01, 2025
0.25.2a1 Aug 01, 2025
0.25.2a0 Aug 01, 2025
0.25.1 Jul 30, 2025
0.25.0 Jul 29, 2025
0.24.5 Jul 26, 2025
0.24.4 Jul 26, 2025
0.24.2 Jul 21, 2025
0.24.1 Jul 16, 2025
0.24.0 Jul 16, 2025
0.23.0 Jul 14, 2025
0.22.2a0 Jul 10, 2025
0.22.1 Jul 14, 2025
0.22.0 Jul 08, 2025
0.22.0a6 Jul 04, 2025
0.22.0a5 Jul 04, 2025
0.21.8 Jul 04, 2025
0.21.7 Jul 03, 2025
0.21.6 Jul 02, 2025
0.21.5 Jun 30, 2025
0.21.5a8 Jun 24, 2025
0.21.4 Jun 24, 2025
0.21.4a16 Jun 23, 2025
0.21.4a15 Jun 23, 2025
0.21.4a14 Jun 23, 2025
0.21.4a12 Jun 23, 2025
0.21.4a11 Jun 23, 2025
0.21.4a2 Jun 23, 2025
0.21.4a1 Jun 23, 2025
0.21.4a0 Jun 23, 2025
0.21.3 Jun 22, 2025
0.21.3a0 Jun 20, 2025
0.21.2 Jun 20, 2025
0.21.1 Jun 17, 2025
0.21.0 Jun 15, 2025
0.21.0a4 Jun 13, 2025
0.21.0a3 Jun 13, 2025
0.21.0a2 Jun 13, 2025
0.21.0a0 Jun 11, 2025
0.20.2 Jun 04, 2025
0.20.0 Jun 04, 2025
0.19.1a1 Jun 03, 2025
0.19.1a0 Jun 03, 2025
0.19.0 Jun 02, 2025
0.19.0a7 May 28, 2025
0.19.0a6 May 28, 2025
0.19.0a5 May 28, 2025
0.19.0a1 May 28, 2025
0.19.0a0 May 26, 2025
0.18.2 May 29, 2025
0.18.2a0 May 29, 2025
0.18.1 May 23, 2025
0.18.0 May 22, 2025
0.18.0a3 May 22, 2025
0.18.0a2 May 21, 2025
0.18.0a1 May 09, 2025
0.18.0a0 May 08, 2025
0.17.0 May 07, 2025
0.17.0a1 May 07, 2025
0.17.0a0 May 07, 2025
0.16.1 May 06, 2025
0.16.0 May 05, 2025
0.16.0a5 May 06, 2025
0.16.0a3 May 05, 2025
0.16.0a2 Apr 29, 2025
0.16.0a1 Apr 25, 2025
0.16.0a0 Apr 24, 2025
0.15.0 Apr 23, 2025
0.14.0 Apr 14, 2025
0.13.1 Apr 14, 2025
0.12.2a1 Apr 09, 2025
0.12.1 Apr 07, 2025
0.12.0 Apr 02, 2025
0.11.3 Apr 01, 2025
0.11.2 Mar 27, 2025
0.11.1 Mar 26, 2025
0.11.0 Mar 26, 2025
0.11.0a0 Mar 25, 2025
0.10.5 Mar 20, 2025
0.10.4 Mar 17, 2025
0.10.3 Mar 16, 2025
0.10.3a1 Mar 13, 2025
0.10.2 Mar 08, 2025
0.10.1 Mar 05, 2025
0.10.0 Mar 04, 2025
0.9.1 Feb 09, 2025
0.9.0 Feb 03, 2025
0.8.0 Feb 03, 2025
0.7.1 Jan 30, 2025
0.7.0 Jan 29, 2025
0.6.0 Jan 23, 2025
0.5.1 Jan 22, 2025
0.5.0 Jan 14, 2025
0.4.2 Jan 22, 2025
0.4.1 Jan 12, 2025
0.4.0 Jan 10, 2025
0.3.4 Jan 09, 2025
0.3.3 Jan 09, 2025
0.3.2 Jan 09, 2025
0.3.1 Jan 09, 2025
0.3.0 Jan 09, 2025
0.2.0 Jan 09, 2025
0.1.4 Jan 08, 2025
0.1.3 Dec 22, 2024

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
Deprecated (<2.0.0,>=1.2.18)
aiofiles (<24.2.0,>=24.1.0)
daytona-api-client (==0.161.0)
daytona-api-client-async (==0.161.0)
daytona-toolbox-api-client (==0.161.0)
daytona-toolbox-api-client-async (==0.161.0)
httpx (<0.29.0,>=0.28.0)
obstore (<0.9.0,>=0.8.0)
opentelemetry-api (<2.0.0,>=1.27.0)
opentelemetry-exporter-otlp-proto-http (<2.0.0,>=1.27.0)
opentelemetry-instrumentation-aiohttp-client (>=0.59b0)
opentelemetry-sdk (<2.0.0,>=1.27.0)
pydantic (<3.0.0,>=2.4.2)
python-dotenv (<2.0.0,>=1.0.0)
python-multipart (<0.1.0,>=0.0.15)
toml (<0.11.0,>=0.10.0)
typing-extensions (>=4.0.0)
urllib3 (<3.0.0,>=2.1.0)
websockets (<16.0.0,>=15.0.0)