Programatic API limits?

Is it possible to set limits on a database usage via the API?

I want to create many different databases, each of which have limits set on the database-level, not the user level.

If you have a Neon Pro Plan account, you can set limits via the API for Neon’s consumption metrics at a project level. Consumption metrics include:

  • active_time_seconds
  • compute_time_seconds
  • written_data_bytes
  • data_transfer_bytes

You can also limit the storage size for branches in a Neon project by setting “logical_size_bytes”. In Neon, you can create one or more databases on a branch, so limiting branch storage would limit database storage.

You can read about setting project limits here: Manage billing with consumption metrics

With a Neon Pro Plan account, you can have multiple projects, so you could have one database per project and implement per-database limits in that way.

I hope this helps. Let us know if you have further questions.