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 - Non-success responses use the published error envelope; surface the returned message and code to diagnostics. ### 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
namestringNoName of the upscale task
source_urlstringYesURL of the source image or video
model_versionenum: v1 | v2NoUpscale model. V2 uses BytePlus AI MediaKit, supports video only, and requires a paid user.; default: "v1"
mediakit_tool_versionenum: standard | professionalNodefault: "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": {
        "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"
          ],
          "default": "v1",
          "description": "Upscale model. V2 uses BytePlus AI MediaKit, supports video only, and requires a paid user."
        },
        "mediakit_tool_version": {
          "type": "string",
          "enum": [
            "standard",
            "professional"
          ],
          "default": "standard"
        },
        "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
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/video.mp4"
}'

Related Endpoints

Responses

200

Upscale task created