Skip to content
Docs

    Get Organization Billing Summary

    client.Organizations.Billing.Summary(ctx, organizationID) (*OrganizationBillingSummary, error)
    GET/v1/organizations/{organization_id}/billing/summary

    Get the organization’s billing summary: effective balance, monthly and daily run-rate cost, runway, and the projected next-recharge date. Costs are run-rate projections.

    ParametersExpand Collapse
    organizationID string
    ReturnsExpand Collapse
    type OrganizationBillingSummary struct{…}

    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

    Get Organization Billing Summary

    package main
    
    import (
      "context"
      "fmt"
    
      "github.com/nirvana-labs/nirvana-go"
      "github.com/nirvana-labs/nirvana-go/option"
    )
    
    func main() {
      client := nirvana.NewClient(
        option.WithAPIKey("My API Key"),
      )
      organizationBillingSummary, err := client.Organizations.Billing.Summary(context.TODO(), "organization_id")
      if err != nil {
        panic(err.Error())
      }
      fmt.Printf("%+v\n", organizationBillingSummary.DailyCost)
    }
    
    {
      "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
    {
      "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"
    }