TensorDock

API Documentation

Learn how to integrate with our API to manage your virtual machines and resources.

Instance Creation

Create virtual machine instances using either direct hostnode deployment or automatic location-based deployment.

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:

runcmd

Optional array of commands to run during the first boot. These commands are executed after the system is fully booted.

packages

Optional array of package names to install during the first boot.

package_update

Optional boolean flag to update the package list during first boot. Defaults to false.

package_upgrade

Optional boolean flag to upgrade all installed packages during first boot. Defaults to false.

write_files

Optional 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:

{
  "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"
      }
    ]
  }
}