SDK Documentation
The Daytona SDK provides official Python and TypeScript interfaces for interacting with Daytona, enabling you to programmatically manage development environments and execute code.
Quick Start
pip install daytona_sdk
from daytona_sdk import Daytona, DaytonaConfig
# Define the configurationconfig = DaytonaConfig( api_key="your-api-key", server_url="your-server-url", target="us")
# Initialize the Daytona clientdaytona = Daytona(config)
# Create the workspace instanceworkspace = daytona.create()
# Run the code securely inside the workspaceresponse = workspace.process.code_run('print("Hello World from code!")')if response.exit_code != 0: print(f"Error: {response.exit_code} {response.result}")else: print(response.result)
daytona.remove(workspace)
npm install @daytonaio/sdk
import { Daytona } from '@daytonaio/sdk';
// Initialize the Daytona clientconst daytona = new Daytona({ apiKey: 'your-api-key', serverUrl: 'your-server-url', target: 'us'});
// Create the workspace instanceconst workspace = await daytona.create({ language: 'typescript',});
// Run the code securely inside the workspaceconst response = await workspace.process.codeRun('console.log("Hello World from code!")')console.log(response.result);
About
Workspaces
Agent Toolbox
- File System Operations
Learn how to manage files and directories in your Workspaces using the Daytona SDK. - Git Operations
Learn how to manage Git repositories in your Workspaces using the Daytona SDK. - Process & Code Execution
Learn about running commands and code in isolated environments using the Daytona SDK. - Language Server Protocol
Learn how to use Language Server Protocol (LSP) support in your Workspaces using the Daytona SDK.