Przejdź do głównej treści
POST
/
audio
/
speech
Wygeneruj mowę
curl --request POST \
  --url https://api.orcarouter.ai/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "openai/tts-1",
  "input": "<string>",
  "voice": "<string>",
  "instructions": "<string>",
  "speed": 2.125,
  "stream_format": "<string>",
  "response_format": "mp3"
}
'

Autoryzacje

Authorization
string
header
wymagane

Klucze API OrcaRouter wyglądają jak sk-orca-.... Przekaż je w nagłówku Authorization: Bearer sk-orca-....

Treść

application/json
model
string
wymagane

Model TTS OpenAI — openai/tts-1, openai/tts-1-hd, openai/gpt-4o-mini-tts. Modele preview Gemini TTS nie są obsługiwane na tym endpoincie; użyj zamiast tego natywnej powierzchni /v1beta/ Gemini z responseModalities: ["AUDIO"].

Przykład:

"openai/tts-1"

input
string
wymagane
voice
string
wymagane

Identyfikator głosu. Brama przekazuje to pole do upstreamu bez zmian — użyj nazwy głosu, którą obsługuje upstreamowy model.

Przykłady:

"alloy"

"echo"

"fable"

"onyx"

"nova"

"shimmer"

instructions
string

Opcjonalne wskazówki głosowe (np. styl, ton). Honorowane przez modele, które je obsługują, takie jak openai/gpt-4o-mini-tts.

speed
number

Tempo odtwarzania. Domyślnie 1.0.

Wymagany zakres: 0.25 <= x <= 4
stream_format
string

Gdy ustawione, odpowiedź jest strumieniowana w tym formacie fragment po fragmencie (zależnie od wsparcia upstreamu).

response_format
enum<string>
domyślnie:mp3
Dostępne opcje:
mp3,
opus,
aac,
flac,
wav,
pcm

Odpowiedź

Binarna zawartość audio.