Common questions about image APIs in Alibaba Cloud Model Studio, covering debugging, billing, rate limits, and API errors.
Debugging
How do I debug image API calls locally?
Image APIs use standard HTTP. This example uses the Wan text-to-image API with curl.
-
Activate the model service and get an API key, then set it as an environment variable.
-
Find the
curlcommand in the API documentation. For example:
-
On macOS or Linux, run the command directly in a terminal.
-
On Windows, use an API platform such as Postman or Apifox to send the HTTP request.
Note: When using an API platform, replace$DASHSCOPE_API_KEYin theAuthorizationheader with your actual API key, for example,Bearer sk-xxxxxx.
Billing and rate limits
How does billing work for image models?
Each image model has a free quota and may have a per-image price:
| Model | Free quota | Unit price | QPS limit for task submission | Number of concurrent tasks |
|---|---|---|---|---|
| Image Model 1 | 500 images | Free for a limited time | 2 | 1 |
| Image Model 2 | 500 images | $0.02/image | 2 | 1 |
Free quota and rate limits are shared across the Alibaba Cloud account and all RAM users.
What does "free for a limited time" mean?
The model is in public preview. After the free quota is exhausted, the model becomes unavailable.
What counts as a billable image?
Only successfully generated images are billed. Input images and failed requests do not consume quota or incur charges.
How do I get the free quota?
Free quota is granted automatically when you activate Model Studio. It is valid for 90 days and shared across the account and all RAM users.
For details, see Free quota for new users.
When do paid charges start?
Models with a specific unit price (for example, $0.02/image) are commercialized. Charges begin after the free quota is exhausted or expires.
Fees are billed to the Alibaba Cloud account -- all usage rolls up to the parent account.
-
View bills: Go to the Billing Overview page in the Alibaba Cloud Management Console.
-
Add funds: Go to the Expenses and Costs page.
-
Monitor usage: Check the Monitoring page on the Model Studio platform (Singapore | Beijing).
For full billing details, see Billable items.
API errors
Common image API errors and solutions:
| Error code | Message | Typical cause |
|---|---|---|
BadRequest.InputDownloadFailed |
Reference image download failed | Image URL is incorrect, unreachable, or access-restricted |
InvalidParameter |
Required body invalid | Request body contains Chinese characters that the client cannot parse |
| (Timeout) | Download the media resource timed out | Network instability between regions outside the Chinese mainland and the service endpoint |
BadRequest.InputDownloadFailed: "Reference image download failed"
{
"request_id": "657f0d1b-76d0-9e3e-b6d6-xxxxxx",
"output": {
"task_id": "5e6fa974-9a25-4271-8659-xxxxxx",
"task_status": "FAILED",
"code": "BadRequest.InputDownloadFailed",
"message": "Reference image download failed, please check image url."
}
}
Cause: The image URL is incorrect, unreachable, or access-restricted. The service downloads the image from the URL during processing.
Solution: Verify the URL is complete and publicly accessible. If the image requires authentication, upload it to a public storage service such as OSS and use the new URL.
InvalidParameter: "Required body invalid"
{
"request_id": "d306ae65-3f6d-9d6c-acfb-xxxxxx",
"code": "InvalidParameter",
"message": "Required body invalid, please check the request body format."
}
Cause: The curl request body contains Chinese characters that the client cannot parse.
Solution: On macOS or Linux, run curl directly in a terminal (handles UTF-8 natively). On Windows, use an API platform like Postman or Apifox.
Resource download timeout from outside the Chinese mainland
Download the media resource timed out during the data inspection process
Cause: Network instability between regions outside the Chinese mainland and the DashScope service endpoint causes download timeouts.
Solution: Store image resources within the Chinese mainland and configure acceleration. The timeout period is not configurable.