--- title: SDKs & Tools source_url: html: https://docs.nirvanalabs.io/sdks/ md: https://docs.nirvanalabs.io/sdks/index.md --- import { Tabs, TabItem } from '@astrojs/starlight/components'; Nirvana Labs provides official SDKs, CLI tools, and infrastructure-as-code integrations to help you interact with the Nirvana API programmatically. ## Available SDKs | SDK | Package | Repository | |-----|---------|------------| | TypeScript | [@nirvana-labs/nirvana](https://www.npmjs.com/package/@nirvana-labs/nirvana) | [GitHub](https://github.com/nirvana-labs/nirvana-typescript) | | Go | [nirvana-go](https://pkg.go.dev/github.com/nirvana-labs/nirvana-go) | [GitHub](https://github.com/nirvana-labs/nirvana-go) | ## Infrastructure & Automation | Tool | Package | Repository | |------|---------|------------| | Terraform | [nirvana-labs/nirvana](https://registry.terraform.io/providers/nirvana-labs/nirvana/latest) | [GitHub](https://github.com/nirvana-labs/terraform-provider-nirvana) | | CLI | - | [GitHub](https://github.com/nirvana-labs/nirvana-cli) | | MCP | [@nirvana-labs/nirvana-mcp](https://www.npmjs.com/package/@nirvana-labs/nirvana-mcp) | [GitHub](https://github.com/nirvana-labs/nirvana-typescript/tree/main/packages/mcp-server) | ## Examples ```hcl # Declare the provider and version terraform { required_providers { nirvana = { source = "nirvana-labs/nirvana" version = "~> 1.24.2" } } } # Initialize the provider provider "nirvana" { api_key = "My API Key" # or set NIRVANA_LABS_API_KEY env variable } # Configure a resource resource "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"] } ``` ```bash 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" ] }' ``` ```go 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) } ``` ```typescript 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); ``` ```bash 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..."}' ```