LOW COST AI
עב

Errors and limits

Every API error comes back with a stable English code you can check in code without parsing text. This page lists every code, what it means and what to do, plus the rate limits and the MCP and OAuth errors.

Updated November 23, 2026

On this page
  1. The error body
  2. Every error code
  3. Reasons for a parameter error
  4. Rate limits
  5. MCP errors
  6. OAuth errors
  7. When to retry

The error body

Every error is JSON with an error field, sometimes with extra fields that help explain what happened:

{ "error": "invalid_params", "param": "duration", "detail": "duration: one of 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15" }

Extra fields by code
CodeExtra fieldWhat it holds
invalid_paramsparam, detailWhich parameter, and why, as "<param>: <reason>"
not_foundwhatmodel, job, file or key
price_above_capcreditsThe real price
too_largemax_bytesThe largest file size in bytes
too_many_keysmaxThe most keys allowed
insufficient_credits on MCPtopupA link to add credits
unauthorized on MCPhintHow to connect

Check the code, not only the status: several codes share a status. Every API answer carries Cache-Control: private, no-store. An unexpected error returns 500 server_error, and the details stay in the server log only.

Every error code

Error codes
CodeHTTPWhat it meansWhat to do
unauthorized401No valid key or sign-in. The key is missing, wrong or revokedSend Authorization: Bearer with an active key. Check on the developers page that it was not revoked
account_blocked403The account was switched off, so its keys and sessions are refusedDo not retry. Reach support through the website
bad_origin403A write request carrying a sign-in cookie came from another siteUse an API key for calls from code, not a cookie
web_session_required403The action is allowed only from the signed-in website, not with an API keyDo it on the website: creating and revoking keys, changing the password, signing out sessions and deleting the account
rate_limited429Too many calls in the current time windowWait for the window to pass, a minute or an hour as in the table, then retry. There is no Retry-After header
invalid_params400A parameter is missing or invalid. param says which one and detail says whyFix the parameter using get model. Nothing was charged
not_found404What you asked for does not exist. what says which: model, job, file or key. Another user's job or file counts as not existingCheck the id. For a model, refresh the model list
insufficient_credits402The balance is lower than the price. Nothing was charged. On MCP a topup link is addedAdd credits on the credits page and retry
storage_payment_required402The account is held because storage fees above 1 GB were not paid. New generations and uploads are refused. On a file upload the status is 400Add credits, or delete files until you are under 1 GB. Deleting lifts the hold at once
price_above_cap409The actual price is above the max_credits you sent. Nothing was charged. credits returns the real priceEstimate again, and if the price is fine resend with max_credits at or above it
server_error500An unexpected failure. The details stay in the server log onlyRetry later. For a generation, first check the job list that the job was not created, since there is no duplicate protection
too_many_keys409The account already has 25 active keys. max returns 25Revoke an unused key on the developers page
too_large413The file is larger than 4 MB (4194304 bytes). max_bytes returns the limitMake the file smaller. For a video, for example, export it at 720p
no_file400The form has no field named file, or the request is not multipart at allSend multipart/form-data with the file in a field named file
unsupported_type400The file type is not supported, or the start of the file does not match the declared typeUse png, jpeg, webp, gif, mp4, webm, mov, mp3, wav, ogg, m4a or flac, with the right Content-Type
quota_exceeded400The upload goes past a limit: 20 GB per account, or above 1 GB when the balance does not cover about a month of storage at the new size, or 50 MB and 30 files on an account that has never added creditsDelete files or add credits
confirm_email_mismatch400When deleting the account, confirm_email is not the account emailSend the exact account email
wrong_password400current_password is wrong, when deleting the account or changing the passwordRetry with the right password. Up to 10 tries an hour
weak_password400The new password is shorter than 10 characters, one repeated character or too commonChoose a stronger password
password_too_long400The new password is longer than allowedShorten it
payment_pending409Deleting the account was refused because a top-up page opened in the last 48 hours is still waiting for paymentWait for the payment to complete or expire, then retry
generation_failednoneNot an HTTP error: the value of the error field on a job whose status is failed. The credits are already backSend the generation again if you want to. Trying other settings or wording can help
invalid_client400OAuth: the app is not recognised. client_id is missing or unknown, or its metadata document could not be loaded or is invalid. Also shown on the consent screenFor the app developer: register the client again or fix its metadata document
invalid_request400OAuth: a required detail is missing. The redirect address is not registered for the app, PKCE with S256 is missing, or code or code_verifier is missingFor the app developer: send a complete request per the standard
invalid_grant400OAuth: the code is invalid, already used or expired (it lives 5 minutes), belongs to another app or address, or the account already has 25 active keysConnect again from the app. With 25 keys, revoke one on the developers page
invalid_target400OAuth: the request names another service. resource must be https://low-cost.ai/api/mcpFor the app developer: send the right MCP address
unsupported_grant_type400OAuth: only the authorization_code grant_type is supportedFor the app developer: use authorization_code with PKCE
unsupported_response_type400OAuth: only response_type code is supportedFor the app developer: send response_type=code
invalid_redirect_uri400OAuth, on app registration: 1 to 5 https redirect addresses are needed, or http for the local machine only, with no #For the app developer: fix redirect_uris
invalid_client_metadata400OAuth, on app registration: the body is not JSON, or token_endpoint_auth_method is not noneFor the app developer: register as a public client with PKCE
access_deniednoneOAuth: not an HTTP error. This is how the app learns you pressed Cancel on the consent screen. No key was createdConnect again from the app if you want to

Codes marked OAuth come from the OAuth sign-in endpoints, not from /api/v1. They are explained below.

Reasons for a parameter error

In invalid_params the detail field is always built the same way: the parameter name, a colon, and the reason. These are all the reasons:

The detail values
ReasonWhen
unknown parameterThe parameter does not exist on the model
requiredA required parameter is missing. Also max_credits when not sent
not a numberA numeric value that is not a number
min <n> or max <n>A number out of range
step <s>A number that is not on the step grid
one of <v1>, <v2>, ...A value that is not in the allowed list
max <n> items, max 8192 characters per item, must be http(s) linksAn images list that is too long or holds a value that is not a link
must be text, max <n> characters, must be an http(s) linkInvalid text or link
no provider serves this combinationThere is no way to run this combination. param is params
max or min <n> characters or itemsText or a list outside the model's bound
content-type must be application/jsonThe request was not sent as JSON. param is body
must be a positive numbermax_credits is not a positive number
not a timestampbefore on the job or file list is not a date
not a ledger idbefore on the credit history is not a row number
must be a video from your library, max 64 MB, unreadable video, max 15 secondsThe video of an analysis model is not valid
must be text, one of he, en, one of graphite, ...name, lang or theme is invalid in an account update

A parameter error always happens before any charge.

Rate limits

Rate limits are counted in a fixed time window that starts with the first call and resets when it ends. The call that crosses the limit gets 429 rate_limited.

Rate limits
WhatHow manyWindowCounted
POST /api/v1/estimate120minuteper IP address
POST /api/v1/generate and the MCP generate tool, together30minuteper account
Every request to /api/mcp120minuteper account
POST /api/v1/files60hourper account
POST /api/v1/keys20hourper account
POST /api/v1/me/password and DELETE /api/v1/me, together10hourper account
POST /api/oauth/register30hourper IP address
POST /api/oauth/token6010 minutesper IP address
Approving on the OAuth consent screen20hourper account
  • There are no Retry-After or X-RateLimit headers. Wait until the window ends, a minute or an hour, then retry
  • On MCP, going over on generate comes back as a tool result with isError and rate_limited, and going over the total request count comes back as HTTP 429
  • There is no rate limit on reading jobs, files, history, the account and models

MCP errors

On MCP a tool error is a normal result with isError: true, holding text that is the same error JSON:

{ "isError": true, "content": [{ "type": "text", "text": "{\"error\":\"price_above_cap\",\"credits\":12.5}" }] }

  • Arguments that do not match the tool definition, such as a missing max_credits or wait_seconds above 25, come back as plain text, not JSON: MCP error -32602: Input validation error
  • Without a key you get 401 with a WWW-Authenticate header, which sends assistants that support OAuth to the sign-in flow:

HTTP/1.1 401 WWW-Authenticate: Bearer realm="lowcostai", resource_metadata="https://low-cost.ai/.well-known/oauth-protected-resource/api/mcp" { "error": "unauthorized", "hint": "Send Authorization: Bearer <lca_ API key> from your LowCostAi account, or connect with OAuth" }

A switched off account gets 403 account_blocked, and going over 120 requests a minute gets 429 rate_limited.

OAuth errors

OAuth errors reach the app that is connecting, not you, and most users never see them. Their shape is slightly different:

  • POST /api/oauth/token and POST /api/oauth/register return { error, error_description }
  • POST /api/oauth/authorize, the approval on the screen, returns { error, detail } with status 400
  • A malformed sign-in request is shown as an error page with the code and details, and does not redirect back to the app
  • Cancel on the screen sends the user back to the app with error=access_denied in the address

Every code is explained in the table above.

When to retry

Retrying
CodeRetry?
rate_limitedYes, after the window passes
server_errorYes, after a wait. For a generation, first check the job was not created
insufficient_credits, storage_payment_requiredAfter adding credits or deleting files
price_above_capAfter a new estimate, if the price is fine
invalid_params, not_found, unsupported_type, too_largeOnly after fixing the request
unauthorized, account_blocked, web_session_requiredNo, it is a permission problem