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.
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_fraction": "-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_fraction": "-69125",
"estimated_next_charge_at": "2025-01-01T00:00:00Z",
"runway_months": "-69125"
}