## Get Organization Daily Cost

`client.Organizations.Billing.Cost(ctx, organizationID, query) (*OrganizationDailyCost, error)`

**get** `/v1/organizations/{organization_id}/billing/cost`

Get the organization's total usage cost per UTC day over a date range (max 90 days), summing open and closed resources. One entry per day, oldest first. Defaults to the last 30 days.

### Parameters

- `organizationID string`

- `query BillingCostParams`

  - `From param.Field[Time]`

    Inclusive start day, YYYY-MM-DD (UTC). Defaults to 30 days before to.

  - `To param.Field[Time]`

    Inclusive end day, YYYY-MM-DD (UTC). Defaults to today.

### Returns

- `type OrganizationDailyCost struct{…}`

  Daily usage cost over a date range: one entry per UTC day (zero on idle days), summing open and closed resources. Suitable for a daily cost bar chart.

  - `Currency string`

    ISO 4217 currency code.

  - `Days []DailyCostPoint`

    One entry per UTC day in the range, oldest first.

    - `Cost string`

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

    - `Date string`

      UTC calendar day (YYYY-MM-DD).

  - `From string`

    Inclusive start of the range, as a UTC calendar day (YYYY-MM-DD).

  - `To string`

    Inclusive end of the range, as a UTC calendar day (YYYY-MM-DD).

### 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/organizations"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  organizationDailyCost, err := client.Organizations.Billing.Cost(
    context.TODO(),
    "organization_id",
    organizations.BillingCostParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", organizationDailyCost.Currency)
}
```

#### Response

```json
{
  "currency": "USD",
  "days": [
    {
      "cost": "-69125",
      "date": "2026-07-07"
    }
  ],
  "from": "2026-06-08",
  "to": "2026-07-08"
}
```
