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

# 翻译音频

> 请求格式、响应与能力边界。

`POST /v1/audio/translations`

发送 multipart，包含支持翻译的 `model` 和 `file`。OpenAI 兼容语义为将录音翻译成英语；不是通过 `language` 指定任意目标语言。

默认按 JSON 的 `text` 读取。字幕及详细格式需模型支持；不要将转写模型自动视为翻译模型。

[完整接入指南与可执行示例](/zh/guides/speech-to-text)

[Read in English](/en/api-reference/audio-translations)


## OpenAPI

````yaml openapi/relay.json POST /v1/audio/translations
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/translations:
    post:
      summary: 翻译音频 / Translate audio
      description: >-
        常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on
        the model, channel, and deployment.
      operationId: POSTAudioTranslations
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TranslationRequest'
      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:
    TranslationRequest:
      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
      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.