AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help

Error code reference

Look up common HTTP statuses, asynchronous task error codes, and platform program error codes.

Error responses usually include both an HTTP status and a program error code in the response body. Applications should check the HTTP status first, then read the actual type, code, and message; fields may vary by protocol or upstream provider.

If you need to troubleshoot an observed issue, start with Errors and troubleshooting. This page is a reference for error meanings and does not replace the response documentation for a specific endpoint.

HTTP status

HTTP statusCommon meaningCommon causesRecommended action
400Invalid requestThe JSON, required fields, parameter types, file format, or input content does not meet the requirementsCorrect the request based on the error message; do not retry it unchanged
401Authentication failedThe API Key is missing or invalid, or the authentication header does not meet the protocol requirementsCheck the Bearer or protocol-specific header and replace an invalid Key
403Insufficient permission or quotaThe account, Key, model permission, IP range, or available quota does not satisfy the requestCheck account and Key restrictions and confirm that the target model is available
404Resource not foundThe endpoint, model ID, task ID, or video ID does not existVerify the final URL, resource ID, and owning account
429Request limitedThe request rate, concurrency, quota, or service capacity limit was reachedReduce load and retry a limited number of times; save the Request ID if failures continue
500Request processing failedRequest conversion, token calculation, pricing information, or platform processing failedSave the redacted error details and Request ID, then retry a limited number of times later
502Upstream gateway errorThe upstream service returned an invalid response or the gateway could not complete forwardingRetry a limited number of times; contact technical support if failures continue
503Service temporarily unavailableThe platform or upstream service is overloaded, under maintenance, or has no processing capacityUse backoff retries instead of continuous high-frequency requests
504Request timed outUpstream processing exceeded the gateway wait timeRecord the Request ID; for asynchronous tasks, query the original task status first

An HTTP status alone does not determine the cause

A 404 may mean that a path, model, or task does not exist. A 429 may come from rate, concurrency, quota, or service capacity limits. Evaluate the actual error body together with the Request ID.

Common error envelopes

OpenAI-compatible endpoints commonly carry error information in an error object:

{
  "error": {
    "message": "The specific reason the request failed",
    "type": "invalid_request_error",
    "param": "model",
    "code": "model_not_found"
  }
}

Some platform task endpoints return code and message directly:

{
  "code": "task_not_exist",
  "message": "The requested task ID does not exist"
}

Clients should not assume that every endpoint uses exactly the same error envelope. Check the corresponding API Reference before parsing and handle missing optional fields safely.

Asynchronous task error codes

Midjourney tasks

codeHTTP statusCustomer-facing meaningRecommended action
1200Task submitted successfullySave the returned task ID and query the progress endpoint
4400Invalid request parametersCheck the prompt, operation type, and required fields
21200An identical task already existsContinue using the returned task ID; do not create a duplicate
22200The task is queuedKeep the task ID and query again later
23429The current task queue is fullReduce the submission rate and retry later
24400The prompt did not pass content checksRevise the prompt before submitting again
3403The current request cannot be submitted temporarilySave the error details, then retry later or contact technical support
30429Processing capacity for the current group is fullReduce concurrency and retry later

Example of a successful task submission:

{
  "code": 1,
  "description": "Submitted successfully",
  "result": "TASK_ID"
}

Example of a queued task:

{
  "code": 22,
  "description": "Queued with 2 tasks ahead"
}

Platform tasks

codeHTTP statusCustomer-facing meaningRecommended action
task_not_exist404The task does not exist or does not belong to the current accountVerify the task ID, API Key, and request site
quota_not_enough403The current quota is insufficient to create the taskCheck the account and token quota; do not retry unchanged
invalid_api_platform400The platform type in the request is invalidCorrect the platform or protocol parameter
fail_to_fetch_taskDepends on the upstream statusThe latest status could not be retrieved from the task sourceKeep the current task ID and retry a limited number of times later

Platform program error codes

codeCommon HTTP statusCustomer-facing meaningRecommended action
invalid_request400The request format or parameters are invalidCheck the JSON, required fields, and field types
read_request_body_failed400The request body could not be readCheck the body size, connection, and Content-Type
sensitive_words_detected400The input did not pass content checksRevise the input before sending it again
prompt_blocked400The prompt was blocked by a content policyRevise the prompt based on the error details
access_denied403The current request was deniedCheck the API Key, account status, and allowed IP range
insufficient_user_quota403The account has insufficient available quotaCheck the balance or quota before sending another request
pre_consume_token_quota_failed403The available token quota is insufficientCheck the current Key's quota and usage restrictions
model_not_found404The current account cannot find the target modelCopy an available model ID from the model marketplace
convert_request_failed500The request could not be converted to the target protocolVerify the endpoint, protocol, and target model compatibility
count_token_failed500Token usage for the request could not be calculatedSave the redacted request characteristics and Request ID
do_request_failed500The platform could not complete the upstream requestCheck network status and retry a limited number of times
bad_response_status_codeDepends on the upstream statusThe upstream service returned a nonstandard error or one that could not be parsed directlySave the original HTTP status, redacted message, and Request ID
api_not_implemented501The current endpoint is not available yetCheck the API Reference and use an endpoint that is already published

Client handling principles

  1. Record the HTTP status, program error code, redacted message, and Request ID together.
  2. For 400, 401, and 403, correct the cause first; do not automatically retry the same request.
  3. For 404, verify the path and resource ID; for asynchronous resources, also verify the owning account.
  4. For 429, 502, 503, and 504, use a limited number of backoff retries.
  5. Before resending a task creation or another request with side effects, confirm whether the original request already took effect.
  6. Do not branch program logic on the complete error message text. Prefer stable HTTP statuses and code values.

See Request ID for the tracing details to save, and Errors and troubleshooting for broader troubleshooting and retry guidance.

On this page