> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 音声をテキストに変換

> 音声ファイルをテキストに変換します。サポートされる形式：`mp3`、`mp4`、`mpeg`、`mpga`、`m4a`、`wav`、`webm`。ファイルサイズの上限は `30 MB` です。



## OpenAPI

````yaml /ja/api-reference/openapi_completion.json post /audio-to-text
openapi: 3.0.1
info:
  title: Completion アプリ API
  description: テキスト生成アプリケーションはセッションなしで動作し、翻訳、記事作成、要約 AI などに最適です。
  version: 1.0.0
servers:
  - url: https://{api_base_url}
    description: テキスト生成アプリ API のベース URL です。セルフホスト環境では、独自の API ベース URL に置き換えてください。
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API ベース URL のホストとパス（`https://` を除く）。
security:
  - ApiKeyAuth: []
tags:
  - name: 完了メッセージ
    description: テキスト生成に関連する操作です。
  - name: ファイル操作
    description: ファイル管理に関連する操作です。
  - name: エンドユーザー
    description: エンドユーザー情報に関連する操作です。
  - name: メッセージフィードバック
    description: ユーザーフィードバックに関連する操作です。
  - name: 音声・テキスト変換
    description: テキスト読み上げと音声認識に関連する操作です。
  - name: アプリケーション設定
    description: アプリケーション設定と情報を取得する操作です。
paths:
  /audio-to-text:
    post:
      tags:
        - 音声・テキスト変換
      summary: 音声をテキストに変換
      description: >-
        音声ファイルをテキストに変換します。サポートされる形式：`mp3`、`mp4`、`mpeg`、`mpga`、`m4a`、`wav`、`webm`。ファイルサイズの上限は
        `30 MB` です。
      operationId: completionAudioToTextJa
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AudioToTextRequest'
      responses:
        '200':
          description: 音声からテキストへの変換に成功しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AudioToTextResponse'
              examples:
                audioToTextSuccess:
                  summary: レスポンス例
                  value:
                    text: >-
                      Hello, I would like to know more about the iPhone 13 Pro
                      Max.
        '400':
          description: |-
            - `app_unavailable` : アプリケーションが利用できないか、設定が正しくありません。
            - `no_audio_uploaded` : 音声ファイルがアップロードされていません。
            - `provider_not_support_speech_to_text` : モデルプロバイダーが音声認識をサポートしていません。
            - `provider_not_initialize` : 有効なモデルプロバイダーの認証情報が見つかりません。
            - `provider_quota_exceeded` : モデルプロバイダーのクォータが使い切られました。
            - `model_currently_not_support` : 現在のモデルはこの操作をサポートしていません。
            - `completion_request_error` : 音声認識リクエストに失敗しました。
          content:
            application/json:
              examples:
                app_unavailable:
                  summary: app_unavailable
                  value:
                    status: 400
                    code: app_unavailable
                    message: App unavailable, please check your app configurations.
                no_audio_uploaded:
                  summary: no_audio_uploaded
                  value:
                    status: 400
                    code: no_audio_uploaded
                    message: Please upload your audio.
                provider_not_support_speech_to_text:
                  summary: provider_not_support_speech_to_text
                  value:
                    status: 400
                    code: provider_not_support_speech_to_text
                    message: Provider not support speech to text.
                provider_not_initialize:
                  summary: provider_not_initialize
                  value:
                    status: 400
                    code: provider_not_initialize
                    message: >-
                      No valid model provider credentials found. Please go to
                      Settings -> Model Provider to complete your provider
                      credentials.
                provider_quota_exceeded:
                  summary: provider_quota_exceeded
                  value:
                    status: 400
                    code: provider_quota_exceeded
                    message: >-
                      Your quota for Dify Hosted OpenAI has been exhausted.
                      Please go to Settings -> Model Provider to complete your
                      own provider credentials.
                model_currently_not_support:
                  summary: model_currently_not_support
                  value:
                    status: 400
                    code: model_currently_not_support
                    message: >-
                      Dify Hosted OpenAI trial currently not support the GPT-4
                      model.
                completion_request_error:
                  summary: completion_request_error
                  value:
                    status: 400
                    code: completion_request_error
                    message: Completion request failed.
        '413':
          description: '`audio_too_large` : 音声ファイルサイズが上限を超えています。'
          content:
            application/json:
              examples:
                audio_too_large:
                  summary: audio_too_large
                  value:
                    status: 413
                    code: audio_too_large
                    message: Audio size exceeded.
        '415':
          description: '`unsupported_audio_type` : 許可されていない音声タイプです。'
          content:
            application/json:
              examples:
                unsupported_audio_type:
                  summary: unsupported_audio_type
                  value:
                    status: 415
                    code: unsupported_audio_type
                    message: Audio type not allowed.
        '500':
          description: '`internal_server_error` : 内部サーバーエラー。'
          content:
            application/json:
              examples:
                internal_server_error:
                  summary: internal_server_error
                  value:
                    status: 500
                    code: internal_server_error
                    message: Internal server error.
components:
  schemas:
    AudioToTextRequest:
      type: object
      description: 音声からテキストへの変換のリクエストボディ。
      required:
        - file
      properties:
        file:
          type: string
          format: binary
          description: >-
            音声ファイルです。対応形式：`mp3`、`mp4`、`mpeg`、`mpga`、`m4a`、`wav`、`webm`。上限：`30
            MB`。
        user:
          type: string
          description: ユーザー識別子。
    AudioToTextResponse:
      type: object
      properties:
        text:
          type: string
          description: 音声認識からの出力テキスト。
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key 認証です。すべての API リクエストにおいて、`Authorization` HTTP ヘッダーに `Bearer `
        プレフィックスを付けた API Key を含めてください。例：`Authorization: Bearer {API_KEY}`。**API
        Key はサーバーサイドに保存し、クライアントサイドで共有・保存しないことを強く推奨します。API Key
        の漏洩は深刻な結果につながる可能性があります。**

````