How to set daily and monthly usage limits?

You often need to set fair usage limits for your customers. Learn how you can do it with meteron in minutes.

News single

When limits are enabled for your model, X-User header is required for all requests. Here's an example of setting priority for your request:

Generating image request in js
Setting X-User header

Remaining requests

To inform users about their daily and monthly limits, you can use the /api/remaining/generations?user={user here} API:

News inner
Getting remaining requests for a user

The response contains 'remaining' and 'remainingThisMonth' fields:

{"remaining":49,"remainingThisMonth":799}