Skip to main content
POST
/
v1
/
stt
语音转文本
curl --request POST \
  --url https://api.voxnexus.ai/v1/stt \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: audio/wav' \
  --data '"<string>"'
{
  "request_id": "req_1234567890",
  "language": "zh-CN",
  "text": "你好,这是一个测试消息。",
  "duration_ms": 2500,
  "created_at": "2024-01-01T12:00:00Z",
  "confidence": 0.95,
  "words": [
    {
      "word": "你好",
      "start_time_ms": 0,
      "end_time_ms": 500,
      "confidence": 0.98
    }
  ],
  "speakers": [
    {
      "speaker_id": "speaker_1",
      "text": "你好,这是一个测试消息。",
      "start_time_ms": 0,
      "end_time_ms": 2500
    }
  ]
}

Authorizations

Authorization
string
header
required

使用 Bearer Token 进行认证,Token 为 API Key

Query Parameters

language
string

语言代码(可选,如果提供可以提高识别性能,不提供时由服务自动检测)

Example:

"zh-CN"

sample_rate
integer
required

采样率(必选,单位: Hz,如 16000、22050、44100、48000)

Required range: x >= 1
Example:

16000

enable_timestamps
boolean
default:false

是否返回时间戳(可选,默认 false)

enable_confidence
boolean
default:false

是否返回置信度(可选,默认 false)

enable_speaker_diarization
boolean
default:false

是否启用说话人识别(可选,默认 false)

Body

The body is of type file.

Response

成功返回识别结果

request_id
string
required

请求ID

Example:

"req_1234567890"

language
string
required

识别的语言代码

Example:

"zh-CN"

text
string
required

识别的文本

Example:

"你好,这是一个测试消息。"

duration_ms
integer
required

音频时长(毫秒)

Example:

2500

created_at
string<date-time>
required

创建时间

Example:

"2024-01-01T12:00:00Z"

confidence
number<float>

整体置信度(0.0-1.0),如果启用了置信度

Example:

0.95

words
object[]

词级别信息(如果启用了时间戳)

speakers
object[]

说话人信息(如果启用了说话人识别)