Menu

1 / 2

Get your Neon's Usage Cost report and stay on top of it

DEV Community: cloud·Kiran (AK) Adapa·about 4 hours ago
#6V8ZOoxt
#devtocloud#devto#dev#neon#project
Reading 0:00
15s threshold

If you have multiple projects on Neon (neon.tech) under one organization, then it is a good idea to get a costs/spend report by project and keep tabs on for better operations/planning.

Neon bills compute by CU-hours, but its dashboard doesn't give you a simple monthly cost breakdown per project. I wrote a small Node.js script that pulls Neon's per-project consumption history and turns it into a CSV rollup: one row per project, total CU-seconds, CU-hours, and cost in dollars — plus an org-wide TOTAL row.

THE PROBLEM

Neon's usage API returns raw metrics per project per day (CU-seconds, storage bytes, network transfer, etc.), but you have to stitch together several steps to get a usable cost figure:

Fetch consumption history for a calendar month

Handle pagination (the API uses a cursor)

Convert CU-seconds to CU-hours, then multiply by your plan's rate

Flatten nested metrics into CSV columns

Build a cost rollup per project

The script takes a month argument (e.g.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.