Upscale Images

April 24, 2025

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

This endpoint upscales previously generated images to higher resolution. It takes a task ID and work ID from a completed task, and creates a new upscaled version of the specified image.

https://api.useapi.net/v1/kling/images/upscale

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
  "email": "[email protected]",
  "task_id": "123456789",
  "workId": "987654321"
}
  • email is optional when only one account configured.
    However, if you have multiple accounts configured, this parameter becomes required.

  • task_id is required, the ID of a completed task that generated the image. Must be in the succeed status, which can be checked using GET /tasks/task_id.

  • workId is required, the ID of the specific image from the task to upscale. Can be found in the works array of the GET /tasks/task_id response.

  • maxJobs is optional, range from 1 to 10.
    Specifies the maximum number of concurrent jobs.

  • replyUrl is optional, a callback URL to receive generation progress and result.
    See GET /tasks/task_id for response model.

  • replyRef is optional, a reference identifier for the callback.

Responses
  • 200 OK

    {
      "task": {
        "id": 123456789,
        "userId": 12345,
        "type": "mmu_image_upscale_aiweb",
        "scene": "NORMAL_CREATION",
        "status": 5,
        "status_name": "submitted",
        "status_final": false,
        "taskInfo": {
          "type": "mmu_image_upscale_aiweb",
          "inputs": [
            {
              "name": "input",
              "inputType": "URL",
              "token": null,
              "blobStorage": null,
              "url": "https://s21-kling.klingai.com/....jpg",
              "cover": null,
              "fromWorkId": 987654321
            }
          ],
          "arguments": [
            {
              "name": "biz",
              "value": "klingai"
            },
            {
              "name": "__initialType",
              "value": "mmu_img2img_aiweb"
            },
            {
              "name": "__initialPrompt",
              "value": "Portrait of a woman with blue eyes"
            }
          ],
          "extraArgs": {},
          "callbackPayloads": [],
          "scene": "NORMAL_CREATION"
        },
        "favored": false,
        "deleted": false,
        "viewed": false,
        "createTime": 1745376611075,
        "updateTime": 1745376611075
      },
      "works": [],
      "status": 5,
      "status_name": "submitted",
      "status_final": false,
      "message": "",
      "limitation": {
        "type": "mmu_image_upscale_aiweb",
        "remaining": 10000,
        "limit": 10000
      },
      "userPoints": {
        "points": [],
        "total": 0
      },
      "userTickets": {
        "ticket": []
      },
      "editProject": null
    }
    
  • 400 Bad Request

    {
      "error": "Task 123456789 is not completed"
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    

When successful, the response includes a task ID which can be used to check the status using GET /tasks/task_id.

Model
{ // TypeScript, all fields are optional
    task: {
        id: number
        userId: number
        type: string
        scene: string
        status: number
        status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
        status_final: boolean
        taskInfo: {
            type: string
            inputs: Array<{
                name: string
                inputType: string
                token: string | null
                blobStorage: any | null
                url: string
                cover: string | null
                fromWorkId: number | null
            }>
            arguments: Array<{
                name: string
                value: string
            }>
            extraArgs: Record<string, any>
            callbackPayloads: any[]
            scene: string
        }
        favored: boolean
        deleted: boolean
        viewed: boolean
        createTime: number
        updateTime: number
        viewTime: number
    }
    works: Array<any>
    status: number
    status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
    status_final: boolean
    message: string
    limitation: {
        type: string
        remaining: number
        limit: number
    }
    userPoints: {
        points: Array<{
            orderId: string
            type: string
            amount: number
            balance: number
            startTime: number
            endTime: number
        }>
        total: number
    }
    userTickets: {
        ticket: Array<{
            orderId: string
            type: string
            packageType: string
            amount: number
            balance: number
            startTime: number
            endTime: number
        }>
    }
    editProject: any | null
}
Examples
  • curl -X POST "https://api.useapi.net/v1/kling/images/upscale" \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer …" \
       -d '{
         "email": "[email protected]",
         "task_id": "123456789",
         "workId": "987654321"
       }'
    
  • const token = "API token";
    const email = "Previously configured account email";
    const apiUrl = "https://api.useapi.net/v1/kling/images/upscale"; 
    const response = await fetch(apiUrl, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${token}`,
      },
      body: JSON.stringify({
        email: email,
        task_id: "123456789",
        workId: "987654321"
      })
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    email = "Previously configured account email"
    apiUrl = "https://api.useapi.net/v1/kling/images/upscale"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    data = {
        "email": email,
        "task_id": "123456789",
        "workId": "987654321"
    }
    response = requests.post(apiUrl, headers=headers, json=data)
    print(response, response.json())
    
Try It