Seed Audio 1.5 Video Dubbing
Translate and dub Chinese or English video into 30 target languages, with optional video and source/target subtitle files.
Tüm belgeler/v1/audio/seed/tasksSubmit seed-audio-1-5-video-dubbing tasks and poll GET /v1/audio/seed/tasks/{task_id}. Replace all example media URLs with your own public files. APISea selects the operation; no input.mode or callback configuration is required.
İstek örnekleri
# Requires Bash, curl, and jq. Replace example.com media URLs before running.
set -euo pipefail
TASK=$(curl --fail-with-body --silent --show-error \
"https://api.apisea.ai/v1/audio/seed/tasks" \
-H "Authorization: Bearer $APISEA_API_KEY" \
-H "Content-Type: application/json" \
--data '
{
"model": "seed-audio-1-5-video-dubbing",
"input": {
"video_urls": [
"https://example.com/interview-zh.mp4"
],
"target_language": "en",
"glossaries": [
{
"source": "星海计划",
"target": "Project Starsea"
}
],
"dialogue_enhancement": "medium",
"include_video": true,
"include_subtitles": true,
"include_source_subtitles": true,
"format": "wav"
}
}
')
TASK_ID=$(printf '%s' "$TASK" | jq -er '.data.task_id')
for attempt in $(seq 1 120); do
TASK=$(curl --fail-with-body --silent --show-error \
"https://api.apisea.ai/v1/audio/seed/tasks/$TASK_ID" \
-H "Authorization: Bearer $APISEA_API_KEY")
STATUS=$(printf '%s' "$TASK" | jq -er '.data.status')
case "$STATUS" in
completed) printf '%s\n' "$TASK" | jq '.data | {result, cost_usd}'; exit 0 ;;
failed) printf '%s\n' "$TASK" >&2; exit 1 ;;
submitted|processing) sleep 5 ;;
*) printf 'Unexpected task status: %s\n' "$STATUS" >&2; exit 1 ;;
esac
done
printf 'Polling timed out; resume GET polling with task_id=%s (do not resubmit).\n' "$TASK_ID" >&2
exit 1Authentication
Send Authorization: Bearer YOUR_APISEA_API_KEY on POST and GET requests. Send Content-Type: application/json when submitting. Manage keys in the APISea console.
Request parameters
Use POST /v1/audio/seed/tasks with {"model": "seed-audio-1-5-video-dubbing", "input": {...}}. APISea selects the operation from the public model ID. Do not send input.mode. Only the fields for this operation are listed below; do not add fields from another Seed Audio operation.
model
string — required.
Must be seed-audio-1-5-video-dubbing.
input
object — required.
Task inputs described below. Keep these fields nested inside input. APISea selects the operation from model; do not supply input.mode.
input.video_urls
string[] — required.
Exactly one public HTTP(S) URL for a 4–360 second MP4 or MOV video.
input.target_language
string — required.
Target language, required even with custom subtitles. Supported codes: zh, en, ja, ko, de, fr, pt-BR, th, id, vi, ms, fil, it, ru, nl, pl, tr, sv, es-ES, es-MX, ar, pt-PT, fi, da, no, cs, hu, el, ro, hi.
input.format
string — optional; default: wav.
Audio download format: wav, mp3, or ogg_opus.
input.sample_rate
integer — optional.
For WAV/MP3: 8000, 16000, 24000, 32000, 44100, or 48000 Hz; default 44100. For Ogg Opus: only 48000 Hz, which is also its default. Omit to use the format default.
input.glossaries
object[] — optional.
Translation preferences. Each entry requires non-empty source and target strings. Mutually exclusive with custom_subtitle_url.
input.glossaries[].source
string — required.
Source phrase; required within every glossary entry.
input.glossaries[].target
string — required.
Preferred translation; required within every glossary entry.
input.custom_subtitle_url
string — optional.
Public HTTP(S) URL of a UTF-8 SRT file in the target language. Every segment must be at most 15 seconds. Supplies the dialogue to dub. Mutually exclusive with glossaries.
input.dialogue_enhancement
string — optional; default: off.
Dialogue enhancement level: off, low, medium, or high.
input.include_video
boolean — optional; default: false.
Return a video with the generated or dubbed audio in addition to the audio file.
input.include_subtitles
boolean — optional; default: false.
Request target-language subtitle download links in SRT and JSONL formats.
input.include_source_subtitles
boolean — optional; default: false.
Request source-language subtitle download links in SRT and JSONL formats.
Usage notes
The source language is detected automatically. Send a source video and dubbing settings, without prompt. You can lock terminology with a glossary, or use an approved target-language UTF-8 SRT file instead of automatic translation. A glossary and a custom subtitle file cannot be used together. target_language remains required when using custom subtitles.
Dub from approved subtitles
Use custom_subtitle_url instead of glossaries. Each SRT segment must be no longer than 15 seconds. For example:
{"model":"seed-audio-1-5-video-dubbing","input":{"video_urls":["https://example.com/interview-zh.mp4"],"target_language":"en","custom_subtitle_url":"https://example.com/approved-en.srt","include_video":false,"include_subtitles":true,"include_source_subtitles":true}}Subtitle outputs
When returned, result.extra_results.subtitles contains target-language srt_url and jsonl_url download links. result.extra_results.source_subtitles has the same fields for the original language. result.extra_results.target_language identifies the selected target. These are auxiliary outputs, not additional entries in result.urls. Always check that each optional group exists before accessing its links.
Poll task status and read results
Save data.task_id from the submission response. Use the same APISea key for authenticated polling:
curl --fail-with-body --silent --show-error \
"https://api.apisea.ai/v1/audio/seed/tasks/$TASK_ID" \
-H "Authorization: Bearer $APISEA_API_KEY"Continue polling while data.status is submitted or processing. Stop on completed or failed. A failed task is terminal, not a reason to continue polling indefinitely. APISea handles completion; no incoming callbacks, webhook registration, callback_url, or request_type are needed or accepted. Long media may take several minutes. The examples poll every five seconds for up to ten minutes; on a client timeout, resume GET polling with the same task ID instead of creating another billable task.
A successful task returns data.result.urls (an array of media URL strings), data.result.final_duration (billable seconds), optional data.result.extra_results (structured auxiliary outputs), and optional data.cost_usd (the finalized USD charge). Audio URLs appear in track order, followed by any requested video. result is a JSON object, not a JSON-encoded string: no additional JSON parsing is needed. extra_results may be absent when no auxiliary outputs are returned. Do not use client elapsed time to estimate billable duration. Example CDN URLs below are illustrative, not live results.
Pricing and rounding
The retail rate is $0.72 per minute with audio output (include_video: false or omitted), or $1.08 per minute with audio and video output (include_video: true). Eight billable seconds cost $0.096 for audio only or $0.144 with video. Subtitle flags do not select the video-output rate; include_video does.
final_duration is the billable duration rounded up to a whole second. After duration rounding, the per-request USD charge is rounded up in $0.0012 increments. This is not nearest-cent rounding and not rounding the retail total to $0.001. For the retail per-minute rate R and billable seconds S, the exact equivalent public calculation is:
cost_usd = ceil(((S / 60) * R) / 0.0012) * 0.0012Use decimal arithmetic for monetary calculations to avoid binary floating-point ceiling errors. Read the finalized data.cost_usd when available rather than recomputing an invoice from a displayed rate.
Available balance and retries
Before submission, the account and key need $4.32 for audio output, or $6.48 when returning video available for a temporary authorization. This is not the final charge: unused funds are released on completion, and a confirmed failed task costs $0. To retry a submission safely, send the same Idempotency-Key header and identical JSON body.
Related Seed Audio APIs
Yanıtlar
{
"data": {
"task_id": "task_seed_example",
"status": "submitted"
}
}Bu uç noktayı kullanan modeller
Bu belgelerde bir sorun mu buldunuz? support@apisea.ai adresine e-posta gönderin.