Infill

Infill (Bytes)

Generate audio that smoothly connects two existing audio segments

post/infill/bytes

Request

Headers

Cartesia-Version'2026-03-01' date required
Example:2026-03-01

API version header.

Request body multipart/form-data

left_audiostring binary

Audio clip that comes before the infill transcript: left_audio -> transcript -> right_audio

For best results, target natural pauses in the audio and clip tightly. At least one of left_audio or right_audio must be provided.

Supported audio formats: flac, mp3, mpeg, mpga, oga, ogg, wav, webm

right_audiostring binary

Audio clip that comes after the infill transcript: left_audio -> transcript -> right_audio

For best results, target natural pauses in the audio and clip tightly. At least one of left_audio or right_audio must be provided.

Supported audio formats: flac, mp3, mpeg, mpga, oga, ogg, wav, webm

model_id'sonic-3' | 'sonic-3-2026-01-12'

The ID of the model to use for generating audio

language'en' | 'fr' | 'de' | 'es' | 'pt' | 'zh' | 'ja' | 'hi' | 'it' | 'ko' | 'nl' | 'pl' | 'ru' | 'sv' | 'tr' | 'tl' | 'bg' | 'ro' | 'ar' | 'cs' | 'el' | 'fi' | 'hr' | 'ms' | 'sk' | 'da' | 'ta' | 'uk' | 'hu' | 'no' | 'vi' | 'bn' | 'th' | 'he' | 'ka' | 'id' | 'te' | 'gu' | 'kn' | 'ml' | 'mr' | 'pa'

The language that the given voice should speak the transcript in. This may depend on the model you're using. See Models for details.

transcriptstring

The infill text to generate. For best results, use longer transcripts to give the model more flexibility to adapt to the rest of the audio.

voice_idstring

The ID of the voice to use for generating audio

output_format[container]'raw' | 'wav' | 'mp3'
output_format[sample_rate]8000 | 16000 | 22050 | 24000 | 44100 | 48000

The sample rate of the output audio

output_format[encoding]'pcm_f32le' | 'pcm_s16le' | 'pcm_mulaw' | 'pcm_alaw'

The encoding format for output audio. See TTS Output Audio Format if you're unsure what to use.

output_format[bit_rate]integer nullable

Required for mp3 containers.

Response

Audio bytes

Changes

No recorded changes to this operation across all 1 revision of this API.