Skip to main content

Voice clone & speech editing

Two multipart endpoints backed by the viitor-voice-nar model. Both return audio bytes and an Inference-Id response header, and both are billed as speech synthesis.

Voice clone

POST https://api.ecohash.com/v1/audio/voice-clone

Generate speech in a target voice from a short reference clip.

Headers

HeaderValue
AuthorizationBearer eco_YOUR_KEY
Content-Typemultipart/form-data

Form fields

FieldTypeRequiredNotes
modeltextyesviitor-voice-nar
inputtextyesText to speak in the cloned voice
reference_audiofileyesShort reference clip of the voice (wav recommended)
languagetextnoLanguage hint for the output

Example

curl https://api.ecohash.com/v1/audio/voice-clone \
-H "Authorization: Bearer eco_YOUR_KEY" \
-F model=viitor-voice-nar \
-F input="This is spoken in the cloned voice." \
-F reference_audio=@sample.wav \
--output cloned.wav

Speech editing

POST https://api.ecohash.com/v1/audio/text-local-edit

Edit the words in existing audio while preserving the original voice. Send the source audio, its original transcript, and the edited transcript; only the changed span is regenerated.

Form fields

FieldTypeRequiredNotes
modeltextyesviitor-voice-nar
source_audiofileyesThe audio to edit (wav recommended)
original_texttextyesTranscript of the source audio, as spoken
edited_texttextyesThe full transcript with edits applied

Optional tuning fields are forwarded to the engine when supplied: language, sample_rate, input_format, output_format, align_granularity, padding_ms, length_mode, num_steps, cfg_scale, and related parameters.

Example

curl https://api.ecohash.com/v1/audio/text-local-edit \
-H "Authorization: Bearer eco_YOUR_KEY" \
-F model=viitor-voice-nar \
-F source_audio=@original.wav \
-F original_text="Let's meet at noon tomorrow." \
-F edited_text="Let's meet at five tomorrow." \
--output edited.wav

Response

The response body is the generated audio. Content-Type matches the produced format; the Inference-Id header carries a per-request identifier.

Errors

See Errors. Common: 400 (missing field), 401, 402, 403 (model not allowed for this key), 404 (unknown model), 429.

Guides