Developer Docs/AI Upscale API

AI Upscale API

Build AI Upscale integrations with A2E. Review authentication, request parameters, task creation, status, and result endpoints.

Overview

Enhance the resolution of images and videos using AI super-resolution. Sharpens fine detail and reduces compression artifacts without visible upscale noise.

Primary Endpoint

POST/api/v1/userUpscale/start

Create an asynchronous media-upscaling task for the submitted image or video source and return the record used to monitor processing. ### Request - Send a valid bearer token. The server evaluates the operation in the authenticated caller's access context. - Send an `application/json` body. Required fields: `source_url`. - API-token callers may include `webhook_url` and `webhook_token` for best-effort terminal-state notifications; ordinary JWT/cookie calls ignore these fields. ### Behavior - This is an asynchronous operation: a successful submission creates a task and returns before processing finishes. - Persist the returned task identifier and use the corresponding detail or list operation to observe progress. - Treat the detail endpoint as the source of truth even when webhook delivery is enabled. ### Response - A `200` response confirms task acceptance; it does not by itself mean media generation has completed. - Retain the returned identifier and wait for a documented terminal status before using output URLs. - JSON object responses, including error responses, normally carry a top-level `trace_id` string for this request; include it when contacting support. It is not a task identifier. - Do not infer undocumented fields or statuses; clients should tolerate additional response properties. ### Errors - `422` — Content moderation rejected the image at `source_url` or sampled frames of a V2 source video. Code `1003` means confirmed minor content. Code `1004` means suspected minor content. For `1004`, confirm the input and retry with `minor_suspected_skip: true`. ### Related Operations - `GET /api/v1/userUpscale/allRecords` — Get all task records. - `GET /api/v1/userUpscale/{_id}` — Get task details. - `DELETE /api/v1/userUpscale/{_id}` — Delete task. Authentication: set header Authorization: Bearer <token> (supports user JWT or sk_ API token).

Request Parameters

NameTypeRequiredDescription
ai_sharing_consentobjectNoConsent receipt for newer native apps. Legacy native requests may omit this field and continue without a consent record. If present, null, malformed, expired or incomplete receipts return AI_SHARING_CONSENT_REQUIRED before generation. Valid receipts cover all actual AI recipients, including safety providers and intermediaries, and constrain later fallback. Content safety checks remain required for native requests. Web and legacy API behavior is unchanged. The recipient example below is for the default V1 model. When supplied, V2 professional receipts must also include BytePlus/ByteDance; standard uses Alibaba Cloud. Receipts for kie_image must also include KIE.
ai_sharing_consent.versionenum: 2026-11-12Yes-
ai_sharing_consent.recipientsarray<string>Yes-
free_quota_expectedbooleanNoWeb request expecting a free discount; returns 12006 when the discount decreases. API tokens are ineligible.
free_quota_expected_coinsnumberNoMinimum expected free credits. If the available discount decreases, returns 12006 without creating a task or automatically charging a higher price.; minimum: 0
namestringNoName of the upscale task
source_urlstringYesURL of the source image or video
model_versionenum: v1 | v2 | kie_imageNoUpscale model. V1 supports images and videos (video processing is capped at 15 seconds). V2 supports paid-user videos up to 60 seconds. kie_image is the paid-user V2 Image Upscale model, billed by output pixels.; default: "v1"
upscale_factorenum: 1 | 2 | 4 | 8Nokie_image only. Multiplies both image dimensions. 1 enhances at the original size; output must stay within 67,108,864 pixels and 16,384 pixels per side. Input JPG, PNG, WEBP, BMP or GIF up to 20 MB.; default: 2
mediakit_tool_versionenum: standard | professionalNoV2 enhancement version. Choose Standard or Professional.; default: "standard"
mediakit_resolutionenum: 1080p | 2kNodefault: "1080p"
mediakit_bit_depthenum: 8 | 10 | 12 | 16NoProfessional version only.
minor_suspected_skipbooleanNoSet to true when retrying after error code 1004 to confirm and bypass the suspected-minor soft block.; default: false
webhook_urlstringNoHTTPS URL to receive task.completed / task.failed notifications. Best-effort delivery, single attempt, no retries; clients should treat the detail API as the source of truth.; maxLength: 2048
webhook_tokenstringNoOptional plaintext token returned in the X-A2e-Webhook-Token header so receivers can verify the request originated from a2e.; maxLength: 256
Request schema and conditional rules
{
  "allOf": [
    {
      "type": "object",
      "properties": {
        "ai_sharing_consent": {
          "type": "object",
          "description": "Consent receipt for newer native apps. Legacy native requests may omit this field and continue without a consent record. If present, null, malformed, expired or incomplete receipts return AI_SHARING_CONSENT_REQUIRED before generation. Valid receipts cover all actual AI recipients, including safety providers and intermediaries, and constrain later fallback. Content safety checks remain required for native requests. Web and legacy API behavior is unchanged. The recipient example below is for the default V1 model. When supplied, V2 professional receipts must also include BytePlus/ByteDance; standard uses Alibaba Cloud. Receipts for kie_image must also include KIE.",
          "required": [
            "version",
            "recipients"
          ],
          "properties": {
            "version": {
              "type": "string",
              "enum": [
                "2026-11-12"
              ]
            },
            "recipients": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "example": [
                "A2E",
                "Alibaba Cloud"
              ]
            }
          }
        },
        "free_quota_expected": {
          "type": "boolean",
          "description": "Web request expecting a free discount; returns 12006 when the discount decreases. API tokens are ineligible."
        },
        "free_quota_expected_coins": {
          "type": "number",
          "minimum": 0,
          "description": "Minimum expected free credits. If the available discount decreases, returns 12006 without creating a task or automatically charging a higher price."
        },
        "name": {
          "type": "string",
          "description": "Name of the upscale task",
          "example": "Upscale media"
        },
        "source_url": {
          "type": "string",
          "description": "URL of the source image or video",
          "example": "https://example.com/video.mp4"
        },
        "model_version": {
          "type": "string",
          "enum": [
            "v1",
            "v2",
            "kie_image"
          ],
          "default": "v1",
          "description": "Upscale model. V1 supports images and videos (video processing is capped at 15 seconds). V2 supports paid-user videos up to 60 seconds. kie_image is the paid-user V2 Image Upscale model, billed by output pixels."
        },
        "upscale_factor": {
          "type": "integer",
          "enum": [
            1,
            2,
            4,
            8
          ],
          "default": 2,
          "description": "kie_image only. Multiplies both image dimensions. 1 enhances at the original size; output must stay within 67,108,864 pixels and 16,384 pixels per side. Input JPG, PNG, WEBP, BMP or GIF up to 20 MB."
        },
        "mediakit_tool_version": {
          "type": "string",
          "enum": [
            "standard",
            "professional"
          ],
          "default": "standard",
          "description": "V2 enhancement version. Choose Standard or Professional."
        },
        "mediakit_resolution": {
          "type": "string",
          "enum": [
            "1080p",
            "2k"
          ],
          "default": "1080p"
        },
        "mediakit_bit_depth": {
          "type": "integer",
          "enum": [
            8,
            10,
            12,
            16
          ],
          "description": "Professional version only."
        },
        "minor_suspected_skip": {
          "type": "boolean",
          "default": false,
          "description": "Set to true when retrying after error code 1004 to confirm and bypass the suspected-minor soft block."
        }
      },
      "required": [
        "source_url"
      ]
    },
    {
      "$ref": "#/components/schemas/WebhookInput"
    }
  ]
}

Response Fields

code: enum: 0
data: object
data._id: string
Task ID for detail and batch polling.
data.name: string
data.prompt: string
data.is_downloaded: boolean
data.is_previewed: boolean
data.current_status: string
Persisted task state; use the concrete task family schema for its allowed values and terminal states.
data.createdAt: string
data.updatedAt: string
data.expirationDate: string
data.remainingDays: number
data.isExpired: boolean
data.coins: number
data.hasRefundCoin: boolean
Whether charged credits were refunded.
data.failed_code: string
data.failed_message: string
data.failed_reason: string
Public failure category when available.
data.image_url: string
data.image_urls: array<string>
data.result_url: string
data.video_url: string
data.result_video_url: string
data.cover_url: string
data.result_cover: string
data.hd_video_url: string
data.video_time: number
data.duration_seconds: number
data.refund_pending: boolean
True means refund pending resolution and takes precedence over hasRefundCoin. Explicit false is preserved; omitted when unknown, including legacy records without a stored flag.
trace_id: string
Trace ID of this HTTP request. Include it when contacting support about this request. It is generated per request and is not a task identifier; use the returned task `_id` to query results.

Request Example

curl -X POST "https://www.a2e.com.cn/api/v1/userUpscale/start" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "source_url": "https://example.com/image.png",
  "model_version": "kie_image",
  "upscale_factor": 2,
  "ai_sharing_consent": {
    "version": "2026-11-12",
    "recipients": [
      "A2E",
      "Alibaba Cloud",
      "KIE"
    ]
  }
}'

Related Endpoints

Responses

200

Upscale task created

422

Content moderation rejected the image at `source_url` or sampled frames of a V2 source video. Code `1003` means confirmed minor content. Code `1004` means suspected minor content. For `1004`, confirm the input and retry with `minor_suspected_skip: true`.