Silver-Spy
Silver-Spy16mo ago

How to add a limit per user for running queries

Hey guys i wanted to add a certain limit per users for queries to run so i dont run out off free credits from Open Ai. How could i achieve such feature with convex?
1 Reply
erquhart
erquhart16mo ago
If you have a users table you could increment a number field for each open ai query. And because convex mutations are transactions, incrementing is just reading the value, adding 1 to it, and writing it back.

Did you find this page helpful?