Skip to content
DocsOpenAPI spec

    Estimate Sandbox Cluster Create Cost

    client.SandboxClusters.Cost.New(ctx, body) (*CostQuote, error)
    POST/v1/sandbox_clusters/cost

    Return a priced cost quote for the proposed Sandbox Cluster.

    ParametersExpand Collapse
    body CostNewParams
    InstanceType param.Field[string]

    Instance type of the nodes the sandboxes run on.

    Name param.Field[string]

    Name of the Sandbox Cluster. Unique within its project.

    NodeCount param.Field[int64]

    Number of nodes the sandboxes run on.

    maximum100
    minimum1
    ProjectID param.Field[string]

    ID of the project to create the Sandbox Cluster in.

    Region param.Field[RegionName]

    Region the resource is in.

    Tags param.Field[[]string]Optional

    Tags to attach to the Sandbox Cluster.

    ReturnsExpand Collapse
    type CostQuote struct{…}

    Cost quote returned by POST /cost. current_summary and updated_summary hold the org billing summary now and with this resource; omitted when the caller cannot view billing.

    Currency string

    Currency the quote is denominated in. Always “USD” in v1.

    MonthlyTotal string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    PricedAt Time

    Timestamp the quote was priced at.

    formatdate-time
    UsageDimensions []CostQuoteUsageDimension

    Priced rows, one per usage dimension emitted by the resource.

    Dimension string

    Usage dimension being priced (e.g. compute_vcpu, storage_abs_gb).

    DimensionDisplayName string

    User-facing label for the dimension (e.g. “vCPU (hours)”).

    MonthlyAmount string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    Quantity int64

    Quantity of the dimension being priced.

    UnitPrice string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    CurrentSummary OrganizationBillingSummaryOptional

    Forward-looking billing summary for an organization. All costs are run-rate projections from the organization’s current active usage (”≈ $X/mo at current usage”).

    DailyCost string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    EffectiveBalance string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    MonthlyCost string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    RechargeThresholdDays string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    EstimatedNextChargeAt TimeOptional

    Projected date the balance reaches the recharge threshold at the current run-rate. Null when there is no active usage (never charges).

    formatdate-time
    RunwayMonths stringOptional

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    UpdatedSummary OrganizationBillingSummaryOptional

    Forward-looking billing summary for an organization. All costs are run-rate projections from the organization’s current active usage (”≈ $X/mo at current usage”).

    DailyCost string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    EffectiveBalance string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    MonthlyCost string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    RechargeThresholdDays string

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal
    EstimatedNextChargeAt TimeOptional

    Projected date the balance reaches the recharge threshold at the current run-rate. Null when there is no active usage (never charges).

    formatdate-time
    RunwayMonths stringOptional

    Arbitrary-precision decimal serialized as a string (e.g. “58.40”).

    formatdecimal

    Estimate Sandbox Cluster Create Cost

    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_clusters"
      "github.com/nirvana-labs/nirvana-go/shared"
    )
    
    func main() {
      client := nirvana.NewClient(
        option.WithAPIKey("My API Key"),
      )
      costQuote, err := client.SandboxClusters.Cost.New(context.TODO(), sandbox_clusters.CostNewParams{
        InstanceType: "n1-standard-8",
        Name: "my-sandboxes",
        NodeCount: 3,
        ProjectID: "123e4567-e89b-12d3-a456-426614174000",
        Region: shared.RegionNameUsSva2,
      })
      if err != nil {
        panic(err.Error())
      }
      fmt.Printf("%+v\n", costQuote.Currency)
    }
    
    {
      "currency": "USD",
      "monthly_total": "-69125",
      "priced_at": "2025-01-01T00:00:00Z",
      "usage_dimensions": [
        {
          "dimension": "compute_vcpu",
          "dimension_display_name": "vCPU (hours)",
          "monthly_amount": "-69125",
          "quantity": 4,
          "unit_price": "-69125"
        }
      ],
      "current_summary": {
        "daily_cost": "-69125",
        "effective_balance": "-69125",
        "monthly_cost": "-69125",
        "recharge_threshold_days": "-69125",
        "estimated_next_charge_at": "2025-01-01T00:00:00Z",
        "runway_months": "-69125"
      },
      "updated_summary": {
        "daily_cost": "-69125",
        "effective_balance": "-69125",
        "monthly_cost": "-69125",
        "recharge_threshold_days": "-69125",
        "estimated_next_charge_at": "2025-01-01T00:00:00Z",
        "runway_months": "-69125"
      }
    }
    Returns Examples
    {
      "currency": "USD",
      "monthly_total": "-69125",
      "priced_at": "2025-01-01T00:00:00Z",
      "usage_dimensions": [
        {
          "dimension": "compute_vcpu",
          "dimension_display_name": "vCPU (hours)",
          "monthly_amount": "-69125",
          "quantity": 4,
          "unit_price": "-69125"
        }
      ],
      "current_summary": {
        "daily_cost": "-69125",
        "effective_balance": "-69125",
        "monthly_cost": "-69125",
        "recharge_threshold_days": "-69125",
        "estimated_next_charge_at": "2025-01-01T00:00:00Z",
        "runway_months": "-69125"
      },
      "updated_summary": {
        "daily_cost": "-69125",
        "effective_balance": "-69125",
        "monthly_cost": "-69125",
        "recharge_threshold_days": "-69125",
        "estimated_next_charge_at": "2025-01-01T00:00:00Z",
        "runway_months": "-69125"
      }
    }