API Documentation
Learn how to integrate with our API
API Version
v2
API Documentation
Version 2.0
Documentation Sections
Instance Creation
Create virtual machine instances with GPU acceleration
Deployment Options: Use location-based deployment for automatic hostnode selection and simplified setup, or choose direct hostnode deployment for full control over placement, port configuration, and resource allocation.
Configure Your Instance
Select your deployment options to generate the API request
Generated API Request
POST /api/v2/instances
{
  "data": {
    "type": "virtualmachine",
    "attributes": {
      "name": "my-ubuntu-instance",
      "type": "virtualmachine",
      "image": "ubuntu2404",
      "resources": {
        "vcpu_count": 4,
        "ram_gb": 8,
        "storage_gb": 200,
        "gpus": {
          "geforcertx4090-pcie-24gb": {
            "count": 2
          }
        }
      },
      "location_id": "loc-uuid-12345",
      "useDedicatedIp": true,
      "ssh_key": "sshkey placeholder"
    }
  }
}Key Requirements
- • Minimum storage: 100GB
- • Minimum balance: $1
- • At least one GPU required for location-based deployment
- • SSH key required
Example Response
Successful instance creation returns
{
  "data": {
    "type": "virtualmachine",
    "id": "instance-uuid",
    "name": "my-ubuntu-instance",
    "status": "running"
  }
}Cloud Init Configuration
Configure initial setup and packages for your virtual machine instance
The cloud_init object allows you to configure the initial setup of your virtual machine. It supports the following options:
runcmdOptional array of commands to run during the first boot. These commands are executed after the system is fully booted.
packagesOptional array of package names to install during the first boot.
package_updateOptional boolean flag to update the package list during first boot. Defaults to false.
package_upgradeOptional boolean flag to upgrade all installed packages during first boot. Defaults to false.
write_filesOptional array of files to write during first boot. Each file object contains:
- path- The file path to write to
- content- The content to write
- owner- Optional file owner (default: root:root)
- permissions- Optional file permissions (e.g., '0644')
Example Configuration
{
  "cloud_init": {
    "runcmd": [
      "echo 'Hello World'",
      "apt-get update",
      "apt-get install -y nginx"
    ],
    "packages": [
      "curl",
      "git"
    ],
    "package_update": true,
    "package_upgrade": false,
    "write_files": [
      {
        "path": "/etc/motd",
        "content": "Welcome to your TensorDock instance!",
        "owner": "root:root",
        "permissions": "0644"
      }
    ]
  }
}