Voiceover generation

Introduction

Voiceover generation turns a script into speech, sound effects or character voices. Use a preset speaker, or upload up to three reference clips and cite them as @音频1, @音频2 and @音频3 in the script. For audio-generate-0.1, send plain text up to 1000 characters; output is WAV at 44100 Hz. Optionally upload one 10–30 second reference recording; no reference transcript is needed. Preset speakers, reference URLs/images and speed, pitch, loudness, subtitle and watermark controls are unavailable. Tasks wait in a single-generation queue; an unknown outcome pauses execution for review. For audio-generate-0.1, settlement uses the generated audio duration, rounded up to seconds; the final credit charge is rounded up to a whole credit.

Unified API (recommended)

New integrations call POST /v1/generations with type=audio. The /v1/audio/* endpoints below remain supported for compatibility.

BASH
curl -X POST https://api.anycap.io/v1/generations \  -H "Authorization: Bearer $ANYCAP_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "type": "audio",    "model": "<model from GET /v1/generations/models?type=audio>",    "input": {      "prompt": "参考 @音频1 的语气,说:姐妹们,这条裤子真的绝了,垂感特别好。",      "reference_audio_file_ids": ["<id from POST /v1/video-materials?kind=audio>"]    },    "parameters": { "format": "mp3", "sample_rate": 44100, "speech_rate": 15 }  }'
FieldMeaning
input.prompt
Script to synthesize; cite uploaded reference clips as @音频1..@音频3.
input
One reference mode: speaker, owned reference_audio_file_ids, reference_audio_urls, reference_image_file_id or reference_image_url. They are mutually exclusive; omit all for text-only.
parameters
Output controls: format, sample_rate, speech_rate, loudness_rate, pitch_rate, enable_subtitle, watermark.
model
From GET /v1/generations/models?type=audio.
Audio jobs return 202 with job. Poll GET /v1/generations/{id}; intermediate states are queued, submitting and finalizing, terminal states are completed, failed and pending. Transient provider 5xx and network failures are retried automatically with a longer per-attempt timeout and a bounded number of attempts; when every attempt is still ambiguous the job ends failed and releases the reservation instead of waiting for manual review. pending remains only for platform reconciliation such as result storage or settlement. Add ?result=true to receive a fresh private audio_url; one link is valid for 24 hours at most and never outlives the stored file. Audio jobs are not cancellable.

The job object also echoes the reference inputs used for this generation: reference_audio_file_ids, reference_audio_urls, reference_image_file_id and reference_image_url.

Compatibility endpoints

The capability endpoints below remain supported and behave exactly as before. New integrations should use the unified envelope above.

PurposeMethodPath
Discover modelsGET/v1/audio/models
Create a generationPOST/v1/audio/generations
Read a generationGET/v1/audio/generations/{id}
Read with a fresh audio URLGET/v1/audio/generations/{id}?result=true
Upload reference audioPOST/v1/video-materials?kind=audio
BASH
curl -X POST https://api.anycap.io/v1/audio/generations \  -H "Authorization: Bearer $ANYCAP_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "seed-audio-1.0",    "prompt": "姐妹们,这条裤子真的绝了,垂感特别好。",    "speaker": "zh_female_vv_uranus_bigtts",    "format": "mp3",    "sample_rate": 44100,    "speech_rate": 15  }'

The response is a durable job. Poll GET /v1/audio/generations/{id} until state is completed, failed or pending. Transient provider 5xx and network failures are retried automatically; exhausted retries end failed and release the reservation. A completed job carries billing_status and duration; add ?result=true to receive a fresh private audio_url (24 hours at most, never past the stored file).

Generation modes

  • Text only: send no references and describe speakers, effects and music in prompt.
  • Preset voice: send speaker with a Doubao TTS 2.0 voice id; cite nothing.
  • Reference audio: upload up to three clips (reference_audio_file_ids) or pass up to three public https links (reference_audio_urls); order maps to @音频1..@音频3.
  • Reference image: upload one JPEG/PNG/WebP (reference_image_file_id) or pass one public https link (reference_image_url); the prompt is read as text.
  • Links are fetched by the provider, so their duration, size and availability cannot be checked before submission.
  • speaker, owned reference_audio_file_ids, reference_audio_urls, reference_image_file_id and reference_image_url are mutually exclusive; pick one mode or none. Mixing them fails with 400.

Reference audio

  • Upload each clip first with POST /v1/video-materials?kind=audio; the platform verifies duration and format.
  • Pass the returned ids as reference_audio_file_ids in the generation request. Upload order maps to @音频1..@音频3.
  • Each uploaded clip must be 30 seconds or shorter and at most 10 MiB; up to three clips and 90 seconds in total. Link-based clips are not pre-checked.
  • speaker, owned reference_audio_file_ids, reference_audio_urls, reference_image_file_id and reference_image_url are mutually exclusive; pick one mode or none.

Controls and limits

FieldValuesNotes
format
Valueswav / mp3 / pcm / ogg_opus
NotesDefault mp3. ogg_opus requires 48000 Hz.
sample_rate
Values8000–48000
Notesmp3 does not accept 40000.
speech_rate
Values-50 to 100
Notes0 is normal; 100 is 2.0x.
loudness_rate
Values-50 to 100
Notes0 is unchanged.
pitch_rate
Values-12 to 12
Notes0 is unchanged.
enable_subtitle
Valuestrue / false
NotesDefault false; completed jobs include a sentence-level timeline.
watermark
Valuestrue / false
NotesDefault false; appends the provider AIGC rhythm marker.
prompt
Valuesup to 3000 characters
NotesThe selected source may be stricter.