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

# Transcription

> Transcribes an audio file synchronously (transcription models only), as OpenAI-compatible multipart or as JSON input_audio. Up to 25 MB of mp3, wav, ogg, webm, m4a, mp4, flac or aac audio; audio URLs are not accepted. Billed per second of audio, rounded up to the next 0.000001 EUR. Provider failures preserve an upstream 4xx status, except 401 and 402 which return 503, and use the provider_error code; upstream 5xx failures return 503.



## OpenAPI

````yaml /hub/openapi/hub.json post /api/v1/hub/audio/transcriptions
openapi: 3.0.1
info:
  title: Fanify Hub API
  description: Generate media and text with Fanify credits. All prices use EUR.
  version: v1
servers:
  - url: https://fanifyai.com
security: []
paths:
  /api/v1/hub/audio/transcriptions:
    post:
      tags:
        - Transcriptions
      summary: Transcription
      description: >-
        Transcribes an audio file synchronously (transcription models only), as
        OpenAI-compatible multipart or as JSON input_audio. Up to 25 MB of mp3,
        wav, ogg, webm, m4a, mp4, flac or aac audio; audio URLs are not
        accepted. Billed per second of audio, rounded up to the next 0.000001
        EUR. Provider failures preserve an upstream 4xx status, except 401 and
        402 which return 503, and use the provider_error code; upstream 5xx
        failures return 503.
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Optional idempotency key, from 1 to 255 characters. The same audio
            and fields replay the first response, whether sent as multipart or
            JSON.
          schema:
            type: string
      requestBody:
        description: >-
          multipart/form-data (recommended) or JSON with base64 input_audio.
          Unknown fields are forwarded; stream and audio URLs (source_url,
          input_audio.url) are refused.
        content:
          multipart/form-data:
            schema:
              required:
                - file
                - model
              type: object
              properties:
                file:
                  type: string
                  description: >-
                    Up to 25 MB. Format from the file name extension, else the
                    part media type, else the content.
                  format: binary
                model:
                  type: string
                language:
                  type: string
                  description: ISO-639-1 language of the audio, e.g. fr.
                response_format:
                  enum:
                    - json
                    - verbose_json
                  type: string
                  description: >-
                    json (default) or verbose_json; text, srt and vtt are
                    refused.
                timestamp_granularities:
                  type: array
                  items:
                    enum:
                      - segment
                      - word
                    type: string
                  description: >-
                    With verbose_json. Multipart: repeat
                    timestamp_granularities[] (or timestamp_granularities).
                temperature:
                  type: number
                prompt:
                  type: string
          application/json:
            schema:
              required:
                - input_audio
                - model
              type: object
              properties:
                input_audio:
                  required:
                    - data
                  type: object
                  properties:
                    data:
                      type: string
                      description: 'Raw base64, without a data: prefix.'
                      format: byte
                    format:
                      enum:
                        - mp3
                        - wav
                        - ogg
                        - webm
                        - m4a
                        - mp4
                        - flac
                        - aac
                      type: string
                  additionalProperties: false
                model:
                  type: string
                language:
                  type: string
                  description: ISO-639-1 language of the audio, e.g. fr.
                response_format:
                  enum:
                    - json
                    - verbose_json
                  type: string
                  description: >-
                    json (default) or verbose_json; text, srt and vtt are
                    refused.
                timestamp_granularities:
                  type: array
                  items:
                    enum:
                      - segment
                      - word
                    type: string
                  description: >-
                    With verbose_json. Multipart: repeat
                    timestamp_granularities[] (or timestamp_granularities).
                temperature:
                  type: number
                prompt:
                  type: string
            example:
              model: voxtral-mini-transcribe-3-0
              input_audio:
                data: SUQzBAAAAAAA...
                format: mp3
              language: fr
        required: true
      responses:
        '200':
          description: >-
            OpenAI-compatible transcription: text, plus language, duration and
            segments[] or words[] with verbose_json. usage.seconds is the billed
            audio duration, usage.cost the billed cost in EUR.
          headers:
            X-Fanify-Generation-Id:
              description: Hub generation identifier.
              schema:
                type: string
            X-Fanify-Billed-Cost:
              description: Billed cost in EUR, using invariant decimal notation.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
              example:
                text: Hi, it's Paul. Are you free tonight?
                language: en
                duration: 3.4
                segments:
                  - id: 0
                    start: 0
                    end: 3.4
                    text: Hi, it's Paul. Are you free tonight?
                usage:
                  type: duration
                  seconds: 4
                  cost: 0.000001
        '400':
          description: OpenAI-compatible error.
          content:
            application/json:
              schema:
                required:
                  - error
                type: object
                properties:
                  error:
                    required:
                      - message
                      - code
                      - type
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        enum:
                          - invalid_input
                          - unsupported_audio_format
                          - provider_error
                        type: string
                      type:
                        type: string
                      metadata:
                        required:
                          - provider_name
                        type: object
                        properties:
                          provider_name:
                            enum:
                              - FanifyHub
                            type: string
              example:
                error:
                  message: The request input is invalid.
                  code: invalid_input
                  type: invalid_request_error
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                required:
                  - type
                  - title
                  - status
                  - code
                type: object
                properties:
                  type:
                    type: string
                    format: uri
                  title:
                    type: string
                  status:
                    type: integer
                    format: int32
                  detail:
                    type: string
                    nullable: true
                  instance:
                    type: string
                  code:
                    enum:
                      - unauthorized
                    type: string
                  errors:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
                  unrepresentable:
                    type: array
                    items:
                      type: string
                  missing:
                    type: array
                    items:
                      required:
                        - sha256
                      type: object
                      properties:
                        sha256:
                          type: string
                        kind:
                          type: string
                          nullable: true
              example:
                type: https://fanifyai.com/docs/hub/errors#unauthorized
                title: Unauthorized
                status: 401
                code: unauthorized
        '402':
          description: OpenAI-compatible error.
          content:
            application/json:
              schema:
                required:
                  - error
                type: object
                properties:
                  error:
                    required:
                      - message
                      - code
                      - type
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        enum:
                          - insufficient_credits
                        type: string
                      type:
                        type: string
                      metadata:
                        required:
                          - provider_name
                        type: object
                        properties:
                          provider_name:
                            enum:
                              - FanifyHub
                            type: string
              example:
                error:
                  message: Your available balance does not cover this generation.
                  code: insufficient_credits
                  type: invalid_request_error
        '404':
          description: OpenAI-compatible error.
          content:
            application/json:
              schema:
                required:
                  - error
                type: object
                properties:
                  error:
                    required:
                      - message
                      - code
                      - type
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        enum:
                          - model_not_found
                        type: string
                      type:
                        type: string
                      metadata:
                        required:
                          - provider_name
                        type: object
                        properties:
                          provider_name:
                            enum:
                              - FanifyHub
                            type: string
              example:
                error:
                  message: The requested model was not found.
                  code: model_not_found
                  type: invalid_request_error
        '410':
          description: OpenAI-compatible error.
          content:
            application/json:
              schema:
                required:
                  - error
                type: object
                properties:
                  error:
                    required:
                      - message
                      - code
                      - type
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        enum:
                          - file_expired
                        type: string
                      type:
                        type: string
                      metadata:
                        required:
                          - provider_name
                        type: object
                        properties:
                          provider_name:
                            enum:
                              - FanifyHub
                            type: string
              example:
                error:
                  message: The requested file has expired or is unavailable.
                  code: file_expired
                  type: invalid_request_error
        '413':
          description: OpenAI-compatible error.
          content:
            application/json:
              schema:
                required:
                  - error
                type: object
                properties:
                  error:
                    required:
                      - message
                      - code
                      - type
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        enum:
                          - payload_too_large
                        type: string
                      type:
                        type: string
                      metadata:
                        required:
                          - provider_name
                        type: object
                        properties:
                          provider_name:
                            enum:
                              - FanifyHub
                            type: string
              example:
                error:
                  message: The uploaded file exceeds the allowed size.
                  code: payload_too_large
                  type: invalid_request_error
        '422':
          description: OpenAI-compatible error.
          content:
            application/json:
              schema:
                required:
                  - error
                type: object
                properties:
                  error:
                    required:
                      - message
                      - code
                      - type
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        enum:
                          - idempotency_conflict
                          - no_route_available
                        type: string
                      type:
                        type: string
                      metadata:
                        required:
                          - provider_name
                        type: object
                        properties:
                          provider_name:
                            enum:
                              - FanifyHub
                            type: string
              example:
                error:
                  message: >-
                    This idempotency key was already used with a different
                    request.
                  code: idempotency_conflict
                  type: invalid_request_error
        '429':
          description: OpenAI-compatible error.
          headers:
            Retry-After:
              description: Seconds before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                required:
                  - error
                type: object
                properties:
                  error:
                    required:
                      - message
                      - code
                      - type
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        enum:
                          - rate_limited
                          - capacity_exhausted
                        type: string
                      type:
                        type: string
                      metadata:
                        required:
                          - provider_name
                        type: object
                        properties:
                          provider_name:
                            enum:
                              - FanifyHub
                            type: string
              example:
                error:
                  message: Rate limit reached, retry later.
                  code: rate_limited
                  type: invalid_request_error
        '503':
          description: OpenAI-compatible error.
          headers:
            Retry-After:
              description: Always 5 seconds for an in-progress replay.
              schema:
                type: string
          content:
            application/json:
              schema:
                required:
                  - error
                type: object
                properties:
                  error:
                    required:
                      - message
                      - code
                      - type
                    type: object
                    properties:
                      message:
                        type: string
                      code:
                        enum:
                          - generation_in_progress
                          - provider_error
                          - hub_paused
                        type: string
                      type:
                        type: string
                      metadata:
                        required:
                          - provider_name
                        type: object
                        properties:
                          provider_name:
                            enum:
                              - FanifyHub
                            type: string
              example:
                error:
                  message: A generation with this idempotency key is still in progress.
                  code: generation_in_progress
                  type: invalid_request_error
      security:
        - Bearer: []
components:
  securitySchemes:
    Bearer:
      type: http
      description: Fanify API key.
      scheme: bearer
      bearerFormat: fanify_sk_...

````

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