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
/api/v1/userUpscale/startCreate 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
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | No | Name of the upscale task |
| source_url | string | Yes | URL of the source image or video |
| model_version | enum: v1 | v2 | No | Upscale model. V2 uses BytePlus AI MediaKit, supports video only, and requires a paid user.; default: "v1" |
| mediakit_tool_version | enum: standard | professional | No | default: "standard" |
| mediakit_resolution | enum: 1080p | 2k | No | default: "1080p" |
| mediakit_bit_depth | enum: 8 | 10 | 12 | 16 | No | Professional version only. |
| minor_suspected_skip | boolean | No | Set to true when retrying after error code 1004 to confirm and bypass the suspected-minor soft block.; default: false |
| webhook_url | string | No | HTTPS 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_token | string | No | Optional 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://headswap.app/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
/api/v1/userUpscale/{_id}Get task details
/api/v1/userUpscale/startStart upscale task
/api/v1/userUpscale/allRecordsGet all task records
/api/v1/userUpscale/allProcessingList processing task identifiers and statuses
/api/v1/userUpscale/batchDetailBatch query task details
/api/v1/userUpscale/{_id}Delete task
/api/v1/userUpscale/retryRetry existing media tasks
Responses
Upscale task created