跳至內容

Maya · Batch

整合

模型 id maya/batch
# 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/maya/batch?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "texts": [
      "Hello from Doitong. This is a short test sentence."
    ],
    "prompts": [
      "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"

此請求: ≈$0.049 49 API 點數 在此頁面執行

取得 API 金鑰
Maya Research 文字轉語音 #text-to-speech#tts

Maya 語音的批次版本,一次以相應的聲音描述呈現最多 100 段文字

Maya Research · 音訊

您的第一個結果會顯示在這裡

在下方建立請求,並使用您的 API 金鑰執行。輸出會複製到我們的儲存空間,可永久保留或免費保留 7 天。

建立請求

控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。

•必填

支援在每個項目中嵌入 <emotion_name> 標籤的語音合成文字清單。

•必填

每段文字的聲音或角色屬性,以描述清單提供。描述數量必須等於文字數量。

進階 sample_rate · output_format · temperature · top_p · max_tokens · repetition_penalty · enable_safety_checker
sample_rate 預設 48 kHz

所有生成共用的音訊取樣率設定,可選擇 24 kHz 的較快處理或 48 kHz 的較高品質。

output_format 預設 wav

每段生成語音錄音使用的檔案格式。

預設 0.4

套用於每次生成的取樣溫度。

預設 0.9

套用於每次生成的核取樣設定。

預設 2000

每次生成可使用的 SNAC Token 上限。

預設 1.1

套用於每次生成的重複懲罰值。

POST /run/maya/batch?wait=20 報價 → $0.049
# 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/maya/batch?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "texts": [
      "Hello from Doitong. This is a short test sentence."
    ],
    "prompts": [
      "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"

執行此請求

您的金鑰會保留在此瀏覽器中:只會傳送至 Doitong API,且只有在勾選「記住」時才會儲存至 localStorage。 取得 API 金鑰

關於 Maya · Batch

在單一請求中合成多個音訊片段。`texts` 和 `prompts` 各接受 1 至 100 個項目,長度必須相同,讓每段文字與一個聲音描述配對。每段文字都可使用情緒標籤。取樣率、輸出格式和 temperature 等設定套用至全部項目,結果包含音訊檔案清單及持續時間。

參數

名稱類型 預設值允許值 說明
texts必填
類型string[]
≤ 100 個項目
支援在每個項目中嵌入 <emotion_name> 標籤的語音合成文字清單。
prompts必填
類型string[]
≤ 100 個項目
每段文字的聲音或角色屬性,以描述清單提供。描述數量必須等於文字數量。
temperature選填
類型number
預設值0.4
0 – 2
套用於每次生成的取樣溫度。
top_p選填
類型number
預設值0.9
0 – 1
套用於每次生成的核取樣設定。
max_tokens選填
類型integer
預設值2000
28 – 4,000
每次生成可使用的 SNAC Token 上限。
repetition_penalty選填
類型number
預設值1.1
1 – 2
套用於每次生成的重複懲罰值。
sample_rate選填
類型enum
預設值48 kHz
48 kHz24 kHz
所有生成共用的音訊取樣率設定,可選擇 24 kHz 的較快處理或 48 kHz 的較高品質。
output_format選填
類型enum
預設值wav
wavmp3
每段生成語音錄音使用的檔案格式。
enable_safety_checker選填
類型boolean
預設值true
在呼叫端獲得授權的情況下,將此值設為 false 可放寬審核。
必填

輸出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "maya/batch",
  "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": 49,
    "usd": "0.049",
    "charged": 49,
    "refunded": 0
  },
  "input": {
    "texts": [
      "Hello from Doitong. This is a short test sentence."
    ],
    "prompts": [
      "Hello from Doitong. This is a short test sentence."
    ]
  },
  "output": {
    "audios": [
      {
        "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
      }
    ],
    "durations": [
      5
    ],
    "sample_rate": "48 kHz",
    "total_generation_time": 5.7,
    "average_rtf": 0.15
  },
  "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"
  }
}
您的檔案,由您選擇每個 outputs[].url 都是儲存空間中的副本:可永久保留(按 GB-月計費),或免費保留 7 天;可透過帳戶設定或 ?storage= 設定。
所有模型使用相同結構圖片、影片和音訊皆包含 type、url、content_type、width、height 和 duration。output 是模型自己的結果物件。
輸出欄位
audios
array of object {url, content_type, file_name, file_size}產生的音訊檔案,以清單形式回傳。
durations
array of number每段生成音訊錄音的長度,以秒為單位。
sample_rate
string所有生成音訊檔案共用的取樣率。
total_generation_time
number所有音訊檔案的合計生成時間,以秒為單位。
average_rtf
number所有生成結果的平均即時因子。

更多模型:文字轉語音

給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/maya/batch.md. 所有模型與指南: https://doitong.com/developers/llms.txt