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

# Transcriptions

> Transcribe audio into text with whisper-tiny.

## Limits

| Limit          | Value                                                |
| -------------- | ---------------------------------------------------- |
| File size      | 25 MB                                                |
| Audio duration | 10 minutes                                           |
| Formats        | flac, m4a, mp3, mp4, mpeg, mpga, oga, ogg, wav, webm |

To translate speech into English, send the same form to `POST /v1/audio/translations`, without `language`.

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://api.zerogpu.ai/v1/audio/transcriptions' \
    --header 'x-api-key: YOUR_API_KEY' \
    --form 'model="whisper-tiny"' \
    --form 'file=@"/path/to/audio.mp3"'
  ```

  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.zerogpu.ai/v1",
      api_key="YOUR_API_KEY",  # sent as Authorization: Bearer
  )

  with open("/path/to/audio.mp3", "rb") as audio:
      transcript = client.audio.transcriptions.create(
          model="whisper-tiny",
          file=audio,
      )

  print(transcript.text)
  ```

  ```javascript JavaScript theme={null}
  import fs from "node:fs";
  import OpenAI from "openai";

  const client = new OpenAI({
    baseURL: "https://api.zerogpu.ai/v1",
    apiKey: "YOUR_API_KEY", // sent as Authorization: Bearer
  });

  const transcript = await client.audio.transcriptions.create({
    model: "whisper-tiny",
    file: fs.createReadStream("/path/to/audio.mp3"),
  });

  console.log(transcript.text);
  ```
</RequestExample>

<ResponseExample>
  ```json json theme={null}
  {
    "text": "the quick brown fox jumps over the lazy dog."
  }
  ```

  ```json verbose_json theme={null}
  {
    "task": "transcribe",
    "language": "english",
    "duration": 1.76,
    "text": "Hello from Zero GPU.",
    "segments": [
      {
        "id": 0,
        "seek": 0,
        "start": 0.0,
        "end": 2.0,
        "text": " Hello from Zero GPU.",
        "tokens": [50364, 2425, 490, 17182, 18407, 13, 50464],
        "temperature": 0.0,
        "avg_logprob": -0.797803,
        "compression_ratio": 0.724138,
        "no_speech_prob": 0.023181
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml api-reference/openapi/zerogpu.openapi.json POST /audio/transcriptions
openapi: 3.1.0
info:
  title: ZeroGPU API
  version: '1.0'
  description: >-
    REST API for ZeroGPU model inference: `POST /v1/responses` and `POST
    /v1/chat/completions` (model-dependent).

    Authentication uses the `x-api-key` header on every request. The
    `x-project-id` header is optional.

    Documentation: https://docs.zerogpu.ai


    **Per-model playgrounds** are listed on [Model
    playgrounds](/api-reference/models) with request examples for each model's
    use cases.

    These endpoint pages show a generic shape only.
servers:
  - url: https://api.zerogpu.ai/v1
    description: Production
security:
  - ApiKey: []
paths:
  /audio/transcriptions:
    post:
      tags:
        - Audio
      summary: Create transcription
      operationId: createTranscription
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateTranscriptionRequest'
            example:
              model: whisper-tiny
      responses:
        '200':
          description: The transcript, in the requested `response_format`.
          headers:
            x-audio-duration-seconds:
              description: >-
                Audio length in seconds: the uploaded audio for a transcription,
                the generated audio for speech.
              schema:
                type: number
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TranscriptionResponse'
              examples:
                json:
                  summary: json (default)
                  value:
                    text: the quick brown fox jumps over the lazy dog.
                verbose_json:
                  summary: verbose_json
                  value:
                    task: transcribe
                    language: english
                    duration: 1.76
                    text: Hello from Zero GPU.
                    segments:
                      - id: 0
                        seek: 0
                        start: 0
                        end: 2
                        text: ' Hello from Zero GPU.'
                        tokens:
                          - 50364
                          - 2425
                          - 490
                          - 17182
                          - 18407
                          - 13
                          - 50464
                        temperature: 0
                        avg_logprob: -0.797803
                        compression_ratio: 0.724138
                        no_speech_prob: 0.023181
            text/plain:
              schema:
                type: string
              example: |
                the quick brown fox jumps over the lazy dog.
        '400':
          description: >-
            Bad request (invalid or missing field, or a body that is not the
            expected content type)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: '''file'' is required'
                  type: invalid_request_error
                  param: file
                  code: file_required
        '401':
          description: Unauthorized (missing API key). Plain-text body.
        '402':
          description: Insufficient quota (insufficient_quota)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: >-
                    You exceeded your current quota, please check your plan and
                    billing details.
                  type: insufficient_quota
                  param: null
                  code: insufficient_quota
        '403':
          description: Forbidden (invalid API key). Plain-text body.
        '404':
          description: Unknown model (model_not_found)
        '413':
          description: >-
            File over 25 MB (file_too_large) or audio over 10 minutes
            (audio_too_long)
        '429':
          description: Rate limit reached. Wait at least `Retry-After` seconds, then retry.
        '500':
          description: Internal server error
        '503':
          description: >-
            Model warming up (model_unavailable) or every slot busy
            (server_busy). Retry with backoff.
      security:
        - ApiKey: []
        - BearerAuth: []
components:
  schemas:
    CreateTranscriptionRequest:
      type: object
      required:
        - file
      properties:
        file:
          type: string
          format: binary
          description: The audio file to transcribe.
        model:
          type: string
          enum:
            - whisper-tiny
          default: whisper-tiny
          example: whisper-tiny
          description: Model identifier. The endpoint serves `whisper-tiny`.
        language:
          type: string
          example: en
          description: ISO-639-1 code, such as `en`. Detected automatically when omitted.
        prompt:
          type: string
          maxLength: 4096
          description: Text to guide spelling and style, such as names or jargon.
        response_format:
          type: string
          enum:
            - json
            - text
            - srt
            - verbose_json
            - vtt
          default: json
          description: >-
            `json` and `verbose_json` return `application/json`; `text`, `srt`,
            and `vtt` return `text/plain`.
        temperature:
          type: number
          minimum: 0
          maximum: 1
          default: 0
          description: Sampling temperature.
        timestamp_granularities[]:
          type: array
          items:
            type: string
            enum:
              - segment
              - word
          description: '`segment` (default), `word`, or both. Requires `verbose_json`.'
    TranscriptionResponse:
      type: object
      description: >-
        `json` returns `{ text }`. `verbose_json` adds `task`, `language`,
        `duration`, and `segments` and/or `words`.
      required:
        - text
      properties:
        text:
          type: string
          description: The transcript.
      additionalProperties: true
    ErrorResponse:
      type: object
      description: Error payload returned on a failed request.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code, for example `insufficient_quota`.
              example: insufficient_quota
            message:
              type: string
              description: Human-readable description of the error.
              example: You have insufficient quota to complete this request.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your ZeroGPU API key. Create one in the dashboard under API keys. Send
        it on every request.
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        OpenAI-compatible: send your ZeroGPU API key as `Authorization: Bearer
        <key>`.

````