Schnellstart
Sende deine erste Sprachanfrage an die lokale VoiceStudio-API.
Nur lokale API
Dies gilt für die 0.5.0-API der Desktop-App. Die Cloud-API ist noch nicht veröffentlicht und funktioniert anders: siehe Cloud-Vorschau.
1. App starten
Öffne VoiceStudio. Die API lauscht auf Port 3900, während die App läuft.
export VOICESTUDIO_BASE_URL="http://localhost:3900/v1"
export VOICESTUDIO_API_KEY="local"
curl http://localhost:3900/health{
"status": "ok",
"device": "cuda (NVIDIA GeForce RTX 4090)",
"version": "0.5.0"
}Auf localhost kann der Schlüssel eine beliebige nicht leere Zeichenfolge sein. Er wird nur bei aktiviertem Fernzugriff geprüft.
2. Sprache erzeugen
curl "$VOICESTUDIO_BASE_URL/audio/speech" \
-H "Authorization: Bearer $VOICESTUDIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"voice": "alloy",
"input": "VoiceStudio is ready.",
"response_format": "mp3"
}' \
--output speech.mp33. Oder ein OpenAI-SDK verwenden
import os
from openai import OpenAI
client = OpenAI(
base_url=os.environ["VOICESTUDIO_BASE_URL"],
api_key=os.environ["VOICESTUDIO_API_KEY"],
)
audio = client.audio.speech.create(
model="tts-1",
voice="alloy",
input="The local VoiceStudio API is ready.",
)
audio.stream_to_file("speech.mp3")Als Nächstes ersetze alloy durch eine deiner eigenen Stimmprofil-IDs.