Felo API PlatformFelo API Platform
v0.4.0
OpenAPI 3.1.0

語音轉文字

伺服器:https://openapi.felo.ai
用戶端程式庫

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 依可信上游成本與發布的加價、折扣結算。

請求標頭
  • X-Felo-Channel
    類型: string

    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.

請求本文
必填
application/json
回應
  • 200
    類型: object

    同步 JSON 回應包含 text;usage 選填,可回報秒數或 token。usage.cost 是上游成本,並非最終 Felo 扣款。不需輪詢任務。

    • text
      類型: string
      必填
    • usage
      類型: object | null
      • cost
        類型: number
        最小值:  
        0

        Reported upstream cost in USD.

      • input_token_details
        類型: object
        • audio_tokens
          類型: integer
          最小值:  
          0

          Integer numbers.

        • text_tokens
          類型: integer
          最小值:  
          0

          Integer numbers.

      • input_tokens
        類型: integer
        最小值:  
        0

        Integer numbers.

      • output_tokens
        類型: integer
        最小值:  
        0

        Integer numbers.

      • seconds
        類型: number
        最小值:  
        0

        Duration reported by the selected channel.

      • total_tokens
        類型: integer
        最小值:  
        0

        Integer numbers.

      • type
        類型: string 列舉
        值
        • duration
        • tokens
    application/json
  • 400
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
  • 402
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
  • 413
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
  • 415
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
  • 429
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
  • 500
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
  • 502
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
  • 503
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
  • 504
    類型: object

    Upload, wallet or upstream error

    • error
      類型: object
      必填
      • code
        類型: string | null
      • message
        類型: string
      • param
        類型: string | null
      • type
        類型: string
    application/json
Request Example for post/api/v1/audio/transcriptions
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
  }
}
Transcribe a WAV recording

需要協助嗎?