Skip to main content

Get Direct Download URL

POST 

https://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

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

Request successful

Schema
    codeStatusCode (integer)

    Response status code

    Enum ValueDescription
    200Success - Request has been processed successfully
    401Unauthorized - Authentication credentials are missing or invalid
    402Insufficient Credits - Account does not have enough credits to perform the operation
    404Not Found - The requested resource or endpoint does not exist
    422Validation Error - The request parameters failed validation checks
    429Rate Limited - Request limit has been exceeded for this resource
    455Service Unavailable - System is currently undergoing maintenance
    500Server Error - An unexpected error occurred while processing the request
    505Feature 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

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
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());
Request Collapse all
Base URL
https://kieai.erweima.ai
Auth
Body required
{
  "taskId": "task12345",
  "url": "https://tempfile.aiquickdraw.com/v/xxxxxxx.png"
}
ResponseClear

Click the Send API Request button above and see the response here!