Skip to content

Get Download URL for Generated Files

OpenAPI Specification

yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/common/download-url:
    post:
      summary: Get Download URL for Generated Files
      deprecated: false
      description: >-
        # Get Download Link for Generated Files

        ::: tip
          Convert generated file URLs into downloadable temporary links. Only supports files generated by kie.ai services.
        :::

        ### Features

        * Convert kie.ai generated file URLs into downloadable links

        * Supports all file types generated by the kie.ai platform (images,
        videos, audio, etc.)

        * Temporary download links are valid for 20 minutes

        * Secure access to generated content

        * Protected by API Key authentication

        ### Important Notes

        ::: warning

        Only supports file URLs generated by kie.ai services. External file URLs
        will return a 422 validation error.

        :::

        ::: tip

        Downloadable links expire after 20 minutes. Please ensure you download
        or cache content within this timeframe.

        :::
      operationId: download-url
      tags:
        - docs/en/Common API
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  description: Image URL (Required)
                  type: string
              required:
                - url
              x-apidog-orders:
                - url
              x-apidog-ignore-properties: []
            example: |-
              {
                "url": "https://tempfile.aiquickdraw.com/path/to/image.jpg" // 图片url(必填)
              }
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      code:
                        type: integer
                        enum:
                          - 200
                          - 401
                          - 402
                          - 404
                          - 422
                          - 429
                          - 455
                          - 500
                          - 505
                        description: >-
                          Response Status Code

                          | Code | 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 - Invalid URL (External file
                          URLs are not supported) |

                          | 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 |
                      msg:
                        type: string
                        description: Error message when code != 200
                        examples:
                          - success
                    x-apidog-orders:
                      - code
                      - msg
                    x-apidog-ignore-properties: []
                  - type: object
                    properties:
                      data:
                        type: string
                        format: uri
                        description: Downloadable URL for the file. Valid for 20 minutes.
                        examples:
                          - >-
                            https://tempfile.1f6cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbd98
                    x-apidog-orders:
                      - data
                    x-apidog-ignore-properties: []
              example:
                code: 200
                msg: success
                data: https://tempfile.1f6cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxbd98
          headers: {}
          x-apidog-name: ''
        '500':
          description: request failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: >-
                      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**: Upstream is currently experiencing service
                      issues. 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:
                    type: string
                    description: Response message, error description when failed
                  data:
                    type: object
                    properties: {}
                    x-apidog-orders: []
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - code
                  - msg
                  - data
                required:
                  - code
                  - msg
                  - data
                x-apidog-ignore-properties: []
              example:
                code: 500
                msg: >-
                  Server Error - An unexpected error occurred while processing
                  the request
                data: null
          headers: {}
          x-apidog-name: 'Error '
      security:
        - BearerAuth: []
          x-apidog:
            schemeGroups:
              - id: kn8M4YUlc5i0A0179ezwx
                schemeIds:
                  - BearerAuth
            required: true
            use:
              id: kn8M4YUlc5i0A0179ezwx
            scopes:
              kn8M4YUlc5i0A0179ezwx:
                BearerAuth: []
      x-apidog-folder: docs/en/Common API
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1184766/apis/api-28506188-run
components:
  schemas: {}
  securitySchemes:
    BearerAuth:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: |-
        所有 API 都需要通过 Bearer Token 进行身份验证。

        获取 API Key:
        1. 访问 API Key 管理页面 获取您的 API Key

        使用方法:
        在请求头中添加:
        Authorization: Bearer YOUR_API_KEY

        注意事项:
        - 请妥善保管您的 API Key,切勿泄露给他人
        - 若怀疑 API Key 泄露,请立即在管理页面重置
    BearerAuth1:
      type: bearer
      scheme: bearer
      bearerFormat: API Key
      description: |-
        所有 API 都需要通过 Bearer Token 进行身份验证。

        获取 API Key:
        1. 访问 API Key 管理页面 获取您的 API Key

        使用方法:
        在请求头中添加:
        Authorization: Bearer YOUR_API_KEY

        注意事项:
        - 请妥善保管您的 API Key,切勿泄露给他人
        - 若怀疑 API Key 泄露,请立即在管理页面重置
servers:
  - url: https://api.kie.ai
    description: 正式环境
security:
  - BearerAuth: []
    x-apidog:
      schemeGroups:
        - id: kn8M4YUlc5i0A0179ezwx
          schemeIds:
            - BearerAuth
      required: true
      use:
        id: kn8M4YUlc5i0A0179ezwx
      scopes:
        kn8M4YUlc5i0A0179ezwx:
          BearerAuth: []

Self-contained reference. Not affiliated with kie.ai.