Scribe V3 语音识别
curl --request POST \
--url https://api.aihubmax.com/e/v1/audios/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "scribe-v3",
"audio_url": "https://samplelib.com/lib/preview/mp3/sample-3s.mp3",
"diarize": true,
"secondary_language_codes": [
"en"
],
"numbers_format": "digits",
"keyterms": [
"Gateway"
]
}
'import requests
url = "https://api.aihubmax.com/e/v1/audios/generations"
payload = {
"model": "scribe-v3",
"audio_url": "https://samplelib.com/lib/preview/mp3/sample-3s.mp3",
"diarize": True,
"secondary_language_codes": ["en"],
"numbers_format": "digits",
"keyterms": ["Gateway"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'scribe-v3',
audio_url: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
diarize: true,
secondary_language_codes: ['en'],
numbers_format: 'digits',
keyterms: ['Gateway']
})
};
fetch('https://api.aihubmax.com/e/v1/audios/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aihubmax.com/e/v1/audios/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'scribe-v3',
'audio_url' => 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
'diarize' => true,
'secondary_language_codes' => [
'en'
],
'numbers_format' => 'digits',
'keyterms' => [
'Gateway'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/e/v1/audios/generations"
payload := strings.NewReader("{\n \"model\": \"scribe-v3\",\n \"audio_url\": \"https://samplelib.com/lib/preview/mp3/sample-3s.mp3\",\n \"diarize\": true,\n \"secondary_language_codes\": [\n \"en\"\n ],\n \"numbers_format\": \"digits\",\n \"keyterms\": [\n \"Gateway\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aihubmax.com/e/v1/audios/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"scribe-v3\",\n \"audio_url\": \"https://samplelib.com/lib/preview/mp3/sample-3s.mp3\",\n \"diarize\": true,\n \"secondary_language_codes\": [\n \"en\"\n ],\n \"numbers_format\": \"digits\",\n \"keyterms\": [\n \"Gateway\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/e/v1/audios/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"scribe-v3\",\n \"audio_url\": \"https://samplelib.com/lib/preview/mp3/sample-3s.mp3\",\n \"diarize\": true,\n \"secondary_language_codes\": [\n \"en\"\n ],\n \"numbers_format\": \"digits\",\n \"keyterms\": [\n \"Gateway\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "audio.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "audio"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}语音识别
Scribe V3 语音识别
- Scribe V3 语音识别,保留说话人、词或字符时间戳
- 支持辅助语言和数字格式控制
- 异步处理模式,使用返回的任务ID 进行查询
- 识别结果会在任务详情的
results字段中返回
POST
/
v1
/
audios
/
generations
Scribe V3 语音识别
curl --request POST \
--url https://api.aihubmax.com/e/v1/audios/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "scribe-v3",
"audio_url": "https://samplelib.com/lib/preview/mp3/sample-3s.mp3",
"diarize": true,
"secondary_language_codes": [
"en"
],
"numbers_format": "digits",
"keyterms": [
"Gateway"
]
}
'import requests
url = "https://api.aihubmax.com/e/v1/audios/generations"
payload = {
"model": "scribe-v3",
"audio_url": "https://samplelib.com/lib/preview/mp3/sample-3s.mp3",
"diarize": True,
"secondary_language_codes": ["en"],
"numbers_format": "digits",
"keyterms": ["Gateway"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'scribe-v3',
audio_url: 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
diarize: true,
secondary_language_codes: ['en'],
numbers_format: 'digits',
keyterms: ['Gateway']
})
};
fetch('https://api.aihubmax.com/e/v1/audios/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aihubmax.com/e/v1/audios/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'scribe-v3',
'audio_url' => 'https://samplelib.com/lib/preview/mp3/sample-3s.mp3',
'diarize' => true,
'secondary_language_codes' => [
'en'
],
'numbers_format' => 'digits',
'keyterms' => [
'Gateway'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aihubmax.com/e/v1/audios/generations"
payload := strings.NewReader("{\n \"model\": \"scribe-v3\",\n \"audio_url\": \"https://samplelib.com/lib/preview/mp3/sample-3s.mp3\",\n \"diarize\": true,\n \"secondary_language_codes\": [\n \"en\"\n ],\n \"numbers_format\": \"digits\",\n \"keyterms\": [\n \"Gateway\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aihubmax.com/e/v1/audios/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"scribe-v3\",\n \"audio_url\": \"https://samplelib.com/lib/preview/mp3/sample-3s.mp3\",\n \"diarize\": true,\n \"secondary_language_codes\": [\n \"en\"\n ],\n \"numbers_format\": \"digits\",\n \"keyterms\": [\n \"Gateway\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aihubmax.com/e/v1/audios/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"scribe-v3\",\n \"audio_url\": \"https://samplelib.com/lib/preview/mp3/sample-3s.mp3\",\n \"diarize\": true,\n \"secondary_language_codes\": [\n \"en\"\n ],\n \"numbers_format\": \"digits\",\n \"keyterms\": [\n \"Gateway\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "audio.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "audio"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}使用 JSON 提交
audio_url,或用 multipart/form-data 提交 model 和 file;两种音频输入必须且只能提供一个。表单的 keyterms 和 secondary_language_codes 可使用重复字段或 JSON 数组字符串。JSON 输入中的音频地址必须可下载。
diarize 和 tag_audio_events 默认 true。可选控制包括 num_speakers(1–32)、diarization_threshold(0.1–0.4)、timestamps_granularity(none / word / character)、no_verbatim、temperature 和 seed。指定人数或阈值要求开启 diarize;人数和阈值不能同时指定。省略或 null 表示不要求该项可选控制,false 与 0 仍是显式值;不支持的参数组合会在生成前返回错误。V3 额外支持 secondary_language_codes 和 numbers_format(digits / words),不自动降级为 V2。
keyterms 最多 100 项、每项最多 50 字符。每项最多 5 个单词,不能包含括号 []、{}、<> 或反斜杠。非空列表使用增强转写价格。
按已转写时长向上取整到秒:基准 $0.000136 / 秒**;非空 keyterms 为 **$0.000176 / 秒(分别为 68 / 88 quota,倍率 1)。账户分组倍率另行应用。最终按响应的 audio_duration_secs 结算。提交预扣与最终数量有差异时多退少补。
提交后查询任务。results[0] 返回 text、language_code、language_probability、words,并保留实际返回的 audio_duration_secs。words 中的 text、start、end、type 及可选 speaker_id、characters、logprob 按原结构保留;起止时间为秒。请允许字段缺省、null 及扩展,不把空格或音频事件条目丢弃。授权
请求体
application/jsonmultipart/form-data
响应
任务创建成功