Get Direct Download URL
POSThttps://kieai.erweima.ai/api/v1/gpt4o-image/download-url
Convert an image URL to a direct download URL. This helps solve cross-domain issues when downloading images directly. The returned URL is valid for 20 minutes.
Request
- application/json
Bodyrequired
taskIdstringrequired
The task ID associated with the image generation
Example:
task12345
urlurirequired
The original image URL that needs to be converted to a direct download URL
Example:
https://tempfile.aiquickdraw.com/v/xxxxxxx.png
Responses
- 200
- 500
Request successful
- application/json
- Schema
- Example (auto)
- Example
Schema
codeStatusCode (integer)
Response status code
Enum Value | Description |
---|---|
200 | Success - Request has been processed successfully |
401 | Unauthorized - Authentication credentials are missing or invalid |
402 | Insufficient Credits - Account does not have enough credits to perform the operation |
404 | Not Found - The requested resource or endpoint does not exist |
422 | Validation Error - The request parameters failed validation checks |
429 | Rate Limited - Request limit has been exceeded for this resource |
455 | Service Unavailable - System is currently undergoing maintenance |
500 | Server Error - An unexpected error occurred while processing the request |
505 | Feature Disabled - The requested feature is currently disabled |
Possible values: [200
, 401
, 402
, 404
, 422
, 429
, 455
, 500
, 505
]
msgstring
Error message when code != 200
Example:
success
datastring
Direct download URL valid for 20 minutes
Example:
https://xxxxxx.xxxxxxxx.r2.cloudflarestorage.com/v/xxxxxxx.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250415T101007Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Credential=2464206aa3e576aa7c035d889be3a84e%2F20250415%2Fapac%2Fs3%2Faws4_request&X-Amz-Signature=122ae8bef09110e620841ab2ef8061c1818e754fc201408a9d1c6847b36fd3df
{
"code": 200,
"msg": "success",
"data": "https://xxxxxx.xxxxxxxx.r2.cloudflarestorage.com/v/xxxxxxx.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250415T101007Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Credential=2464206aa3e576aa7c035d889be3a84e%2F20250415%2Fapac%2Fs3%2Faws4_request&X-Amz-Signature=122ae8bef09110e620841ab2ef8061c1818e754fc201408a9d1c6847b36fd3df"
}
{
"code": 200,
"msg": "success",
"data": "https://xxxxxx.xxxxxxxx.r2.cloudflarestorage.com/v/xxxxxxx.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250415T101007Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Credential=2464206aa3e576aa7c035d889be3a84e%2F20250415%2Fapac%2Fs3%2Faws4_request&X-Amz-Signature=122ae8bef09110e620841ab2ef8061c1818e754fc201408a9d1c6847b36fd3df"
}
Server Error
Authorization: http
name: BearerAuthtype: httpscheme: bearerbearerFormat: API Keydescription: All APIs require authentication via Bearer Token. Get API Key: 1. Visit [API Key Management Page](https://kie.ai/api-key) to get your API Key Usage: Add to request header: Authorization: Bearer YOUR_API_KEY Note: - Keep your API Key secure and do not share it with others - If you suspect your API Key has been compromised, reset it immediately in the management page
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://kieai.erweima.ai/api/v1/gpt4o-image/download-url");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"taskId\": \"task12345\",\n \"url\": \"https://tempfile.aiquickdraw.com/v/xxxxxxx.png\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear