Limits and balance
Request speed, sizes, spending limits and how the balance is reserved.
There are three kinds of limits: request speed, request size and money. The platform sets speed and sizes, and you set the spending limits.
Speed
| What | Value |
|---|---|
| Requests per minute | 120 per key by default |
| Tokens per minute | 200,000 per key by default |
Exceeding them gives 429 rate_limit_exceeded and a Retry-After header in seconds. Repeat the request after that pause. These are the defaults for a new key; they may differ for your organization.
Sizes
| What | Value |
|---|---|
| Request body | 32 MiB |
| Speech recognition request | 26 MiB |
| Images in one request | 1 to 10 (n) |
| Video generation time | at most one hour, then the job gets failed with the code timeout |
Balance and reserve
Before each model request, the maximum possible amount is reserved on the balance. After the response, the actual amount is charged and the remainder is returned. For text, the reserve is counted from the input size and max_tokens. If max_tokens is not passed, the model's response ceiling is used: for flagship models it is 128,000 tokens, and the reserve per request ends up well above the actual cost. With a small balance this gives 402 insufficient_funds, although the response itself would cost pennies. Pass max_tokens (in /v1/responses it is max_output_tokens).
For images, the reserve equals the number of images multiplied by the price of one. For video, it is the seconds multiplied by the price per second at the chosen resolution. A video reserve lives for up to two hours.
- Errors 400, 401, 403 and 404 do not reserve money.
- A request interrupted by the client is charged by what was actually received.
- A video with the
failedstatus costs nothing.
Spending limits
Limits are set in rubles and counted in Moscow time.
| Limit | Where to set | Error |
|---|---|---|
| Day and month per key | when creating and editing a key | 402 key_limit_exceeded |
| Day and month per employee, team, organization | in the organization settings | 402 spend_limit_exceeded |
A request is rejected if, together with it, the spending for the period would exceed the limit. Keys and their limits: Keys and access. List of codes: Errors.
Space
The X-Morphogen-Space: spc_… header assigns the request's spending to a space. Format: spc_ and 8 to 64 characters of 0-9a-z. A header with any other value is ignored without an error. The platform checks the right to use the space.