Naar inhoud springen

xAI Text to Speech

Integreren

Model-ID xai/tts/v1
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/xai/tts/v1?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Deze request: $ 0,001 1 API-tegoed Op deze pagina uitvoeren

API-sleutel ophalen

Tekst-naar-spraak met ingebouwde stemmen, taalselectie en inline tags voor expressieve spraak

xAI · Audio

Je eerste resultaat komt hier

Bouw hieronder een request en voer die uit met je API-sleutel. Uitvoer wordt naar onze opslag gekopieerd en voor altijd of 7 dagen gratis bewaard.

Een aanvraag samenstellen

Besturingselementen worden gegenereerd op basis van het modelschema. De code en de prijs worden bijgewerkt terwijl je ze wijzigt.

•verplicht 50 / 15000

Tekst voor spraaksynthese, met expressieve voordracht die wordt aangestuurd via inline-tags ([laugh], [pause], [sigh]) of omringende tags (<whisper>text</whisper>, <slow>text</slow>). De invoer mag niet meer dan 15.000 tekens bevatten.

Geavanceerd voice · language · enable_safety_checker · output_format
standaard eve

Ingebouwde stem die voor spraaksynthese is geselecteerd.

standaard auto

Taalkeuze uit deze BCP-47-codes: en, zh, fr, de, hi, id, it, ja, ko, pt-BR, pt-PT, ru, es-MX, es-ES, tr, vi, bn, ar-EG, ar-SA, ar-AE. Geef 'auto' op voor automatische detectie.

Configuratie voor de gegenereerde audio-indeling; standaard is MP3 met een samplefrequentie van 24 kHz en een bitrate van 128 kbps.

POST /run/xai/tts/v1?wait=20 prijsopgave → $ 0,001
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/xai/tts/v1?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Deze request uitvoeren

Je sleutel blijft in deze browser: hij wordt alleen naar de Doitong API verzonden en alleen in localStorage opgeslagen als je Onthouden aanvinkt. API-sleutel ophalen

Over xAI Text to Speech

Zet maximaal 15.000 tekens tekst om in spraak. Kies uit 28 ingebouwde stemmen en een taalcodering of automatische detectie. De tekst kan tags bevatten zoals [laugh], [pause] en [sigh], of omhullende tags zoals <whisper> en <slow>, voor expressieve weergave. `output_format` configureert het audiobestand.

Parameters

NaamType StandaardToegestaan Beschrijving
textverplicht
Typestring
≤ 15.000 tekens
Tekst voor spraaksynthese, met expressieve voordracht die wordt aangestuurd via inline-tags ([laugh], [pause], [sigh]) of omringende tags (<whisper>text</whisper>, <slow>text</slow>). De invoer mag niet meer dan 15.000 tekens bevatten.
voiceoptioneel
Typeenum
Standaardeve
carinazaganhelixorionlunairisaltairzenithperseusheliosluxkeplerrigelcosmocelesteursa
+12 meersiriuslumencastornakshatlasauroralioraaraeveleorexsal
Ingebouwde stem die voor spraaksynthese is geselecteerd.
languageoptioneel
Typeenum
Standaardauto
autoenar-EGar-SAar-AEbnzhfrdehiiditjakopt-BRpt-PT
+5 meerrues-MXes-EStrvi
Taalkeuze uit deze BCP-47-codes: en, zh, fr, de, hi, id, it, ja, ko, pt-BR, pt-PT, ru, es-MX, es-ES, tr, vi, bn, ar-EG, ar-SA, ar-AE. Geef 'auto' op voor automatische detectie.
output_formatoptioneel
Typeobject
Configuratie voor de gegenereerde audio-indeling; standaard is MP3 met een samplefrequentie van 24 kHz en een bitrate van 128 kbps.
output_format.codecoptioneel
Typeenum
Standaardmp3
mp3wavpcmmulawalaw
Codec voor audiocodering; beschikbare keuzes zijn mp3, wav, pcm, mulaw, alaw.
output_format.sample_rateoptioneel
Typeenum
Standaard24000
80001600022050240004410048000
Audio-samplefrequentie, gemeten in Hz.
output_format.bit_rateoptioneel
Typeenum
320006400096000128000192000
Bitrate voor MP3-uitvoer, standaard 128000 en gemeten in bps; niet van toepassing op andere codecs.
enable_safety_checkeroptioneel
Typeboolean
Standaardtrue
Screening kan worden versoepeld door false in te stellen, mits de aanroeper is geautoriseerd.
verplicht

Uitvoer

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "xai/tts/v1",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 1,
    "usd": "0.001",
    "charged": 1,
    "refunded": 0
  },
  "input": {
    "text": "Hello from Doitong. This is a short test sentence."
  },
  "output": {
    "audio": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_name": "0-output.mp3",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "audio",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_size": 1843200,
      "duration": 12,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Jouw bestanden, jouw keuzeElke outputs[].url is een kopie in onze opslag: voor altijd bewaard (betaald per GB-maand) of 7 dagen gratis, volgens je accountinstelling of ?storage=.
Dezelfde structuur voor elk modeltype, url, content_type, width, height en duration, voor afbeeldingen, video en audio. output is het eigen resultaatobject van het model.
Velden van de uitvoer
audio
object {url, content_type, file_name, file_size}Audiobestand dat door de generatie is geproduceerd.

Voor AI-agents: deze pagina als Markdown staat op https://doitong.com/nl/developers/models/xai/tts/v1.md. Alle modellen en handleidingen: https://doitong.com/developers/llms.txt