## List Agent Sandboxes

`client.SandboxVMs.List(ctx, query) (*Cursor[SandboxVM], error)`

**get** `/v1/sandbox_vms`

List the Agent Sandboxes in a project

### Parameters

- `query SandboxVMListParams`

  - `ProjectID param.Field[string]`

    Project ID of resources to request

  - `Cursor param.Field[string]`

    Pagination cursor returned by a previous request. Only valid for the same sort order.

  - `Limit param.Field[int64]`

    Maximum number of items to return

  - `Name param.Field[string]`

    Filter by a case-insensitive substring of the Agent Sandbox name

  - `Region param.Field[string]`

    Filter by region

  - `Sort param.Field[string]`

    Comma-separated sort terms in precedence order, each field:asc or field:desc. Fields: created_at, updated_at

  - `Tags param.Field[[]string]`

    Filter by tags. Repeat the parameter to require several tags; an Agent Sandbox must carry all of them.

### Returns

- `type SandboxVM struct{…}`

  An Agent Sandbox: a VM sandboxes run on, in one region. It can be paused and resumed.

  - `ID string`

    Unique identifier for the Agent Sandbox.

  - `CreatedAt Time`

    When the Agent Sandbox was created.

  - `EndpointHostname string`

    Hostname the Agent Sandbox's sandbox API is served on over HTTPS. It stays the same for the life of the Agent Sandbox. Null until assigned.

  - `ImageVersion string`

    Version of the image the Agent Sandbox runs. Null until it is running.

  - `InstanceType string`

    Instance type of the Agent Sandbox.

  - `Name string`

    Name of the Agent Sandbox.

  - `OpensandboxVersion string`

    Version of OpenSandbox the Agent Sandbox runs. Null until it is running.

  - `PausedAt Time`

    When the Agent Sandbox was paused. Null while it is running.

  - `PowerState SandboxVMPowerState`

    Whether the Agent Sandbox's sandboxes can run.

    - `const SandboxVMPowerStateRunning SandboxVMPowerState = "running"`

    - `const SandboxVMPowerStatePaused SandboxVMPowerState = "paused"`

    - `const SandboxVMPowerStatePoweredOff SandboxVMPowerState = "powered_off"`

  - `PowersOffAt Time`

    When the paused Agent Sandbox is, or was, powered off. Null while it is running.

  - `ProjectID string`

    ID of the project the Agent Sandbox is in.

  - `Region RegionName`

    Region the resource is in.

    - `const RegionNameUsSva2 RegionName = "us-sva-2"`

    - `const RegionNameUsWdc1 RegionName = "us-wdc-1"`

  - `Status ResourceStatus`

    Status of the resource.

    - `const ResourceStatusPending ResourceStatus = "pending"`

    - `const ResourceStatusCreating ResourceStatus = "creating"`

    - `const ResourceStatusUpdating ResourceStatus = "updating"`

    - `const ResourceStatusReady ResourceStatus = "ready"`

    - `const ResourceStatusDeleting ResourceStatus = "deleting"`

    - `const ResourceStatusDeleted ResourceStatus = "deleted"`

    - `const ResourceStatusError ResourceStatus = "error"`

    - `const ResourceStatusSuspended ResourceStatus = "suspended"`

  - `Tags []string`

    Tags attached to the Agent Sandbox.

  - `UpdatedAt Time`

    When the Agent Sandbox was last updated.

  - `VPCID string`

    ID of the VPC the Agent Sandbox is in. Null until it is placed in one.

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
  "github.com/nirvana-labs/nirvana-go/sandbox_vms"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  page, err := client.SandboxVMs.List(context.TODO(), sandbox_vms.SandboxVMListParams{
    ProjectID: "project_id",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "items": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "created_at": "2025-01-01T00:00:00Z",
      "endpoint_hostname": "0123456789ab.sandboxes.example.com",
      "image_version": "2026.11.1",
      "instance_type": "n1-highcpu-2",
      "name": "my-sandboxes",
      "opensandbox_version": "1.2.0",
      "paused_at": "2025-01-01T00:00:00Z",
      "power_state": "running",
      "powers_off_at": "2025-01-01T01:00:00Z",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "region": "us-sva-2",
      "status": "ready",
      "tags": [
        "production",
        "agents"
      ],
      "updated_at": "2025-01-01T00:00:00Z",
      "vpc_id": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "pagination": {
    "next_cursor": "RhwniMT4B74siYZcPF8TnCdGI1l9rpPvg",
    "previous_cursor": "ARhwnmi1hA7wEbHbMjdYQlOB_ZusP4fYvw",
    "total_count": 125
  }
}
```
