When a request fails, check both the HTTP status code and the code and message in the response body. These are not the same concept: some business exceptions in the current service are returned with HTTP 200, but the code in the response body is not 200, in which case the request has still failed.
Response Structure
An error response is typically:
json
Copy
{"code":1000,"message":"Duration must be between 1 and 8 seconds. Please refer to the API documentation for details."}
Some errors additionally return data:
json
Copy
{"code":1000,"message":"Parameter information exception","data":{}}
Field
Type
Description
code
number
Business error code; you cannot judge business success from the HTTP status alone
message
string
Specific error description; success responses usually omit this field
data
any JSON type
Optional additional information; not fixed as an object
timestamp
number
Unix timestamp in seconds returned by some normal business responses; not guaranteed on errors
The business code for a successful response is 200. When the generic business response object is used, successful responses usually do not return message: "Success".
HTTP Status and Handling Principles
HTTP Status
Meaning in the current code
Retry as-is recommended
Recommended Action
200
May be success, or a business failure produced by BizException/RespErrorException
Depends on response body
Must continue checking code in the response body; only code = 200 indicates success
Top up available credits/resource packages before resubmitting
403
Current resource package does not support the requested resolution (business code 1301)
No
Use one of the available resolutions listed in the response, or adjust the resource package
403
CloudFront Geo edge rules deny access, returning code = 403, message = "Access denied"; this response does not go through the Java business error system
No
Check whether the source IP, region, and AccessKey comply with the access rules
404
Task, subject, batch, or other resource does not exist or has expired (usually business code 1200)
No
Check the ID, owning account, and whether the resource has expired
405
Request method not supported
No
Switch to an HTTP method listed in the response message
429
The user's pending/processing task count or queue count has reached the limit (business code 1800)
Yes, after capacity is released
Retry after existing tasks complete; use exponential backoff and avoid immediate high-frequency retries
500
Unhandled server-side exception; the current generic response is usually code = 500, message = "响应错误"
Yes
Retry a limited number of times later; if failures persist, record the endpoint, request time, and task ID and contact support
Note: business code 5000 is usually returned with HTTP 200 via the business exception handler, and is not equivalent to HTTP 500; the special path of an internal save failure in batch upload returns HTTP 400 with business code 5000. Clients must judge by the response body code.
For temporary errors — 429, 500, and HTTP 200 with business code 5000 — you can use exponential backoff with random jitter, for example 2 seconds, 4 seconds, 8 seconds, with a maximum retry count. Do not automatically retry parameter, authentication, insufficient-credit, entitlement-unsupported, or resource-not-found errors.
Currently Effective Main Business Error Codes
Common HTTP Status
Business Code
Current Accurate Meaning
Recommended Action
200
200
Request succeeded; success responses usually omit message
Continue processing data
400
1000
Parameter validation failed. message may be generic copy, or may point to a specific field, format, or range
Correct the request per message; do not handle it as a single fixed cause
400
1001
Text, image, audio, or video content failed the content safety check
Modify or replace the relevant input content
401
1100
Token malformed, signature invalid, issuer/key invalid, or Token parsing failed
Regenerate the Token with a valid AccessKey/SecretKey, and confirm the Token is not truncated or tampered with
401
1101
Authorization missing, empty, or only an empty Bearer prefix was passed
Pass a non-empty Token; the service accepts both a bare Token and Bearer <token>
401
1102
The Token's nbf time has not yet arrived
Calibrate the client clock and wait for the Token to become valid, or re-issue it
401
1103
The Token has passed its exp expiration time
Regenerate the Token
404
1200
The requested task, subject, batch-upload batch, or other resource does not exist or is unavailable
Verify the returned ID, account ownership, and validity period
403
1301
The current resource package does not support the requested resolution; message may include Available resolutions: [...]
Use an available resolution or adjust the resource package
402
1302
Insufficient available resource-package credits
Top up credits/resource packages and resubmit
429
1800
The current user's pending/processing task count or queue occupancy has reached the configured limit; the fixed English copy in the code is Insufficient credit quota., but the actual trigger condition is the task/queue capacity limit
Back off and retry after existing tasks complete; do not treat it as insufficient credit balance — insufficient credits correspond to 1302
200 (special batch-upload path: 400)
5000
The business flow caught a system exception; the fixed copy is usually System busy, please try again.
Retry a limited number of times with backoff; contact support if failures persist
200
500
External service call failed or errored; because BizException is used, HTTP may still be 200, with copy usually 调用服务失败!, 调用服务异常!, etc.
Retry a limited number of times with backoff; contact support if failures persist
500
500
Unhandled runtime/system exception; the generic copy is usually 响应错误
Retry a limited number of times with backoff; contact support if failures persist
200
902 / 903
Internal JSON parsing or data processing exception; message may concatenate exception details
Usually cannot be fixed by retrying the same parameters; record the full response and contact support
Framework-Layer and Edge-Layer Errors
HTTP Status
Response Body Code
Current Trigger Condition
Recommended Action
400
400
URL/query parameters cannot be converted to the Java type required by the controller
Correct the parameter type
400
404
Method-level constraint validation failed or the code threw IllegalArgumentException; this is the HTTP-vs-business-code mismatch caused by the current GlobalVar.Status_BadRequest = 404
Correct the parameters according to message
404
404
No matching route (when NoHandlerFoundException is enabled)
Check the source IP, region, and AccessKey allowlist
Items Defined in the Code That Should Not Be Handled as Currently Effective Errors on Their Own
1203 is not defined on the server side. When a batch-upload batch does not exist or has expired, the actual response is HTTP 404 with business code 1200, and message is Batch ID does not exist or has expired..
Although 1300 is defined in the enum as "unsupported video duration", the current duration-entitlement validation code has been commented out and has no effective throw path. Duration format/range errors usually return HTTP 400 with business code 1000.
1500 and 1501 are only defined in the enum; there is currently no effective usage point in the code.
1004~1009 are Java enum constant names, not independent business codes; their numeric values are all 1000.
Common Parameter/Request Errors (Business Code 1000)
Bean Validation and ParamException usually return HTTP 400 with code = 1000; however, some query and business services use BizException and return the same business code with HTTP 200, and a few paths for a non-existent model even return code = 1000 with HTTP 404. message carries the actual semantics. The content below preserves the server's actual English copy so clients can match logs; we do not recommend that clients rely on the full copy for business branching.
Basic Fields
Error Message
Actual Meaning
Resolution
Please provide a prompt. / Prompt is required. / Name is required.
The endpoint requires a prompt, but prompt is missing or empty; the reference-input endpoint's current actual copy is Name is required.
Provide a non-empty prompt
The prompt length must not exceed 10000 characters.
The general prompt exceeds 10,000 Chinese/English characters
Shorten the prompt
Prompt length must be between 1 and 5000 characters.
The Montage prompt is empty or exceeds 5,000 Chinese/English characters
Keep the Montage prompt between 1 and 5,000 Chinese/English characters
The negative prompt length must not exceed 10000 characters.
The negative prompt exceeds 10,000 Chinese/English characters
Shorten the negative prompt to within 10,000 Chinese/English characters
The audio prompt length must not exceed 200 characters.
The audio prompt exceeds 200 Chinese/English characters
Shorten it to within 200 Chinese/English characters
The callback url length must not exceed 500 characters.
The callback URL exceeds 500 characters
Shorten the callback URL
Callback URL must be a valid HTTP or HTTPS URL / Callback must be a valid HTTP or HTTPS URL
The callback URL does not match the current HTTP/HTTPS URL regex
Use a complete, accessible HTTP/HTTPS URL
Task Id is required. Please refer to the API documentation for details.
task_id is empty when querying a task
Use the task ID returned by the create endpoint
FPS must be 24. Please refer to the API documentation for details.
The general video endpoint's frame rate is not supported
Use 24
Duration Limits
Duration is not a uniform 1~6 seconds. The current code validates by endpoint, model, and input method:
Endpoint/Scenario
Current Limit
Typical Error Message
General Text to Video
1~8 seconds
Duration must be between 1 and 8 seconds...
bach-1.0 Image to Video, first frame only
1~8 seconds
For bach-1.0: first frame only 1-8s...
bach-1.0 Image to Video, last frame only or first and last frames
1~6 seconds
Same as above
Reference inputs, model_name = bach-1.0
1~8 seconds
When model_name is bach-1.0 duration must be 1-8 seconds...
Montage
Only 10, 15, 20, 25, 30, 45 seconds
Duration must be one of: 10, 15, 20, 25, 30, 45 seconds.
Resolution and Aspect Ratio
Error Message
Actual Meaning
Resolution
Resolution must be 720p or 1080p...
Most video endpoints only accept lowercase 720p or 1080p
Use a value supported by the endpoint
Aspect ratio must be 16:9, 9:16, or 1:1...
The aspect ratio for general Text to Video, reference inputs, or Montage is not supported
Use 16:9, 9:16, or 1:1
Images, Audio, and Reference Inputs
Error Message
Actual Meaning
Resolution
Image URL is required. / Image URL cannot be empty or blank.
A required image URL is missing or empty
Provide a non-empty image URL
Image URL must be a valid HTTP or HTTPS URL.
The image URL failed the current format validation
Provide a complete HTTP/HTTPS URL
End image URL must be a valid HTTP or HTTPS URL.
The last-frame URL format is invalid
Provide a complete HTTP/HTTPS URL
Image URL is required, or at least one of image_url and end_image_url for bach-1.0.
Neither the first nor the last frame was provided for bach-1.0
Provide at least the first or last frame for bach-1.0
Reference inputs are required... / Reference inputs cannot be empty...
reference_inputs is missing or the list is empty
Provide at least one reference input
Reference inputs cannot exceed 9 elements...
reference_inputs has more than 9 top-level elements
Provide at most 9 reference inputs
Images array must contain 2 to 4 URLs
The subject reference image count for type = subject is not between 2 and 4
Provide 2~4 images for that subject
Image URL is required
The url for type = image is empty
Provide a non-empty image URL
Subject Parameters
Error Message
Actual Meaning
Resolution
Subject name is required... / Name is required...
The subject name is empty
Provide a non-empty name
The name length must not exceed 50 characters. / Name must be between 1 and 50 characters...
The subject name exceeds 50 Chinese/English characters, or is empty
Keep it between 1 and 50 Chinese/English characters
The desc length must not exceed 1000 characters. / Description must be between 1 and 1000 characters...
The subject description exceeds 1000 Chinese/English characters; some endpoints require it to be non-empty if provided
Keep it between 1 and 1000 Chinese/English characters per the endpoint
Subject type must be either 'character' or 'object'...
subject_type is invalid
Use character or object
Style must be one of: realistic, anime, cartoon, 3d, pixel...
subject_style is invalid
Use one of the five listed styles
URLs must contain between 1 and 4 URLs...
The subject-creation endpoint's image count is not between 1 and 4
Provide 1~4 images
Batch File Upload
JSON batch upload supports upload_type = url | base64 。url/base64` images: up to 300 per batch, up to 10 MB each. The specific limits come from the service configuration and may be adjusted per deployment; the numbers in dynamic error messages take precedence.
Error Message
Actual Meaning
Resolution
The upload file list cannot be empty.
The images/files list is empty, or the multipart request has no files
Provide at least one file
The upload type cannot be empty.
upload_type is missing
Use url, base64
The upload type can only be url, base64.
The upload type is not supported
Use one of the two listed types
Batch upload supports a maximum of {n} files.
The JSON image upload count exceeds the current configured limit
Keep the batch size within the limit in the message
The {n}th file: imageData cannot be empty.
The nth JSON upload item has no file data
Provide a URL or Base64 data
The {n}th image URL does not have a valid file extension. Supported formats: ...
The image URL path has no recognizable extension
Use a URL with a supported extension
The {n}th image URL format '{ext}' is not supported. Supported formats: ...
The image URL extension is not supported
Use an image format listed in the error message
The {n}th image (base64): Cannot determine image format...
No format, and the data lacks a data:image/... prefix
Provide format or a standard data URL
The {n}th image (base64): Invalid Base64 data format.
The Base64 cannot be decoded
Correct the Base64 data
The {n}th file (base64) size is approximately {size}MB, exceeds the maximum limit of 10MB.
The Base64 image's estimated decoded size exceeds 10 MB
Compress the image or split the upload
The length of imageNames array must match the length of files array.
The image_names count does not match the multipart files count
Keep the two arrays in one-to-one correspondence
Image extensions currently supported by the batch-upload controller: jpg, jpeg, png.
Resource Query Errors
HTTP / Business Code
Error Message
Actual Meaning
Resolution
404 / 1200
Invalid request. The requested resource does not exist or is not available
The task or subject does not exist, or the current user cannot query this resource
Use the ID returned by the create endpoint, and confirm the same account is used
404 / 1200
Batch ID does not exist or has expired.
The batch-upload status was not found in Redis; the ID may be wrong or the status expired
Verify the batch_id; if expired, resubmit the batch
Troubleshooting Checklist
Check the HTTP status first, then the response body code; HTTP 200 does not necessarily mean success.
When code = 1000, go by the specific field indicated in message; do not apply a uniform duration, resolution, or seed range.
When code = 1100~1103, check Authorization, Token integrity, the signing key, and the client clock.
code = 1302 means insufficient credits; code = 1800 in the current implementation means the queue/concurrent-task capacity is full — the two are handled differently.
When querying a task, subject, or batch, confirm the ID comes from the corresponding create endpoint, and that creation and querying use the same account.
When encountering 429, HTTP 500, or business code 5000, record the request time, endpoint path, task ID, and full response, then perform a limited number of backoff retries.