Skip to content

API docs · Video (V1 API) · Video tools

Subtitle removal API

POST /api/v1/tools/erase-video-subtitle: remove subtitles from a video, same shape as Volcano Engine AI MediaKit; parameters, response, billing and errors.

Removes the subtitles from a video and returns a new video. Paths, request bodies and response shapes match the subtitle-removal tools of Volcano Engine AI MediaKit. There are two versions: standard and refined (pro). The API is asynchronous: submitting returns a task ID, which you then pass to the query endpoint to fetch the result.

Subtitle removal is currently available on the China site only. Calls on this site return 404 (not_available).

Endpoints

Method and pathPurposescope
POST /api/v1/tools/erase-video-subtitleSubmit a subtitle-removal task (standard)tasks:create
POST /api/v1/tools/erase-video-subtitle-proSubmit a subtitle-removal task (pro)tasks:create
GET /api/v1/tasks/{task_id}Query a tasktasks:read

These paths start with /api/v1, so the full URL is https://api.aitoken.tools/api/v1/…. They are not under /v1, and not under /api/v3 of the Ark-compatible API.

Migrating from Volcano Engine

Code written against the official documentation needs the two changes below. Note also that this platform only processes original result URLs generated by Volcano Ark; videos from other sources return 400:

  1. Replace the host with this platform’s API host. Paths stay the same.
  2. Replace the key in the Authorization header with a platform API key.

Before you start

  • Authenticate with Authorization: Bearer <platform API key>.
  • Submitting needs tasks:create and querying needs tasks:read. These are the same scopes as video tasks, so existing keys work as they are.
  • Only original result URLs generated by Volcano Ark are processed; see the next section. This API is free.

Request parameters (both versions)

The body is JSON. Fields not listed on this page are rejected with 400, not silently ignored.

ParameterRequiredDescription
video_urlExactly one of the twoAn original result URL you obtained by calling Volcano Ark directly (an https URL of an Ark result bucket, valid for 24 hours after generation). Videos from other sources, re-hosted links and enhanced videos are not supported. Result URLs returned by video tasks on this platform are re-hosted and cannot be used here; use source_task_id instead
source_task_idExactly one of the twoID of a video generation task on this platform (task_…). If the task object carries official_task_id (the official cgt-… ID), that works too. The platform uses the original Ark URL from that generation, which is valid for 24 hours, so submit soon after the task succeeds; requests close to the 24-hour mark are rejected. The task must belong to your account and have succeeded; tasks delivered with quality enhancement (including economy editions) are not supported. This is a platform extension; the official API has no such parameter
client_tokenOptionalIdempotency key, 1–64 printable ASCII characters. Submitting again with the same client_token on the same account returns the first task; no second task is created

Additional parameters of the pro version

Only the pro version accepts the parameters below. All are optional; their meaning and defaults are the same as in the official API.

ParameterDescription
model_versionv4, v5 or v5.6
modeSubtitle or Text
output_encode_modeQuality or Size
output_formatmp4 or mov; mov is only supported by v5: omitting model_version uses v5, while v4 or v5.6 returns 400
erase_ratio_locationArray of up to 20 boxes. Each box has top_left_x, top_left_y, bottom_right_x and bottom_right_y as ratios from 0 to 1; the bottom-right corner must be below and to the right of the top-left corner
time_segment_filtermode is skip or selected; segments holds 1–200 entries, each with start_time and end_time (end_time must be greater than start_time). In selected mode a segment may carry its own erase_ratio_location, but not together with the global erase_ratio_location
subtitle_filterMay contain min_text_height_ratio, max_text_height_ratio and center_offset_ratio, each from 0 to 1

The standard version accepts only the common parameters from the previous section.

Differences from the official API

  • video_url accepts only original Volcano Ark result URLs. mediakit://, vod:// and tos:// sources and public URLs from other sources are not supported.
  • media_output_destination and queue_id are not supported: the platform stores the result and the query endpoint returns a download URL.
  • callback_url and callback_args are not supported yet. Poll the query endpoint.
  • Task IDs belong to this platform and start with mkt_. They work only with the query endpoint on this page, not with the video task endpoints.

Response

A successful submission returns success, task_id and request_id.

The query endpoint returns the current state of the task. If processing fails, the HTTP status is still 200; check status.

FieldDescription
statusrunning (queued or processing), completed (succeeded) or failed
result.video_urlDownload URL of the result, present only after the task has succeeded. The URL is valid for at most 1 hour and never past expires_at; after it expires, query again to get a fresh one. May be null while the account is suspended
result.durationDuration of the result in seconds
expires_atTime until which the result is kept (Unix seconds). Close to or after that time the result is no longer served and video_url is null
created_at / finished_atWhen the task was created and when it finished (Unix seconds)
errorcode, type and message when the task failed

Results are retained for the same period as video tasks; see Result retention.

Billing

  • Subtitle removal is free: nothing is held or charged, and it works with an account quota of 0.
  • It is free because the video must be an original result URL generated by Volcano Ark. Requests that do not meet this return 400 on submission and no task is created. Each account can have at most 10 subtitle-removal tasks in progress at once; beyond that the request returns 429.

Processing time and polling

Processing time depends on the duration and resolution of the video; even a short video can take from a few minutes to tens of minutes. Query every 10–30 seconds and stop on completed or failed.

Processing is capped at 6 hours. A task that runs longer fails with Timeout.

Request errors

Errors use the MediaKit shape: success is false and error holds code, type and message. Parameter errors that can be traced to one field also carry param.

HTTPcodeWhen
400invalid_parameterInvalid parameters: neither video_url nor source_task_id is given, or both are; video_url is not an original Ark result URL; an unsupported field is sent; a value is out of range; or the task behind source_task_id has not succeeded, was enhanced, has no original Ark URL, or its original URL has expired
400invalid_requestThe body is not valid JSON, or Content-Type: application/json is missing
401invalid_api_keyMissing or invalid key
403permission_deniedThe key lacks the required scope
403account_suspendedThe account is suspended and cannot submit new tasks. Querying still works, but result.video_url may be null
404not_availableSubtitle removal is not offered on this site (China site only)
404not_foundThe task ID does not exist, or the video task behind source_task_id does not exist
409idempotency_conflictThis client_token was already used with the other version of the endpoint
429rate_limitedToo many requests, or 10 subtitle-removal tasks are already in progress; wait for the time given in the Retry-After header, then retry
503no_available_channelSubtitle removal is temporarily unavailable; retry later

Task failure codes

When a task fails after it was accepted, error.code in the query response is one of the values below.

error.codeMeaning
ServiceUnavailableThe service was temporarily unavailable and the task was not processed. Submit again later
SourceUnavailableFor tasks submitted with source_task_id: the original Ark URL expired before processing started
TimeoutProcessing took longer than 6 hours
ResultUnavailableThe result could not be saved, or it exceeds the size the platform can store (in that case split the video and try again)
…An error code returned by the processor, for example an unreadable video or a rejected parameter; see error.message for the reason
# Submit a subtitle-removal task (standard): pass a video URL
curl https://api.aitoken.tools/api/v1/tools/erase-video-subtitle \
  -H "Authorization: Bearer $AITOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "video_url": "https://ark-acg-cn-beijing.tos-cn-beijing.volces.com/…/cgt-xxx.mp4?…" }'

# Pro version: pass the ID of a video task on this platform
curl https://api.aitoken.tools/api/v1/tools/erase-video-subtitle-pro \
  -H "Authorization: Bearer $AITOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "source_task_id": "task_xxx", "model_version": "v5" }'

# Query the task until status is completed or failed
curl https://api.aitoken.tools/api/v1/tasks/mkt_xxx \
  -H "Authorization: Bearer $AITOKEN_API_KEY"