Troubleshooting

🎨 GPT Image

Match error codes and messages to troubleshoot GPT Image generation, editing, and delivery.

Let AI read the docs 🥺👉

Common Top 10

Based on service data, ranked by share of GPT Image failure records. Equivalent balance and unsupported-model errors are combined. These percentages are not the image generation failure rate. Quotes show common user-visible messages; the same code can have other messages.

Insufficient balance

31.5%

INSUFFICIENT_BALANCE / billing_error / upstream_error · HTTP 403

Insufficient account balance

insufficient balance

Top up your account before submitting again. The code upstream_error alone does not establish a balance problem; check the message too.

Low balance? Top up

Missing key

22.2%

missing_bearer_token · HTTP 401

Missing bearer token

Add Authorization: Bearer YOUR_API_KEY. Check that your tool actually sends the authentication header to the image endpoint.

Need a key? Create oneChoose the 🎨 GPT Image group when creating your key.

Request rejected

15.6%

400 · type: invalid_request_error · HTTP 400

您的请求无法用于生成图像。该请求可能因安全政策被拦截,或不适合进行图像生成。

This message says the request may have been blocked by a safety policy or may not be suitable for image generation. Check the parameters, then revise the prompt and references when the message identifies a safety restriction. See 400 errors and moderation.

Wrong endpoint or request method

10.7%

unsupported_images_endpoint · HTTP 404

Unsupported images endpoint: /v1/images/edits

Check the Base URL, path, and method against the OpenAI Images examples. Use POST /v1/images/generations or POST /v1/images/edits, without adding /v1 twice.

Invalid key

3.2%

invalid_api_key · HTTP 401

Invalid API key

Check for missing characters, extra spaces, or an expired key. Use a valid key from a 🎨 GPT Image group.

Need a key? Create oneChoose the 🎨 GPT Image group when creating your key.

Model unavailable in this group

2.6%

model_not_found / upstream_error · type: model_not_found · HTTP 404

Model "gpt-image-2" is not supported by any configured account in this group

Copy the exact name from Model comparison and use a key for a group supporting it. Add openai/ for Studio; omit that prefix for OpenAI Images.

Generation connection failed

2.6%

upstream_transport_error · HTTP 502

Upstream image request failed

Invalid parameter format

2.0%

invalid_value · HTTP 400

size must be auto, 1K, 2K, 4K, or WIDTHxHEIGHT

Correct the field named by param. For this size message, use auto, 1K, 2K, 4K, or a value such as 1024x1024, not 1024*1024.

Image service temporarily unavailable

1.7%

upstream_error · HTTP 502

Upstream service temporarily unavailable

Try again later. For an accepted Studio job, check its final state first. Widespread incidents and recovery updates are announced in the .

No capacity available in this group

1.1%

upstream_error · type: api_error · HTTP 503

No available compatible accounts

Try again later, or switch to another available image group using a key for that group.

Reference: static errors

These errors come from the service's request validation, job handling, or image processing. Studio and OpenAI Images can return a string error.code; an accepted Studio job reports its error in the job snapshot. Read message, param, and the HTTP status together.

Authentication and requests

CodeCommon messageResolution
missing_bearer_tokenMissing bearer tokenSend a complete Bearer authentication header.
invalid_api_key / invalid_bearer_tokenInvalid API key / Invalid bearer tokenCheck or replace the key.
missing_credentialAPI key is requiredSupply a key with the request.
identity_resolution_failedUnable to resolve image request identity and concurrency
invalid_modelmodel must use openai/<model> or google/<model>Prefix GPT Image model names with openai/ in Studio.
invalid_content_typeStudio image submissions require application/jsonSubmit JSON with Content-Type: application/json.
invalid_jsonRequest body is not valid JSON / Request body must be an objectSend a valid JSON object; check quotes, commas, and the body.
invalid_multipartMultipart body is invalidLet your HTTP client construct the multipart body and boundary.
invalid_requestOnly one mask is supported / Request JSON body must be an object / Invalid image Data URLCheck the mask count, JSON object, and image encoding as instructed by the message.
invalid_valueprompt must be a non-empty string / size must be auto, 1K, 2K, 4K, or WIDTHxHEIGHTCorrect the named field. GPT Image in Studio uses size, without resolution or aspect_ratio.
request_too_largeRequest body is too largeReduce the body below 512 MiB. Individual images have separate limits.
unsupported_images_endpointUnsupported images endpoint: …Check the Images path and request method.
unsupported_action / unsupported_protocolUnsupported OpenAI Images action: … / Unsupported OpenAI protocol routeUse the documented Images endpoints.
method_not_allowedMethod Not AllowedUse POST for generation and editing, GET for documented reads.
not_foundResource not found / Job not found / Media was not foundCheck the path; use the original key and exact jobId for job requests.

Reference images and masks

CodeCommon messageResolution
edit_image_requiredAt least one image is required for editsInclude a reference image.
edit_too_many_imagesImage edits support at most 16 input imagesUse no more than 16 reference images.
edit_too_many_masksImage edits support at most one maskInclude only one mask.
edit_unsupported_image_typeimage is not a supported imageUse a valid PNG, JPEG, or WebP image.
edit_unsupported_mask_typemask is not a supported imageUse a PNG mask with transparent areas.
edit_image_too_largeimage exceeds maximum allowed sizeKeep each OpenAI edit image within 50 MiB.
edit_mask_too_largemask exceeds maximum allowed sizeKeep the mask within 4 MiB.
edit_mask_dimensions_mismatchmask dimensions must match the first input imageMatch the first reference image's width and height exactly.
invalid_imageimage is empty / image input could not be resolvedCheck that the file opens and its URL returns an image, not a web page.
invalid_valueimage Data URL is invalidCheck Base64 encoding and include the full data:image/png;base64,... prefix for a Data URL.
image_too_largeimage exceeds maximum allowed sizeReduce the image. The shared input limit is 80 MiB; OpenAI edits have tighter limits.
invalid_image_urlimage URL is not allowedUse a publicly downloadable HTTPS image, without local addresses or required login.
image_download_failedimage URL could not be downloadedCheck access and expiry, or use an uploaded file or Data URL.
unsupported_file_idimages[0].file_id is not supported / mask.file_id is not supportedUse an image file, public URL, or Data URL.

Idempotency, jobs, and results

CodeCommon messageResolution
invalid_idempotency_keyIdempotency-Key must be 1-255 visible ASCII bytesUse 1 to 255 visible ASCII characters, such as a UUID.
idempotency_key_conflictIdempotency-Key is already bound to a different requestKeep the same request for recovery; use a new value for a new task.
idempotency_not_supported_for_streamingIdempotency-Key is not supported for streaming requestsOmit the key for native streaming, or use non-streaming or Studio for idempotent recovery.
job_not_finishedJob is not finishedWait for completed before requesting the result.
cancelledJob was cancelled / Image generation was cancelledStop polling; explicitly submit a new task if still needed.
result_expiredResult has expired / Media has expiredThe original result is no longer retrievable. Download future results before expiry.
media_unavailableResult media is unavailable / Media is unavailable
submission_failedFailed to submit image requestThe submission outcome may be unknown. Recover with the same key, idempotency value, and request if you used one.
generation_interruptedImage generation was interrupted
generation_errorImage generation failed
internal_errorInternal server error

Images and results are retained for 72 hours. A retrieval failure does not necessarily mean generation failed; see Billing and recovery.

Generation connections and image delivery

CodeCommon message
upstream_transport_errorUpstream image request failed
upstream_errorUpstream image generation failed
upstream_invalid_responseUpstream OpenAI Images response is not valid JSON / Upstream stream image payload is invalid
upstream_response_too_largeUpstream response is too large
invalid_upstream_imageupstream image base64 is invalid / upstream image could not be located
upstream_image_too_largeupstream image exceeds maximum allowed size
upstream_image_download_failedupstream image could not be downloaded
media_delivery_failedupstream image could not be stored

Reference: dynamic errors

These codes, types, and message excerpts have been returned to users. Only wrapped public information is included, without raw upstream responses. An upstream_error can concern balance, models, limits, or availability; check type and message as well.

Code or typeUser-visible message or excerptResolution when the cause is explicit
INSUFFICIENT_BALANCE / billing_errorInsufficient account balance / insufficient balanceLow balance? Top up
API_KEY_QUOTA_EXHAUSTEDAPI key 额度已用完Check the key's spending cap; it may be exhausted even when the account has funds.
400 / invalid_request_error您的请求无法用于生成图像。该请求可能因安全政策被拦截,或不适合进行图像生成。Revise the prompt and references, and check parameters.
429No available image quota. Please try again later.Wait for capacity; this message is not the same as insufficient account balance.
ContentModerationRejected提示词或参考图未通过内容审核,请修改后重试Revise the prompt or references before submitting again.
moderation_blockedYour request was rejected by the safety system.Revise the content and follow content policies.
content_moderationRequest rejected by upstream validation. Please check your prompt, parameters and input media, then try again.Check the prompt, parameters, and reference images.
ERR-* · content_policy_error / invalid_request_errorA public reference code starting with ERR-; the accompanying message variesFollow the public message. Revise content when it identifies a policy issue.
API_PARAM_VALIDATION_FAILED / invalid_valueInvalid size '3072x4096'. The longest edge must be less than or equal to 3840.Reduce the longest edge as instructed by this model's response.
invalid_value · image_generation_user_errorParameter or image input does not meet the current model's requirementsCorrect the field identified in the response.
InvalidInput提示词或嵌入内容无效或过长,请仅保留本次生成指令并移除历史对话后重试。Shorten the prompt and remove unrelated conversation history.
InvalidRequestAt least one uploaded image is requiredInclude a reference file and check the multipart body actually sent.
GenerationRequestFailed生成请求失败,请检查参数后重试Check the documented parameters and request format.
invalid_request_errorimages endpoint requires an image model, got "gpt-image"Use a complete model name from the model guide.
service_error/v1/images/edits requires multipart/form-dataUse the multipart example when uploading image files.
model_disabledThe model 'gpt-image-2.5-flare' is currently disabled. Please use another available model.Select an available model.
model_not_foundModel "gpt-image-2" is not supported by any configured account in this groupCheck the model name and key group.
model_temporarily_unavailableThe model is temporarily unavailable.Try later or select another available model.
not_found_errorImages API is not supported for this platformUse a group supporting Images and the matching protocol.
permission_errorImage generation is not enabled for this groupUse a key from an image-enabled group.
rate_limit_errorUpstream rate limit exceeded, please retry laterWait before submitting again; reduce concurrency when the message identifies that limit.
api_errorNo available compatible accountsTry later or switch to an available group.
upstream_errorInsufficient account balance / Upstream service temporarily unavailable / No available compatible accountsMatch the complete public message to balance, availability, or capacity guidance.

generation_interrupted, invalid_upstream_image, upstream_image_download_failed, and upstream_transport_error also occur in failure records; their fixed public meanings appear in the static index above. ERR-* denotes a family of reference codes, not a literal code to submit.

On this page