LMU AI Docs
User Guide

Error Codes

LMU AI error-code reference: meanings and fixes for 401 / 403 / 404 / 429 / 5xx statuses, batch-image business codes, and lookup from raw error text to a fix.

This page collects the error codes scattered across the individual API docs into one cheat sheet. First locate the broad class by HTTP status code, then find the specific fix by the raw error text.

Record the request ID before troubleshooting

The request ID in the response headers is the single most useful piece of information for diagnosing a problem. When you contact support, include the request ID and the full error text — do not send your full API key.


HTTP status codes

StatusTypical causeWhat to do
400Invalid request body, parameter, model ID or model path; bad image format / encodingFix the request — do not just retry; switching accounts or retrying will not succeed
401API key missing, invalid, or disabled; Base URL does not match the protocol; the IDE was not restarted so the old config is still in effectCheck the key and Base URL (see API Protocols), restart the IDE; details in Issue 3
402Insufficient balanceTop up or reduce the workload
403Two possibilities, both possible: ① the API key's group does not have image generation enabled; ② insufficient balance, subscription, billing eligibility, or permissionFirst confirm the account balance and subscription status, then confirm the group has the capability; if both are fine and it still errors, contact support
404OpenAI-protocol URL missing /v1, Anthropic URL wrongly including /v1, Gemini not using /v1beta/models/...; or the endpoint is not supported by the current groupRe-check the Base URL and full endpoint against API Protocols
413Image-to-image request body too largeCompress the input image
429① Daily quota exhausted; ② concurrency, RPM, or upstream quota limitedFor an exhausted quota see Issue 2; for rate limiting, back off exponentially and lower concurrency and RPM
500Internal or capacity errorRecord the error code and request ID, retry a limited number of times
502Upstream auth, permission, or service temporarily failedBack off and retry; contact support if needed
503No available upstream account or upstream overloaded; may also be an environment variable overriding the keyFirst check env vars (see Issue 6), then retry with delay and lower traffic
504Gateway or upstream timeoutRe-issue as a fresh, independent request

What to retry, and what must be fixed instead

  • Do not retry: 400, 401, and any explicit balance, permission, parameter, or content-policy error — the request itself is invalid, and any upstream account returns the same result. You must fix the request first.
  • Safe to retry: 429, 502, 503, 504, and network drops, connection resets, and read timeouts — all transient failures. Use exponential backoff for a limited number of retries (2–3 recommended) to avoid paying for repeated calls; on 429 also lower concurrency and RPM.

This classification comes from the retry guidance in the image APIs — see Gemini Image · Retry guidance.

Full error descriptions for each API: Gemini Image, GPT Image, Grok Image, Gemini Batch Image.


Business error codes (batch image)

Beyond HTTP status codes, the Gemini Batch Image API also returns business error codes, shown in the console as error code: BATCH_IMAGE_XXX plus a request ID.

Error codeHTTPMeaningWhat to do
BATCH_IMAGE_DISABLED404Batch image generation disabled globallySend the error code and request ID to the administrator
BATCH_IMAGE_GROUP_DISABLED403The current key's group does not allow batch image or is not a Gemini groupChange the key or ask the administrator to enable group permission
BATCH_IMAGE_NO_ACCOUNT_AVAILABLE502No batch-execution resource currently availableSave the request ID and contact the administrator
BATCH_IMAGE_SETTLEMENT_PRICING_MISSING400The batch model has no billing priceAsk the administrator to configure the model price
BATCH_IMAGE_INVALID_MODEL400No model providedUse a model from the batch model list
BATCH_IMAGE_INVALID_ITEMS400Invalid items, resolution, or request fieldsCheck the request body; only 1K is supported for now
BATCH_IMAGE_DUPLICATE_CUSTOM_ID400Duplicate custom_idEnsure it is unique within the batch
BATCH_IMAGE_PROMPT_TOO_LONG400Prompt too longShorten the prompt
BATCH_IMAGE_TOO_MANY_OUTPUT_IMAGES400Image count after expansion exceeds the limitReduce items or output_count
BATCH_IMAGE_INVALID_REFERENCE_IMAGE400Invalid reference-image format, size, or URICheck MIME, Base64, and file_uri
BATCH_IMAGE_INSUFFICIENT_BALANCE402Balance too low to reserve the chargeTop up or reduce the workload
BATCH_IMAGE_IDEMPOTENCY_CONFLICT409The same idempotency key maps to a different request bodyUse a new Idempotency-Key
BATCH_IMAGE_PROVIDER_SUBMIT_FAILED502Upstream batch-task creation failedSave the request ID, retry a limited number of times, or contact the administrator
BATCH_IMAGE_QUEUE_FAILED502The async task service is temporarily unavailableSave the request ID and contact the administrator
BATCH_IMAGE_NOT_READY409Tried to download before the task completedWait until the status becomes completed
BATCH_IMAGE_OUTPUT_DELETED410The output was already cleaned upIt can no longer be downloaded; create the task again
BATCH_IMAGE_ITEM_FAILED409The specified task item has no successful imageCheck item.error
BATCH_IMAGE_DOWNLOAD_LIMITED429Too many simultaneous downloadsRetry later

Look up by raw error text

Match the error text you actually see against the table below and jump straight to the detailed fix.

Raw error textMeaningDetailed fix
stream disconnected before completionStream dropped, usually a VPN / proxy / system proxy rotating the exit IPIssue 1
exceeded retry limit, last status: 429 Too Many RequestsDaily quota exhaustedIssue 2
401 Unauthorized: Incorrect API key providedThe request still went to the official endpoint, not the LMU AI relayIssue 3
running scripts is disabled on this system (Windows)PowerShell execution policy restrictionIssue 4
CODEX is not recognized as a cmdlet (Windows)Node.js not installed or PATH brokenIssue 5
503 No available accountsA shell env var overrides the key configured in the IDEIssue 6
400 Invalid signature in thinking blockSwitching models across groups in one conversation; the thinking signature cannot be verifiedIssue 7
400 Unknown parameter: 'tools[0].n'A tools parameter was wrongly sent to an image endpointIssue 8
No available accounts / model unavailableCalled a model outside the current group's available rangeAPI Protocols → Troubleshooting

Errors on the Usage export API

The Usage export API uses JWT authentication, so its error semantics differ from the API-key channel above:

StatusCauseWhat to do
401JWT expiredRenew with the refresh_token, or sign in again
403Unauthorized access (e.g. querying an api_key_id that is not yours)Check whether the key belongs to the current account
400Bad parameter (e.g. wrong start_date format)Check the YYYY-MM-DD format and that timezone is valid

Still stuck?

  • Step-by-step worked cases are in the FAQ
  • Base URL / endpoint rules are in API Protocols
  • Protection against a stolen key is in Key Security
  • When contacting support, include the request ID and the full error text

Last updated:

On this page