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
| Header | Value |
|---|---|
Authorization | Bearer eco_YOUR_KEY |
Content-Type | multipart/form-data |
Form fields
| Field | Type | Required | Notes |
|---|---|---|---|
model | text | yes | viitor-voice-nar |
input | text | yes | Text to speak in the cloned voice |
reference_audio | file | yes | Short reference clip of the voice (wav recommended) |
language | text | no | Language 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
| Field | Type | Required | Notes |
|---|---|---|---|
model | text | yes | viitor-voice-nar |
source_audio | file | yes | The audio to edit (wav recommended) |
original_text | text | yes | Transcript of the source audio, as spoken |
edited_text | text | yes | The 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.