SDKs & Tools
Nirvana Labs provides official SDKs, CLI tools, and infrastructure-as-code integrations to help you interact with the Nirvana API programmatically.
Available SDKs
Section titled “Available SDKs”| SDK | Package | Repository |
|---|---|---|
| TypeScript | @nirvana-labs/nirvana | GitHub |
| Go | nirvana-go | GitHub |
Infrastructure & Automation
Section titled “Infrastructure & Automation”| Tool | Package | Repository |
|---|---|---|
| Terraform | nirvana-labs/nirvana | GitHub |
| CLI | - | GitHub |
| MCP | @nirvana-labs/nirvana-mcp | GitHub |
Examples
Section titled “Examples”# Declare the provider and versionterraform { required_providers { nirvana = { source = "nirvana-labs/nirvana" version = "~> 1.24.2" } }}
# Initialize the providerprovider "nirvana" { api_key = "My API Key" # or set NIRVANA_LABS_API_KEY env variable}
# Configure a resourceresource "nirvana_compute_vm" "example_compute_vm" { boot_volume = { size = 100 type = "nvme" tags = ["production", "ethereum"] } cpu_config = { vcpu = 2 } memory_config = { size = 2 } name = "my-vm" os_image_name = "ubuntu-noble-2025-10-01" public_ip_enabled = true region = "us-wdc-1" ssh_key = { public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2" } subnet_id = "123e4567-e89b-12d3-a456-426614174000" data_volumes = [{ name = "my-data-volume" size = 100 type = "nvme" tags = ["production", "ethereum"] }] tags = ["production", "ethereum"]}curl https://api.nirvanalabs.io/v1/compute/vms \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $NIRVANA_LABS_API_KEY" \ -d '{ "boot_volume": { "size": 100, "type": "nvme" }, "cpu_config": { "vcpu": 2 }, "memory_config": { "size": 2 }, "name": "my-vm", "os_image_name": "ubuntu-noble-2025-10-01", "public_ip_enabled": true, "region": "us-wdc-1", "ssh_key": { "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2" }, "subnet_id": "123e4567-e89b-12d3-a456-426614174000", "tags": [ "production", "ethereum" ] }'package main
import ( "context" "fmt"
"github.com/nirvana-labs/nirvana-go" "github.com/nirvana-labs/nirvana-go/compute" "github.com/nirvana-labs/nirvana-go/option" "github.com/nirvana-labs/nirvana-go/shared")
func main() { client := nirvana.NewClient( option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("NIRVANA_LABS_API_KEY") ) operation, err := client.Compute.VMs.New(context.TODO(), compute.VMNewParams{ BootVolume: compute.VMNewParamsBootVolume{ Size: 100, Type: compute.VolumeTypeNvme, }, CPUConfig: compute.CPUConfigRequestParam{ Vcpu: 2, }, MemoryConfig: compute.MemoryConfigRequestParam{ Size: 2, }, Name: "my-vm", OSImageName: "ubuntu-noble-2025-10-01", PublicIPEnabled: true, Region: shared.RegionNameUsWdc1, SSHKey: compute.SSHKeyRequestParam{ PublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2", }, SubnetID: "123e4567-e89b-12d3-a456-426614174000", }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", operation.ID)}import NirvanaLabs from '@nirvana-labs/nirvana';
const client = new NirvanaLabs({ apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted});
const operation = await client.compute.vms.create({ boot_volume: { size: 100, type: 'nvme' }, cpu_config: { vcpu: 2 }, memory_config: { size: 2 }, name: 'my-vm', os_image_name: 'ubuntu-noble-2025-10-01', public_ip_enabled: true, region: 'us-wdc-1', ssh_key: { public_key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDBIASkmwNiLcdlW6927Zjt1Hf7Kw/PpEZ4Zm+wU9wn2', }, subnet_id: '123e4567-e89b-12d3-a456-426614174000',});
console.log(operation.id);nirvana compute:vms create \ --name my-vm \ --region us-wdc-1 \ --boot-volume '{"size": 100, "type": "nvme"}' \ --cpu-config '{"vcpu": 2}' \ --memory-config '{"size": 2}' \ --os-image-name ubuntu-24.04 \ --public-ip-enabled true \ --subnet-id subnet-uuid \ --ssh-key '{"public_key": "ssh-ed25519 AAAA..."}'