Sintesi vocale
curl --request POST \
--url https://api.erlcrussia.com/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "emmy-voice-1",
"input": "Привет! Чем я могу помочь?",
"language": "ru",
"voice": "F1",
"response_format": "mp3",
"speed": 1
}
'import requests
url = "https://api.erlcrussia.com/v1/audio/speech"
payload = {
"model": "emmy-voice-1",
"input": "Привет! Чем я могу помочь?",
"language": "ru",
"voice": "F1",
"response_format": "mp3",
"speed": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'emmy-voice-1',
input: 'Привет! Чем я могу помочь?',
language: 'ru',
voice: 'F1',
response_format: 'mp3',
speed: 1
})
};
fetch('https://api.erlcrussia.com/v1/audio/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.erlcrussia.com/v1/audio/speech",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'emmy-voice-1',
'input' => 'Привет! Чем я могу помочь?',
'language' => 'ru',
'voice' => 'F1',
'response_format' => 'mp3',
'speed' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.erlcrussia.com/v1/audio/speech"
payload := strings.NewReader("{\n \"model\": \"emmy-voice-1\",\n \"input\": \"Привет! Чем я могу помочь?\",\n \"language\": \"ru\",\n \"voice\": \"F1\",\n \"response_format\": \"mp3\",\n \"speed\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.erlcrussia.com/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"emmy-voice-1\",\n \"input\": \"Привет! Чем я могу помочь?\",\n \"language\": \"ru\",\n \"voice\": \"F1\",\n \"response_format\": \"mp3\",\n \"speed\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlcrussia.com/v1/audio/speech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"emmy-voice-1\",\n \"input\": \"Привет! Чем я могу помочь?\",\n \"language\": \"ru\",\n \"voice\": \"F1\",\n \"response_format\": \"mp3\",\n \"speed\": 1\n}"
response = http.request(request)
puts response.read_body"<string>"Audio
Sintesi vocale
Converte il testo in un file audio. Richiede una chiave IA con il permesso voice.
POST
/
v1
/
audio
/
speech
Sintesi vocale
curl --request POST \
--url https://api.erlcrussia.com/v1/audio/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "emmy-voice-1",
"input": "Привет! Чем я могу помочь?",
"language": "ru",
"voice": "F1",
"response_format": "mp3",
"speed": 1
}
'import requests
url = "https://api.erlcrussia.com/v1/audio/speech"
payload = {
"model": "emmy-voice-1",
"input": "Привет! Чем я могу помочь?",
"language": "ru",
"voice": "F1",
"response_format": "mp3",
"speed": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'emmy-voice-1',
input: 'Привет! Чем я могу помочь?',
language: 'ru',
voice: 'F1',
response_format: 'mp3',
speed: 1
})
};
fetch('https://api.erlcrussia.com/v1/audio/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.erlcrussia.com/v1/audio/speech",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'emmy-voice-1',
'input' => 'Привет! Чем я могу помочь?',
'language' => 'ru',
'voice' => 'F1',
'response_format' => 'mp3',
'speed' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.erlcrussia.com/v1/audio/speech"
payload := strings.NewReader("{\n \"model\": \"emmy-voice-1\",\n \"input\": \"Привет! Чем я могу помочь?\",\n \"language\": \"ru\",\n \"voice\": \"F1\",\n \"response_format\": \"mp3\",\n \"speed\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.erlcrussia.com/v1/audio/speech")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"emmy-voice-1\",\n \"input\": \"Привет! Чем я могу помочь?\",\n \"language\": \"ru\",\n \"voice\": \"F1\",\n \"response_format\": \"mp3\",\n \"speed\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.erlcrussia.com/v1/audio/speech")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"emmy-voice-1\",\n \"input\": \"Привет! Чем я могу помочь?\",\n \"language\": \"ru\",\n \"voice\": \"F1\",\n \"response_format\": \"mp3\",\n \"speed\": 1\n}"
response = http.request(request)
puts response.read_body"<string>"Autorizzazioni
BearerAuthApiKeyAuth
Passaggio del token di autorizzazione nell'intestazione dell'autorizzazione: Bearer .
Corpo
application/json
Текст для озвучивания.
Required string length:
1 - 6000Opzioni disponibili:
emmy-voice-1, supertonic, tts-1, tts-1-hd Opzioni disponibili:
ru, uk, be, en, es, it, fr, zh, ja, ko Opzioni disponibili:
default, F1, F2, emmy, emmy-v2, alloy, nova Opzioni disponibili:
mp3, wav, pcm, aac, flac, opus Intervallo richiesto:
0.25 <= x <= 4Estensione di ER:LC Russia: uno stream NDJSON con una riga per frase. Per il formato OpenAI usa stream_format: sse.
audio restituisce il file intero (predefinito), sse invia gli eventi speech.audio.delta e speech.audio.done.
Opzioni disponibili:
audio, sse Risposta
Risposta riuscita.
The response is of type file.
Questa pagina è stata utile?