Skip to main content
GET
/
billing
/
usage
Go (SDK)
package main

import(
	"context"
	"os"
	latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
	"log"
)

func main() {
    ctx := context.Background()

    s := latitudeshgosdk.New(
        latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
    )

    res, err := s.Billing.ListUsage(ctx, "proj_6059EqYkOQj8p", []string{
        "si_lvdub7r3",
        "si_utp5nfrf",
    }, latitudeshgosdk.Pointer("plan.name"))
    if err != nil {
        log.Fatal(err)
    }
    if res.BillingUsage != nil {
        // handle response
    }
}
{
  "data": {
    "id": "",
    "type": "billing_usage",
    "attributes": {
      "project": {
        "id": "proj_6059EqYkOQj8p",
        "slug": "ergonomic-marble-shoes",
        "name": "Ergonomic Marble Shoes"
      },
      "period": {
        "start": "2025-06-25T18:36:28+00:00",
        "end": "2025-07-26T18:36:28+00:00"
      },
      "available_credit_balance": 123,
      "amount": 0,
      "price": 0,
      "products": [],
      "threshold": 10000
    }
  },
  "meta": {}
}

Authorizations

Authorization
string
header
required

Query Parameters

filter[products][]
string[]

Allows to filter the billing usage for specific products. It accepts an array of product ids.

filter[plan]
string

Accepts a plan name and allows to filter the usage for that plan.

filter[project]
string
required

Response

200 - application/vnd.api+json

Success

data
object