Samples
0:00 / 0:09
Transcript
The river bends past the old mill, where a narrow footbridge crosses to the orchard on the far bank, and the path climbs gently into the hills.
Saved voice vo_hVAiUiqrYyvgKKkBvgzHnh
Capabilities
- Voice cloning
- From a clip of 5 to 20 s, with or without its transcript
- Cross-lingual cloning
- The clip and the text may be in different languages
- Languages
- 9: Chinese, English, Japanese, Korean, German, Spanish, French, Italian, Russian
- Seed
- The same
seedand parameters give the same audio, set on a media job - Text
- Up to 5,000 characters per request
- Output
- MP3, WAV or Opus, set with
response_format
Request
The request for the sample above.
curl
curl https://api.albastov.com/v1/audio/speech \
-H "Authorization: Bearer $ALBASTOV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "cosyvoice3",
"voice": "vo_hVAiUiqrYyvgKKkBvgzHnh",
"input": "The river bends past the old mill, where a narrow footbridge crosses to the orchard on the far bank, and the path climbs gently into the hills."
}' \
--output river.mp3Python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.albastov.com/v1", api_key=os.environ["ALBASTOV_API_KEY"])
with client.audio.speech.with_streaming_response.create(
model="cosyvoice3",
voice="vo_hVAiUiqrYyvgKKkBvgzHnh",
input="The river bends past the old mill, where a narrow footbridge crosses to the orchard on the far bank, and the path climbs gently into the hills.",
) as response:
response.stream_to_file("river.mp3")JavaScript
import { writeFile } from "node:fs/promises";
const response = await fetch("https://api.albastov.com/v1/audio/speech", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ALBASTOV_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "cosyvoice3",
voice: "vo_hVAiUiqrYyvgKKkBvgzHnh",
input: "The river bends past the old mill, where a narrow footbridge crosses to the orchard on the far bank, and the path climbs gently into the hills.",
}),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
await writeFile("river.mp3", Buffer.from(await response.arrayBuffer()));Every parameter, response header and error: Speech reference.