Zum Hauptinhalt springen
POST
/
v1
/
audio
/
speech
curl --request POST \
  --url https://api.apimart.ai/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-4o-mini-tts",
    "input": "The quick brown fox jumps over the lazy dog.",
    "voice": "alloy",
    "response_format": "opus",
    "speed": 1.0
  }' \
  --output speech.opus
Binary audio data stream

Documentation Index

Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url https://api.apimart.ai/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-4o-mini-tts",
    "input": "The quick brown fox jumps over the lazy dog.",
    "voice": "alloy",
    "response_format": "opus",
    "speed": 1.0
  }' \
  --output speech.opus
Binary audio data stream

Authentifizierung

Authorization
string
erforderlich
Alle APIs erfordern eine Bearer-Token-AuthentifizierungAPI-Schlüssel abrufen:Besuchen Sie die API-Schlüssel-Verwaltungsseite, um Ihren API-Schlüssel zu erhaltenFügen Sie ihn dem Anfrage-Header hinzu:
Authorization: Bearer YOUR_API_KEY

Body

model
string
Standard:"gpt-4o-mini-tts"
erforderlich
Name des TTS-ModellsVerfügbare Modelle:
  • gpt-4o-mini-tts – GPT-4o Mini TTS-Modell
Beispiel: "gpt-4o-mini-tts"
input
string
erforderlich
Der Text, der in Sprache umgewandelt werden sollMaximale Länge: 4096 ZeichenBeispiel: "The quick brown fox jumps over the lazy dog."
voice
string
erforderlich
StimmenauswahlVerfügbare Stimmen:
  • alloy – neutrale, ausgewogene Stimme
  • echo – männliche, ruhige Stimme
  • fable – britische, erzählerische Stimme
  • onyx – männliche, tiefe Stimme
  • nova – weibliche, energische Stimme
  • shimmer – weibliche, sanfte Stimme
Beispiel: "alloy"
response_format
string
Standard:"wav"
erforderlich
Audio-AusgabeformatUnterstützte Formate:
  • wav – WAV-Format, unkomprimiert (Standard)
  • opus – Opus-Format, für Internet-Streaming
  • aac – AAC-Format
  • flac – FLAC-Format, verlustfreie Komprimierung
  • pcm – PCM-Format, unbearbeitete Audiodaten
Beispiel: "wav"
speed
number
Standard:"1.0"
Wiedergabegeschwindigkeit der SpracheBereich: 0,25 bis 4,0
  • 0.25 – langsamste Geschwindigkeit (1/4x)
  • 1.0 – normale Geschwindigkeit (Standard)
  • 4.0 – schnellste Geschwindigkeit (4x)
Beispiel: 1.0

Antwort

Bei Erfolg wird ein binärer Audiodatenstrom zurückgegeben, der als Audiodatei gespeichert oder direkt abgespielt werden kann. Im Fehlerfall werden Fehlerinformationen im JSON-Format zurückgegeben, einschließlich Fehlercode, Nachricht und Typ.