Video Enhancer API

November 19, 2026

Video Enhancer API

Submit a video that is already stored on the platform, or a file you uploaded, and receive an enhanced version at 1080p, 2K, or 4K. You can turn text sharpening on or off, and you can enhance the whole video or a clip of up to 10 minutes. Poll for the result, or pass a webhook_url to have the result sent to you when the task finishes.

Supported Video Sources

Pass a platform file URL, or the identity returned by the Upload API. Local upload requires a Starter plan or above.

Workflow

  1. Submit an enhancement task with the source video and a target resolution
  2. Poll the results until status is DONE or ERROR, or receive the result at your webhook
  3. When status is DONE, read output_url

Endpoints

MethodPathDescription
POST/api/v2/video-enhancerSubmit an enhancement task
GET/api/v2/video-enhancer/results/{id}Retrieve the task result

All requests require:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
x-wayinvideo-api-version: v2

Submit Enhancement Task

POST https://wayinvideo-api.wayin.ai/api/v2/video-enhancer

Request Body

ParameterTypeRequiredDefaultDescription
video_urlstringYes—Platform file URL, or the identity returned by the Upload API.
target_resstringYes—Output resolution. Allowed values: 1080p, 2k, 4k.
enable_text_hdbooleanNotrueSharpen on-screen text. When this field is omitted, the default is true.
start_msintegerNo—Clip start, in milliseconds. Omit both start_ms and end_ms to process the whole video, still subject to the 10-minute maximum. Sending only one of the two fields is rejected.
end_msintegerNo—Clip end, in milliseconds. Must be greater than start_ms and must not exceed the source duration.
webhook_urlstringNo—URL that receives the result when the task reaches DONE or ERROR. The URL must be registered first. See Webhook Callback. Omit it to rely on polling only.

The processed range cannot be longer than 10 minutes. Billing uses that range, rounded up to the next whole second. Rates are on the Billing page.

Example Request

curl -X POST https://wayinvideo-api.wayin.ai/api/v2/video-enhancer \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "video_url": "EF_up_06wguq1afbwg1",
    "target_res": "1080p",
    "enable_text_hd": true,
    "start_ms": 0,
    "end_ms": 8000
  }'
import requests

requests.post(
    "https://wayinvideo-api.wayin.ai/api/v2/video-enhancer",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "x-wayinvideo-api-version": "v2",
    },
    json={
        "video_url": "EF_up_06wguq1afbwg1",
        "target_res": "1080p",
        "enable_text_hd": True,
        "start_ms": 0,
        "end_ms": 8000,
    },
)
await fetch('https://wayinvideo-api.wayin.ai/api/v2/video-enhancer', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer YOUR_API_KEY',
    'x-wayinvideo-api-version': 'v2',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    video_url: 'EF_up_06wguq1afbwg1',
    target_res: '1080p',
    enable_text_hd: true,
    start_ms: 0,
    end_ms: 8000,
  }),
});

Response

A newly submitted task is usually PENDING (still queued) or IN_PROGRESS (already running).

{
  "data": {
    "id": "proj_01HQ2X8J3K4L5M6N7O8P9Q0R",
    "status": "IN_PROGRESS"
  }
}
FieldTypeDescription
idstringProject id. Pass it in the results path.
statusstringPENDING (queued), IN_PROGRESS (running), DONE (finished), or ERROR (failed).
output_urlstringURL of the enhanced video. Present only when status is DONE.

Retrieve Enhancement Result

Poll with the id from the submit response until status is DONE or ERROR. When status is DONE, read output_url.

GET https://wayinvideo-api.wayin.ai/api/v2/video-enhancer/results/{id}

Example Request

curl -X GET https://wayinvideo-api.wayin.ai/api/v2/video-enhancer/results/proj_01HQ2X8J3K4L5M6N7O8P9Q0R \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2"

Response

{
  "data": {
    "id": "proj_01HQ2X8J3K4L5M6N7O8P9Q0R",
    "status": "DONE",
    "output_url": "https://cdn.example.com/export/video_0_8000_1080p.mp4"
  }
}

The fields match the submit response. output_url is included when the task is finished.


Webhook Callback

Pass webhook_url when you submit a task. When the task reaches DONE or ERROR, the platform sends one POST request with the result to that URL, so you do not need to poll. The results endpoint stays available and returns the same result.

Setup

  1. Register the URL: Send email to wayinvideo@wayin.ai to apply for this feature.
  2. Submit a task: Include the same webhook_url in the request body. If the URL is not registered, the request is rejected with HTTP 500 and the message webhook_url is not allowed. No task is created and no API Units are deducted.
  3. Receive the callback: When the task finishes, the platform sends a POST request. Return HTTP 200 to confirm delivery.
  4. Handle the result: When result.status is DONE, download result.output_url. When it is ERROR, treat the task as failed. You can confirm either result with the results endpoint.

Example Request

curl -X POST https://wayinvideo-api.wayin.ai/api/v2/video-enhancer \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-wayinvideo-api-version: v2" \
  -d '{
    "video_url": "EF_up_06wguq1afbwg1",
    "target_res": "1080p",
    "enable_text_hd": true,
    "start_ms": 0,
    "end_ms": 8000,
    "webhook_url": "https://your-domain.com/wayin/webhook"
  }'

The submit response is the same as a request without webhook_url.

Callback Request

POST https://your-domain.com/wayin/webhook
Content-Type: application/json

When the task succeeds:

{
  "id": "whknt_06wh3k2m9p1qa",
  "task_type": "video_enhancer_task",
  "result": {
    "id": "proj_01HQ2X8J3K4L5M6N7O8P9Q0R",
    "status": "DONE",
    "output_url": "https://cdn.example.com/export/video_0_8000_1080p.mp4?Expires=...&Signature=...&Key-Pair-Id=..."
  }
}

When the task fails, output_url is not included:

{
  "id": "whknt_06wh3k2m9p1qa",
  "task_type": "video_enhancer_task",
  "result": {
    "id": "proj_01HQ2X8J3K4L5M6N7O8P9Q0R",
    "status": "ERROR"
  }
}
FieldTypeDescription
idstringNotification id. It stays the same across retries, so you can use it to deduplicate.
task_typestringTask type. Always video_enhancer_task for Video Enhancer.
resultobjectSame as data in the results response.
result.idstringProject id, the same as data.id in the submit response.
result.statusstringDONE or ERROR.
result.output_urlstringPresent only when status is DONE. Signed download URL, valid for 24 hours. Download or copy the file in time; after it expires, call the results endpoint for a new URL.

Delivery and Retries

  • Success: Only HTTP 200 counts as delivered. 201, 204, and 3xx are treated as failures, and redirects are not followed.
  • Timeouts: 5 seconds to connect and 20 seconds to read. If your processing takes longer, return 200 first and process the payload asynchronously.
  • Retries: After a failed delivery, the platform retries after about 30 seconds, then 1, 2, 4, 8, 16, and 30 minutes. That is 8 attempts in total, ending after about 1 hour. Each retry may be up to 30 seconds later than scheduled.
  • Duplicates: In rare cases the same notification is delivered more than once. Handle callbacks idempotently by id or result.id.
  • Verification: Callbacks are not signed. To confirm a callback is genuine, call the results endpoint with result.id.

Billing

Video Enhancer consumes API Units for the processed range, rounded up to the next whole second. A range shorter than 1 second is billed as 1 second.

Target resolutionAPI Units
1080p1 per second
2K (2k)2 per second
4K (4k)4 per second

If the account does not have enough API Units, the task is not created and no units are deducted. See Billing and Status Codes.


Errors

Failed requests use the standard status codes and response formats. See Status Codes.