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

# Transcribe audio

> Request format, responses, and capability boundaries.

`POST /v1/audio/transcriptions`

Send multipart containing `model` and the `file` bytes. Preserve the correct filename extension; a local path string is not a file upload.

`response_format: json` returns `text`; `verbose_json` can include duration/segments. Plain-text or subtitle formats return text directly. `language` describes the input language. Confirm timestamps, diarization, and streaming separately; this reference documents the non-streaming baseline.

[Integration guide and runnable example](/en/guides/speech-to-text)

[简体中文](/zh/api-reference/audio-transcriptions)


## OpenAPI

````yaml openapi/relay.json POST /v1/audio/transcriptions
openapi: 3.0.3
info:
  title: API — Core inference API
  version: 0.5.0
  description: >-
    面向接入的精选规范，不是全部管理或供应商接口。 / Curated integration specification, not the entire
    management or provider API.
  license:
    name: AGPL-3.0-or-later
servers:
  - url: https://gateway.example.com
    description: >-
      Example only; replace with your gateway origin and optional path prefix,
      without /v1.
security:
  - BearerAuth: []
paths:
  /v1/audio/transcriptions:
    post:
      summary: 转写音频 / Transcribe audio
      description: >-
        常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on
        the model, channel, and deployment.
      operationId: POSTAudioTranscriptions
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TranscriptionRequest'
      responses:
        '200':
          description: >-
            由 response_format 决定；示例为 json / Determined by response_format;
            example uses json
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/AudioText'
                  - $ref: '#/components/schemas/VerboseAudioText'
              example:
                text: Hello.
            text/plain:
              schema:
                type: string
            text/vtt:
              schema:
                type: string
            application/x-subrip:
              schema:
                type: string
        '400':
          description: 请求参数错误 / Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: 身份校验失败 / Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: 访问被拒绝 / Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: 接口或资源不存在 / Endpoint or resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 请求被限流或受配额限制 / Rate or quota restriction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: 网关或上游错误 / Gateway or upstream error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: 服务暂不可用 / Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: 其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    TranscriptionRequest:
      type: object
      properties:
        model:
          type: string
          description: >-
            当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting
            this endpoint
          example: YOUR_MODEL_ID
        file:
          type: string
          description: >-
            上传音频文件，保留正确扩展名；不是路径字符串或 URL / Uploaded audio file with correct
            extension, not a path string or URL
          format: binary
        response_format:
          type: string
          description: >-
            示例使用 json；text、srt、vtt、verbose_json 等需模型支持 / Examples use json;
            text, srt, vtt, verbose_json and other formats require model support
        prompt:
          type: string
          description: >-
            可选上下文提示，不是翻译目标语言 / Optional context hint, not the target translation
            language
        temperature:
          type: number
          description: 采样温度，需模型支持 / Sampling temperature when supported
        language:
          type: string
          description: >-
            输入语言提示，例如 zh、en；模型决定格式 / Input-language hint such as zh or en; model
            determines format
        timestamp_granularities[]:
          type: array
          description: >-
            word 或 segment，通常配合 verbose_json；需模型支持 / word or segment, usually
            with verbose_json; requires support
          items:
            type: string
      required:
        - model
        - file
    AudioText:
      type: object
      properties:
        text:
          type: string
          description: >-
            转写或翻译文本，静音可能为空 / Transcribed or translated text; silence may yield
            empty text
      required:
        - text
    VerboseAudioText:
      type: object
      properties:
        text:
          type: string
        language:
          type: string
        duration:
          type: number
          description: 秒 / Seconds
        segments:
          type: array
          items:
            type: object
        words:
          type: array
          items:
            type: object
      required:
        - text
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type: string
              nullable: true
            code:
              nullable: true
              description: 错误标识；类型随上游变化 / Error identifier; type varies by upstream
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 模型调用 API Key，不是控制台登录凭据 / Model API key, not console login credentials

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.