Read-only billing/cost API for organizations

Hello!

Is there a supported way to query the an organization’s cost for a billing period? The figures exist (CostExplorer and Upcoming Invoice render them in the dashboard), but every route I found to them is one I shouldn’t build on.

My ask is more or less a read-only REST endpoint under the Machines API, returning:

  • the current period’s accrued cost
  • the period’s start and end
  • past invoices (period covered + total)

I’m working on tooling that monitors usage costs on a rolling basis, my current options right now are to:

  • Scrape the dashboard which is far from ideal for obvious reasons
  • Leverage api.fly.io/graphql which I checked for this info and found it lacking, but that’s also another undocumented/irresponsible route
  • Possibly pulling App.usage but I don’t seem to be able to get the information I need out of it to properly do cost calculations

flyctl has no billing command either. So there’s no supported surface to build on, which is why I’m asking for one rather than picking whichever hack works this month.

I’ve shopped around some other platforms to see if they support similar functionality and it seems like most do.

Something like:

curl -i -X GET \
  -H "Authorization: Bearer ${FLY_API_TOKEN}" \
  "${FLY_API_HOSTNAME}/v1/orgs/my-org/billing/current"

That responds with something akin to:

{
  "period_start": "2026-07-01T00:00:00Z",
  "period_end": "2026-08-01T00:00:00Z",
  "generated_at": "2026-07-29T14:02:11Z",
  "accrued": { "amount_cents": 4720, "currency": "USD" },
  "estimated_total": { "amount_cents": 6180, "currency": "USD" },
  "net_of_credits": true,
  "apps": [
    { "name": "my-app", "amount_cents": 4180 },
    { "name": "another-app", "amount_cents": 540 }
  ]
}

And an invoice endpoint like:

curl -i -X GET \
  -H "Authorization: Bearer ${FLY_API_TOKEN}" \
  "${FLY_API_HOSTNAME}/v1/orgs/my-org/billing/invoices"

That responds with something like:

{
  "invoices": [
    {
      "id": "inv_01J8…",
      "period_start": "2026-06-01T00:00:00Z",
      "period_end": "2026-07-01T00:00:00Z",
      "total": { "amount_cents": 5133, "currency": "USD" },
      "status": "paid",
      "updated_at": "2026-07-02T09:14:00Z",
      "supersedes_id": null,
      "items": [
        { "app": "my-app", "description": "compute", "amount_cents": 4180 },
        { "app": "my-app", "description": "volume 1GB", "amount_cents": 15 }
      ]
    }
  ]
}

Thanks! This is really the one gap I’ve found with the platform and love working with it otherwise.