Nemotron 語音轉文字
提交可下載的音訊或影片 URL 進行非同步語音轉寫,支援自動偵測語言、可選逐詞時間戳記與說話者標籤,或語音翻譯。
概覽
使用語音轉文字端點配合受支援的模型。使用返回的任務 ID 來檢索其狀態,或提供 callback_url 以接收以下記錄的推送通知。
快速入門
- 建立 API 金鑰並將其設定為 RUNAPI_API_KEY。
- 選擇支援的模型,並發送主體符合該模型結構的 POST 請求。
- 儲存返回的任務 ID,然後輪詢直至達到終止狀態,或處理下方說明的回呼。
端點
- 基礎 URL
https://runapi.ai- API 版本
v1- 身份驗證
Authorization: Bearer YOUR_API_TOKEN
支援的模型
開啟模型頁面以查看當前定價、速率限制及商業用途詳情。
請求結構
欄位及允許的值取決於所選模型。提供後,callback_url 將接收以下記錄的 Task 交付內容。
nemotron-3.5-transcribe5 個欄位
callback_urlstring用於非同步完成通知的 Webhook URL。
modelstringNemotron 語音轉寫模型代號。
source_audio_urlstring可直接下載的音訊或影片 URL,最長 60 分鐘、最大 200 MB。
target_languagestring翻譯目標語言。省略以進行自動語言偵測轉寫;不可與 timestamps 設為 true 同時使用。支援與英語互譯。
允許值:en, zh, ja, ko, fr, de, es, pt, it, ru, nl, pl, cs, sk, hi, bg, hr, da, et, fi, hu, lv, lt, ro, sl, sv, th, uk, ar, el, he, mt
timestampsboolean在結果 JSON 中包含逐詞時間戳記與說話者標籤。不可與 target_language 同時使用。
允許值:true, false
預設值: false
條件規則
當所有列出的條件均符合時,這些要求方才適用。
-
當
timestamps = true- 必填
- 不接受
target_language
建立接受
POST /api/v1/nemotron/speech_to_text
回應結構
{
"properties": {
"id": {
"type": "string"
},
"status": {
"enum": [
"processing"
],
"type": "string"
},
"task_replayed": {
"type": "boolean"
}
},
"required": [
"id",
"status"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"id": "tsk_reference_demo",
"status": "processing"
}
輪詢處理中
GET /api/v1/nemotron/speech_to_text/:id
回應結構
{
"properties": {
"id": {
"type": "string"
},
"status": {
"enum": [
"processing"
],
"type": "string"
}
},
"required": [
"id",
"status"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"id": "tsk_reference_demo",
"status": "processing"
}
輪詢已完成
GET /api/v1/nemotron/speech_to_text/:id
回應結構
{
"properties": {
"duration": {
"type": "number"
},
"expires_at": {
"type": "string"
},
"id": {
"type": "string"
},
"status": {
"enum": [
"completed"
],
"type": "string"
},
"text": {
"type": "string"
},
"url": {
"type": "string",
"x-runapi-generated-media": true
},
"usage": {
"properties": {
"cost": {
"type": "number"
}
},
"required": [
"cost"
],
"type": "object",
"unevaluatedProperties": false
}
},
"required": [
"id",
"status",
"text",
"duration",
"url",
"expires_at",
"usage"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"duration": 12.64,
"expires_at": "2026-12-04T12:30:23Z",
"id": "tsk_reference_demo",
"status": "completed",
"text": "Welcome to RunAPI.",
"url": "https://tempfile.runapi.ai/reference-transcript.json",
"usage": {
"cost": 0.05
}
}
輪詢失敗
GET /api/v1/nemotron/speech_to_text/:id
回應結構
{
"properties": {
"error": {
"type": "string"
},
"id": {
"type": "string"
},
"status": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "Task processing failed.",
"id": "tsk_reference_demo",
"status": "failed"
}
客戶回呼:已完成
POST callback_url
回應結構
{
"properties": {
"duration": {
"type": "number"
},
"expires_at": {
"type": "string"
},
"id": {
"type": "string"
},
"status": {
"enum": [
"completed"
],
"type": "string"
},
"text": {
"type": "string"
},
"url": {
"type": "string",
"x-runapi-generated-media": true
},
"usage": {
"properties": {
"cost": {
"type": "number"
}
},
"required": [
"cost"
],
"type": "object",
"unevaluatedProperties": false
}
},
"required": [
"id",
"status",
"text",
"duration",
"url",
"expires_at",
"usage"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"duration": 12.64,
"expires_at": "2026-12-04T12:30:23Z",
"id": "tsk_reference_demo",
"status": "completed",
"text": "Welcome to RunAPI.",
"url": "https://tempfile.runapi.ai/reference-transcript.json",
"usage": {
"cost": 0.05
}
}
客戶回呼:已失敗
POST callback_url
回應結構
{
"properties": {
"error": {
"oneOf": [
{
"type": "string"
},
{
"properties": {
"code": {
"type": "string"
},
"limit_cents": {
"type": "integer"
},
"message": {
"type": "string"
},
"reset_at": {
"format": "date-time",
"type": [
"string",
"null"
]
},
"used_cents": {
"type": "integer"
},
"window": {
"enum": [
"1h",
"1d",
"7d",
"daily",
"weekly",
"monthly",
"lifetime"
],
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"unevaluatedProperties": false
}
]
},
"id": {
"type": "string"
},
"status": {
"enum": [
"failed"
],
"type": "string"
}
},
"required": [
"id",
"status",
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": {
"code": "generation_failed",
"message": "Task processing failed."
},
"id": "tsk_reference_demo",
"status": "failed"
}
錯誤
POST /api/v1/nemotron/speech_to_text
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "Authentication required"
}
錯誤
GET /api/v1/nemotron/speech_to_text/:id
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "Authentication required"
}
錯誤
POST /api/v1/nemotron/speech_to_text
回應結構
{
"oneOf": [
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
},
{
"properties": {
"error": {
"description": "人類可讀的驗證摘要。",
"type": "string"
},
"errors": {
"additionalProperties": {
"items": {
"type": "string"
},
"type": "array"
},
"description": "以公開請求欄位為鍵的驗證訊息,每個欄位對應一組人類可讀的字串陣列。",
"type": "object"
}
},
"required": [
"error",
"errors"
],
"type": "object",
"unevaluatedProperties": false
}
]
}
回應範例
{
"error": "model must be one of: nemotron-3.5-transcribe"
}
錯誤
POST /api/v1/nemotron/speech_to_text
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "Insufficient balance"
}
錯誤
POST /api/v1/nemotron/speech_to_text
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "API key credit limit exceeded"
}
錯誤
POST /api/v1/nemotron/speech_to_text
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "The request uses features that are not supported for the selected model"
}
錯誤
POST /api/v1/nemotron/speech_to_text
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "Rate limit reached. Please retry later."
}
錯誤
POST /api/v1/nemotron/speech_to_text
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "Service under maintenance, please try again later"
}
錯誤
POST /api/v1/nemotron/speech_to_text
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "The request timed out"
}
錯誤
GET /api/v1/nemotron/speech_to_text/:id
回應結構
{
"properties": {
"error": {
"description": "人類可讀的錯誤訊息。",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
回應範例
{
"error": "Task with id 'tsk_reference_demo' not found"
}
已生成的程式碼範例
直接使用 cURL,或為您的語言安裝 SDK。每個範例均提交本參考中所示的已驗證請求。
安裝
pip install runapi-nemotron
import os
from runapi.nemotron import NemotronClient
client = NemotronClient(api_key=os.environ["RUNAPI_API_KEY"])
task = client.speech_to_text.create(
model="nemotron-3.5-transcribe",
source_audio_url="https://cdn.runapi.ai/public/samples/voice.mp3",
timestamps=False
)