Audio
語音轉文字
以 multipart/form-data 提交 model、file。檔案須為完整單聲道 PCM WAV,最多 25,000,000 位元組,並符合通道的取樣率與時長限制。選填 language(兩個小寫字母,如 zh)及 response_format=json(唯一格式,也是預設值)。讓 curl 產生 boundary。不支援 URL、檔案 ID、prompt、時間戳或 stream。
依通道計費:STT 使用 input_audio_second 或 token;TTS 使用 input_character。speech_billing_unit 的 utf16_code_unit 和 unicode_code_point 對 emoji 計數不同。預占不是費用上限,結算可能非同步;缺少證據不代表免費。兩個介面都接受 X-Felo-Channel,只向選定通道派發一次。逾時或斷線後不要自動重試,也應停用 SDK 重試;保留 X-Request-Id 及可用的 X-Generation-Id 供核對。Console Playground 尚未支援語音呼叫。 configured_rates 依凍結費率及可信用量結算;upstream_cost 依可信上游成本與發布的加價、折扣結算。
- 類型: stringX
- Felo - Channel Ordered comma-separated public channel codes. Omit this header to use default; default must be used alone. In wallet mode, default scans the model's effective public channel order in reverse, skips unpublished or unavailable channels, and uses the first eligible channel. Explicit codes follow the supplied order. For stateless Chat Completions, Messages and Responses, the server may try another selected channel or provider group after a confirmed upstream rejection. A single explicit channel limits routing to that channel. Legacy provider headers cannot override channel routing.
- 類型: object200
同步 JSON 回應包含
text;usage選填,可回報秒數或 token。usage.cost是上游成本,並非最終 Felo 扣款。不需輪詢任務。- 類型: stringtext必填
- 類型: object | nullusage
- cost類型: number最小值:0
Reported upstream cost in USD.
- input類型: object
_token _details - audio類型: integer
_tokens 最小值:0Integer numbers.
- text類型: integer
_tokens 最小值:0Integer numbers.
- input類型: integer
_tokens 最小值:0Integer numbers.
- output類型: integer
_tokens 最小值:0Integer numbers.
- seconds類型: number最小值:0
Duration reported by the selected channel.
- total類型: integer
_tokens 最小值:0Integer numbers.
- type類型: string 列舉值
- duration
- tokens
application/json - 類型: object400
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json - 類型: object402
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json - 類型: object413
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json - 類型: object415
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json - 類型: object429
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json - 類型: object500
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json - 類型: object502
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json - 類型: object503
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json - 類型: object504
Upload, wallet or upstream error
- 類型: objecterror必填
- code類型: string | null
- message類型: string
- param類型: string | null
- type類型: string
application/json
curl https://openapi.felo.ai/api/v1/audio/transcriptions \
--request POST \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--form 'model=grok-stt-2.0' \
--form 'file=@filename' \
--form 'language=' \
--form 'response_format=json'
{
"text": "string",
"usage": {
"seconds": 0,
"type": "duration",
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0,
"input_token_details": {
"text_tokens": 0,
"audio_tokens": 0
},
"cost": 0
}
}