Neidio i'r cynnwys

xAI Text to Speech

Integreiddio

ID y model 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"

Y cais hwn: $0.001 1 credyd API Ei redeg ar y dudalen hon

Cael allwedd API

Testun-i-leferydd gyda lleisiau mewnol, dewis iaith a thagiau lleferydd mynegiannol mewnol

xAI · Sain

Mae eich canlyniad cyntaf yn mynd yma

Adeiladwch gais isod a'i redeg gyda'ch allwedd API. Mae allbynnau'n cael eu copïo i'n storio, wedi'u cadw am byth neu am 7 diwrnod am ddim.

Adeiladu cais

Cynhyrchir rheolyddion o sgema'r model. Mae'r cod a'r pris yn diweddaru wrth i chi eu newid.

•gofynnol 50 / 15000

Testun synthesis lleferydd, gyda chyflwyniad mynegiannol wedi'i reoli drwy dagiau mewnlin ([laugh], [pause], [sigh]) neu dagiau amgáu (<whisper>text</whisper>, <slow>text</slow>). Ni all y mewnbwn fod yn fwy na 15,000 o nodau.

Uwch voice · language · enable_safety_checker · output_format
rhagosodedig eve

Llais adeiledig a ddewiswyd ar gyfer synthesis lleferydd.

rhagosodedig auto

Dewis iaith o'r codau BCP-47 hyn: 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. Ar gyfer canfod awtomatig yn lle hynny, cyflenwch 'auto'.

Cyfluniad ar gyfer fformat y sain a gynhyrchir; rhagosodedig yw MP3 gyda chyfradd samplu o 24 kHz a chyfradd didau o 128 kbps.

POST /run/xai/tts/v1?wait=20 dyfynbris → $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"

Rhedeg y cais hwn

Mae'ch allwedd yn aros yn y porwr hwn: caiff ei hanfon at Doitong API yn unig a'i chadw (localStorage) dim ond os ticiwch Cofio. Cael allwedd API

Ynglŷn â xAI Text to Speech

Trosi hyd at 15,000 o nodau o destun yn lleferydd. Dewiswch o 28 llais mewnol a chod iaith neu ganfod awtomatig. Gall y testun gynnwys tagiau fel [laugh], [pause] a [sigh], neu dagiau amgylchynol fel <whisper> a <slow>, ar gyfer cyflwyno mynegiannol. Mae `output_format` yn ffurfweddu'r ffeil sain.

Paramedrau

EnwMath RhagosodedigCaniateir Disgrifiad
textgofynnol
Mathstring
≤ 15,000 nod
Testun synthesis lleferydd, gyda chyflwyniad mynegiannol wedi'i reoli drwy dagiau mewnlin ([laugh], [pause], [sigh]) neu dagiau amgáu (<whisper>text</whisper>, <slow>text</slow>). Ni all y mewnbwn fod yn fwy na 15,000 o nodau.
voicedewisol
Mathenum
Rhagosodedigeve
carinazaganhelixorionlunairisaltairzenithperseusheliosluxkeplerrigelcosmocelesteursa
+12 yn rhagorsiriuslumencastornakshatlasauroralioraaraeveleorexsal
Llais adeiledig a ddewiswyd ar gyfer synthesis lleferydd.
languagedewisol
Mathenum
Rhagosodedigauto
autoenar-EGar-SAar-AEbnzhfrdehiiditjakopt-BRpt-PT
+5 yn rhagorrues-MXes-EStrvi
Dewis iaith o'r codau BCP-47 hyn: 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. Ar gyfer canfod awtomatig yn lle hynny, cyflenwch 'auto'.
output_formatdewisol
Mathobject
Cyfluniad ar gyfer fformat y sain a gynhyrchir; rhagosodedig yw MP3 gyda chyfradd samplu o 24 kHz a chyfradd didau o 128 kbps.
output_format.codecdewisol
Mathenum
Rhagosodedigmp3
mp3wavpcmmulawalaw
Codec ar gyfer amgodio sain; yr opsiynau sydd ar gael yw mp3, wav, pcm, mulaw, alaw.
output_format.sample_ratedewisol
Mathenum
Rhagosodedig24000
80001600022050240004410048000
Amledd samplu sain, wedi'i fesur mewn Hz.
output_format.bit_ratedewisol
Mathenum
320006400096000128000192000
Cyfradd didau ar gyfer allbwn MP3, gyda rhagosodiad o 128000 ac wedi'i mesur mewn bps; nid yw'n berthnasol i godecs eraill.
enable_safety_checkerdewisol
Mathboolean
Rhagosodedigtrue
Gellir llacio'r sgrinio drwy osod false, ar yr amod bod y galwr wedi'i awdurdodi.
gofynnol

Allbwn

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"
  }
}
Eich ffeiliau, eich dewisMae pob outputs[].url yn gopi ar ein storio: wedi'i gadw am byth (telir fesul GB-mis) neu am 7 diwrnod am ddim, yn ôl gosodiad eich cyfrif neu ?storage=.
Yr un siâp ar bob modeltype, url, content_type, width, height a duration, ar gyfer delweddau, fideo a sain fel ei gilydd. Gwrthrych canlyniad y model ei hun yw output.
Meysydd yr allbwn
audio
object {url, content_type, file_name, file_size}Ffeil sain a gynhyrchir.

Ar gyfer asiantau AI: mae'r dudalen hon fel Markdown ar gael yn https://doitong.com/cy/developers/models/xai/tts/v1.md. Pob model a chanllaw: https://doitong.com/developers/llms.txt