Skip to content
Questa pagina non è ancora disponibile nella tua lingua, quindi viene mostrata in inglese.

Seed Audio 1.5 Video Voice-over

Create dialogue, narration, and supporting scene sound guided by a video, with optional voice references and video output.

Tutta la documentazione
POST/v1/audio/seed/tasks

Submit seed-audio-1-5-video-voice-over 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.

Esempi di richieste

# 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-voice-over",
  "input": {
    "video_urls": [
      "https://example.com/shoreline.mp4"
    ],
    "prompt": "Narrator (@audio1): \"This is where it begins.\" Start when the sea comes into view. Add gentle waves.",
    "audio_urls": [
      "https://example.com/narrator.wav"
    ],
    "include_video": true,
    "format": "mp3",
    "sample_rate": 44100,
    "speech_rate": 0,
    "loudness_rate": 0,
    "pitch_rate": 0
  }
}
')
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 1

Authentication

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-voice-over", "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-voice-over.

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.prompt

string — required.

Words to speak and scene instructions, including the desired timing relative to the video. Use @audio1, etc. for optional voice references.

input.audio_urls

string[] — optional.

Optional one to six public HTTP(S) WAV or MP3 reference files, each 2–30 seconds. Refer to them in order with @audio1, @audio2, etc. in the prompt. Omit the field when no references are needed.

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.speech_rate

integer — optional; default: 0.

Speech rate adjustment from -50 to 100.

input.loudness_rate

integer — optional; default: 0.

Loudness adjustment from -50 to 100.

input.pitch_rate

integer — optional; default: 0.

Pitch adjustment from -12 to 12.

input.include_video

boolean — optional; default: false.

Return a video with the generated or dubbed audio in addition to the audio file.

Usage notes

Provide one video to guide timing and a prompt containing the spoken lines. Describe narration, delivery, and supporting sound cues to align with the picture. Spoken lines are required; music-only, ambience-only, and sound-effect-only generation are unsupported. Optionally add reference audio to guide the voice. Use include_video: true to request a video with the generated sound as well as the audio file.

Audio-only output

Set include_video to false or omit it to receive only the generated audio. video_urls is still required as the visual input. Omit audio_urls if a reference voice is not needed.

Poll task status and read results

Save data.task_id from the submission response. Use the same APISea key for authenticated polling:

bash
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.18 per minute of billable audio. Requesting video output does not change this voice-over rate. Eight billable seconds cost $0.024. One billable second costs $0.0036 after request rounding.

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:

text
cost_usd = ceil(((S / 60) * R) / 0.0012) * 0.0012

Use 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 $1.08 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.

Risposte

{
  "data": {
    "task_id": "task_seed_example",
    "status": "submitted"
  }
}

Hai trovato un problema in questa documentazione? Scrivi a support@apisea.ai.