InferenceHelp

Limits and usage

How credit usage is counted across three windows, where to see your remaining balance, and what to do when a limit is exhausted.

Usage is counted in credits and charged to the account of the key owner. Each plan has limits for three windows: session, week and month. The remaining balance for each window comes in the response headers, and when a limit is exhausted, the API responds with code 429 and says when the allowance resets.

Three windows

WindowWhen it starts
A 5-hour sessionWith the first paid request.
WeekOn the same day of the week and hour you signed up.
MonthOn the day of the month you signed up, or, on a paid plan, from the moment you switched to it.

The limits of each plan are listed on the Pricing page, and your current usage is in the console at console.yenisei.ru.

Response headers

HeaderWhat it holds
X-RateLimit-Remaining-SessionRemaining credits in the session window.
X-RateLimit-Remaining-WeekRemaining credits in the week window.
X-RateLimit-Remaining-MonthRemaining credits in the month window.
Retry-AfterNumber of seconds until the exhausted limit resets. Comes in a 429 response.
X-RateLimit-ResetThe moment the limit resets, as a unix timestamp. Comes in a 429 response.

The remaining balance is given in nanocredits: 1 credit equals 1,000,000,000 nanocredits.

What to do when a limit is exhausted

The API responds with code 429 and the code of the window: session_limit_exceeded, week_limit_exceeded or month_limit_exceeded. The right behavior for a program is to wait the number of seconds given in Retry-After and then retry the request, rather than sending it again and again.