Seed Audio 1.5 Audio Generation
Generate spoken dialogue and scene audio from text, with up to six optional voice references.
全部文档/v1/audio/seed/tasksSubmit seed-audio-1-5-generation 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.
请求示例
# 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-generation",
"input": {
"prompt": "Narrator (@audio1), warmly: \"Welcome to the studio.\" Add a quiet room ambience and soft opening music.",
"audio_urls": [
"https://example.com/narrator.wav"
],
"format": "wav",
"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 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-generation", "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-generation.
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.prompt
string — required.
Spoken lines and scene instructions. Quote dialogue, identify speakers, and describe delivery and any supporting ambience, effects, or music.
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.
Usage notes
Write the words to speak, identify each speaker and describe emotion, setting, ambience, music, and effects. Audio generation requires spoken lines; music-only, ambience-only, and sound-effect-only generation are unsupported. Reference audio can guide voice timbre and delivery. No client-controlled duration field is documented: use the returned billable duration rather than assuming a fixed output length.
Text-only generation
Omit audio_urls when no reference is needed. For example:
{"model":"seed-audio-1-5-generation","input":{"prompt":"Say warmly: \"Welcome to the studio.\""}}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.18 per minute of generated audio. Eight billable seconds cost $0.024. One billable second costs $0.0036 after request rounding, rather than $0.003.
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 $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.
Related Seed Audio APIs
响应
{
"data": {
"task_id": "task_seed_example",
"status": "submitted"
}
}发现文档中的问题?请发送邮件至 support@apisea.ai。