Get Download URL for Generated Files
Endpoint
POST /common/download-url
Full URL: https://modelfold.ai/v1/common/download-url
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Get Download Link for Generated Files
TIP
Convert generated file URLs into downloadable temporary links. Only supports files generated by modelfold.ai services.
Features
- Convert modelfold.ai generated file URLs into downloadable links
- Accepts file URLs from task results (such as resultUrls or audio_url). URLs from the File Upload API are not supported.
- Temporary download links are valid for 20 minutes
- Secure access to generated content
- Protected by API Key authentication
Important Notes
WARNING
Accepts file URLs from task results (such as resultUrls or audio_url). URLs from the File Upload API are not supported.
TIP
Downloadable links expire after 20 minutes. Please ensure you download or cache content within this timeframe.
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | File URL from a task result (e.g. resultUrls[0]). Images, videos and audio are supported. |
Request Example
bash
curl -X POST "https://modelfold.ai/v1/common/download-url" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://tempfile.aiquickdraw.com/path/to/image.jpg"
}'json
{
"url": "https://tempfile.aiquickdraw.com/path/to/image.jpg"
}Response
200 — Request successful
| Parameter | Type | Required | Description |
|---|---|---|---|
code | integer | No | Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying). Allowed values: 200 / 401 / 402 / 404 / 422 / 429 / 455 / 500 / 505. Example: 200. |
msg | string | No | Error message when code != 200 Example: success. |
data | string | No | Downloadable URL for the file. Valid for 20 minutes. Example: https://tempfile.1f6cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbd98. |
json
{
"code": 200,
"msg": "success",
"data": "https://tempfile.1f6cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbd98"
}500 — Server error.
| Parameter | Type | Required | Description |
|---|---|---|---|
code | integer | Yes | Response status code - 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 - 408: Timeout - No result has been returned for over 10 minutes. - 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 - 501: Generation Failed - Content generation task failed - 505: Feature Disabled - The requested feature is currently disabled |
msg | string | Yes | Response message, error description when failed |
data | object | Yes | — |
json
{
"code": 500,
"msg": "Server Error - An unexpected error occurred while processing the request",
"data": null
}