Felo API PlatformFelo API Platform
v0.4.0
OpenAPI 3.1.0

Chuyển giọng nói thành văn bản

Máy chủ:https://openapi.felo.ai
Thư viện client

Audio

​

Chuyển giọng nói thành văn bản

​

Gửi model và file bằng multipart/form-data: WAV PCM đơn âm hoàn chỉnh, tối đa 25,000,000 byte, tuân thủ giới hạn tần số lấy mẫu và thời lượng của kênh. Tùy chọn: language (hai chữ thường, như vi) và response_format=json (định dạng duy nhất và mặc định). Để curl tạo boundary. Không hỗ trợ URL, ID tệp, prompt, dấu thời gian hay stream.

STT dùng input_audio_second hoặc token; TTS dùng input_character. Trong speech_billing_unit, utf16_code_unit và unicode_code_point đếm emoji khác nhau. Khoản giữ trước không phải trần chi phí; quyết toán có thể bất đồng bộ. Thiếu bằng chứng không có nghĩa miễn phí. Cả hai nhận X-Felo-Channel và gửi một lần đến kênh đã chọn. Tắt tự thử lại cả trong SDK sau timeout hoặc mất kết nối; lưu X-Request-Id và X-Generation-Id nếu có. Console Playground chưa hỗ trợ âm thanh. configured_rates dùng giá đã cố định và lượng dùng xác minh; upstream_cost dùng chi phí nhà cung cấp đã xác minh cùng mức cộng giá và chiết khấu công bố.

Header
  • X-Felo-Channel
    Kiểu: 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.

Phần thân
bắt buộc
application/json
Phản hồi
  • 200
    Kiểu: object

    JSON đồng bộ chứa text; usage tùy chọn báo giây hoặc token. usage.cost là chi phí nhà cung cấp, không phải khoản thu Felo cuối cùng. Không cần thăm dò tác vụ.

    • text
      Kiểu: string
      bắt buộc
    • usage
      Kiểu: object | null
      • cost
        Kiểu: number
        tối thiểu:  
        0

        Reported upstream cost in USD.

      • input_token_details
        Kiểu: object
        • audio_tokens
          Kiểu: integer
          tối thiểu:  
          0

          Integer numbers.

        • text_tokens
          Kiểu: integer
          tối thiểu:  
          0

          Integer numbers.

      • input_tokens
        Kiểu: integer
        tối thiểu:  
        0

        Integer numbers.

      • output_tokens
        Kiểu: integer
        tối thiểu:  
        0

        Integer numbers.

      • seconds
        Kiểu: number
        tối thiểu:  
        0

        Duration reported by the selected channel.

      • total_tokens
        Kiểu: integer
        tối thiểu:  
        0

        Integer numbers.

      • type
        Kiểu: string enum
        giá trị
        • duration
        • tokens
    application/json
  • 400
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: string
    application/json
  • 402
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: string
    application/json
  • 413
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: string
    application/json
  • 415
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: string
    application/json
  • 429
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: string
    application/json
  • 500
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: string
    application/json
  • 502
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: string
    application/json
  • 503
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: string
    application/json
  • 504
    Kiểu: object

    Upload, wallet or upstream error

    • error
      Kiểu: object
      bắt buộc
      • code
        Kiểu: string | null
      • message
        Kiểu: string
      • param
        Kiểu: string | null
      • type
        Kiểu: 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

Cần trợ giúp?