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

# Распознавание речи

> Превращает речь в текст. Совместимо с `audio.transcriptions` в OpenAI SDK. Нужен голосовой AI-ключ (`sk-voice-…`).



## OpenAPI

````yaml ru/openapi/ru-openai-api-openapi.yaml POST /v1/audio/transcriptions
openapi: 3.1.0
info:
  title: ER:LC Россия — OpenAI-Совместимый API
  version: 1.0.0
  description: >-
    OpenAI-совместимые методы Chat Completions, получения моделей и синтеза речи
    ER:LC Россия. Поддерживаемые параметры приведены в описании каждого метода.
servers:
  - url: https://api.erlcrussia.com
    description: Основной сервер
  - url: https://api.erlcrussia.xyz
    description: Резервный сервер
security: []
paths:
  /v1/audio/transcriptions:
    post:
      tags:
        - Audio
      summary: Распознавание речи
      description: >-
        Превращает речь в текст. Совместимо с `audio.transcriptions` в OpenAI
        SDK. Нужен голосовой AI-ключ (`sk-voice-…`).
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    Аудиофайл в любом распространённом формате (mp3, mp4, m4a,
                    mpeg, mpga, ogg, wav, webm, flac), до 25 МБ и до 120 секунд.
                model:
                  type: string
                  example: whisper-1
                  description: >-
                    Принимается для совместимости, распознавание всегда
                    выполняет модель ER:LC Россия.
                language:
                  type: string
                  example: ru
                  description: Язык речи (ISO-639-1), по умолчанию `ru`.
                response_format:
                  type: string
                  enum:
                    - json
                    - text
                  default: json
                  description: '`json` — объект с текстом, `text` — только текст.'
          audio/*:
            schema:
              type: string
              format: binary
              description: Аудиофайл целиком в теле запроса, тип — любой `audio/*`.
      responses:
        '200':
          description: >-
            Распознанный текст. Сколько кредитов списано, видно в заголовке
            `X-Credits-Charged`.
          headers:
            X-Credits-Charged:
              schema:
                type: number
              description: Списано AI-кредитов.
            x-request-id:
              $ref: '#/components/headers/RequestId'
            openai-processing-ms:
              $ref: '#/components/headers/ProcessingMs'
            x-ratelimit-limit-requests:
              $ref: '#/components/headers/RateLimitRequests'
            x-ratelimit-remaining-requests:
              $ref: '#/components/headers/RateLimitRemainingRequests'
            x-ratelimit-reset-requests:
              $ref: '#/components/headers/RateLimitResetRequests'
          content:
            application/json:
              schema:
                type: object
                properties:
                  text:
                    type: string
                    example: Как расшифровывается РД?
                  usage:
                    type: object
                    properties:
                      type:
                        type: string
                        example: duration
                      seconds:
                        type: number
                        example: 2.4
              example:
                text: Как расшифровывается РД?
                usage:
                  type: duration
                  seconds: 2.4
            text/plain:
              schema:
                type: string
        '400':
          description: Некорректное тело запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid:
                  value:
                    error:
                      message: Unsupported or corrupted audio file
                      type: invalid_request_error
                      param: null
                      code: null
                format:
                  value:
                    error:
                      message: 'Unsupported response_format: use json or text'
                      type: invalid_request_error
                      param: null
                      code: null
        '401':
          description: Ключ не передан или недействителен.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: >-
                    Incorrect API key provided. Check the key or create a new
                    one in the dashboard.
                  type: invalid_request_error
                  param: null
                  code: invalid_api_key
                  erlc_code: '5008'
        '413':
          description: Аудио длиннее 120 секунд.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                duration:
                  value:
                    error:
                      message: Audio exceeds 120 seconds
                      type: invalid_request_error
                      param: null
                      code: null
                size:
                  value:
                    error:
                      message: File exceeds 25 MB
                      type: invalid_request_error
                      param: null
                      code: null
        '415':
          description: Неподдерживаемый формат запроса.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: Expected multipart/form-data or an audio file
                  type: invalid_request_error
                  param: null
                  code: null
        '429':
          description: >-
            Превышен лимит запросов (`type: requests`) или закончились
            AI-кредиты (`type: insufficient_quota`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                rate_limit:
                  value:
                    error:
                      message: Rate limit reached. Please slow down and retry later.
                      type: requests
                      param: null
                      code: rate_limit_exceeded
                      erlc_code: '5016'
                insufficient_quota:
                  value:
                    error:
                      message: >-
                        You exceeded your current quota, please check your plan
                        and billing details.
                      type: insufficient_quota
                      param: null
                      code: insufficient_quota
                      erlc_code: '5038'
        '502':
          description: Сервис распознавания не ответил.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: Bad Gateway
                  type: server_error
                  param: null
                  code: '5049'
        '503':
          description: Сервис временно недоступен.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: Audio transcription unavailable
                  type: server_error
                  param: null
                  code: null
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  headers:
    RequestId:
      description: Идентификатор запроса для поддержки.
      schema:
        type: string
        example: req_8f2c1e9b4a7d4c0e9f1a2b3c4d5e6f70
    ProcessingMs:
      description: Время обработки запроса в миллисекундах.
      schema:
        type: integer
        example: 412
    RateLimitRequests:
      description: Лимит запросов в текущем окне.
      schema:
        type: integer
        example: 120
    RateLimitRemainingRequests:
      description: Сколько запросов осталось в текущем окне.
      schema:
        type: integer
        example: 119
    RateLimitResetRequests:
      description: Через сколько сбросится лимит, например `1s` или `6m0s`.
      schema:
        type: string
        example: 1s
  schemas:
    ErrorResponse:
      type: object
      description: >-
        Ошибка в формате OpenAI. `code` — строковый код OpenAI
        (`invalid_api_key`, `model_not_found`, `insufficient_quota`,
        `rate_limit_exceeded`) или `null`. Числовой код ER:LC Россия — в
        `erlc_code`, см. [коды ошибок](/ru/documentation/error-codes).
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              example: Insufficient AI Credits
            type:
              type: string
              enum:
                - invalid_request_error
                - insufficient_quota
                - requests
                - server_error
              example: insufficient_quota
            param:
              type:
                - string
                - 'null'
              example: null
            code:
              type:
                - string
                - 'null'
              example: insufficient_quota
            erlc_code:
              type: string
              description: ER:LC Russia numeric error code.
              example: '5038'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Передача токена авторизации в заголовке Authorization: Bearer <token>.'
    ApiKeyAuth:
      type: apiKey
      in: header
      name: erlcrussia-api-ai-key
      description: Ключ в заголовке erlcrussia-api-ai-key.

````

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