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

# STT

> Use DeerAPI to call the STT endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the STT workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

## Before you start

Use the DeerAPI base URL and pass your API Key in the `Authorization` header:

```text theme={null}
https://api.deerapi.com
```

```text theme={null}
Authorization: Bearer $DEERAPI_KEY
```

## Model selection

Choose a current model ID from the [live pricing page](https://api.deerapi.com/pricing). Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

## Implementation notes

* Use the OpenAPI playground for the exact request fields accepted by this endpoint.
* Keep API Keys on the server side when you build production applications.
* Log the request ID from failed calls so support can investigate the request.
* Retry `429`, `500`, and `503` responses with exponential backoff.


## OpenAPI

````yaml /api/openapi/audio/openai/post-stt.openapi.json POST /v1/audio/transcriptions
openapi: 3.1.0
info:
  title: Create transcription API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /v1/audio/transcriptions:
    post:
      summary: Create transcription
      operationId: create_transcription
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  format: binary
                  type: string
                  description: >-
                    The audio file to transcribe. Supported formats: flac, mp3,
                    mp4, mpeg, mpga, m4a, ogg, wav, webm.
                model:
                  type: string
                  description: >-
                    The speech-to-text model to use. Choose a current speech
                    model from the [Models
                    page](https://api.deerapi.com/pricing).
                  default: whisper-1
                language:
                  type: string
                  description: >-
                    The language of the input audio in ISO-639-1 format, such as
                    `en`, `es`, or `ja`. Supplying the language improves
                    accuracy and latency.
                prompt:
                  type: string
                  description: >-
                    Optional text to guide the model's style or continue a
                    previous audio segment. The prompt should match the audio
                    language.
                response_format:
                  type: string
                  description: The output format for the transcription.
                  enum:
                    - json
                    - text
                    - srt
                    - verbose_json
                    - vtt
                  default: json
                temperature:
                  type: number
                  description: >-
                    Sampling temperature between 0 and 1. Higher values produce
                    more random output; lower values are more focused. When set
                    to 0, the model auto-adjusts temperature using log
                    probability.
                  minimum: 0
                  maximum: 1
                  default: 0
              required:
                - file
                - model
            example:
              model: whisper-1
              prompt: A cinematic shot of a quiet city street at sunset.
              response_format: json
              file: '@/path/to/audio.mp3'
            examples:
              Default:
                summary: Default request
                value:
                  model: whisper-1
                  prompt: A cinematic shot of a quiet city street at sunset.
                  response_format: json
                  file: '@/path/to/audio.mp3'
      responses:
        '200':
          description: The transcription result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - text
                properties:
                  text:
                    type: string
                    description: The transcribed text.
              examples:
                Default:
                  summary: Transcription result
                  value:
                    text: Hello, welcome to DeerAPI.
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl -s 'https://api.deerapi.com/v1/audio/transcriptions' \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -F 'model=whisper-1' \
              -F 'prompt=A cinematic shot of a quiet city street at sunset.' \
              -F 'response_format=json' \
              -F 'file=@/path/to/audio.mp3'
        - lang: Python
          label: requests
          source: >
            import os

            import requests


            url = "https://api.deerapi.com/v1/audio/transcriptions"

            headers = {"Authorization": "Bearer " + os.environ["DEERAPI_KEY"]}

            data = {
              "model": "whisper-1",
              "prompt": "A cinematic shot of a quiet city street at sunset.",
              "response_format": "json"
            }

            files = {"file": open("/path/to/audio.mp3", "rb")}


            response = requests.post(url, headers=headers, data=data,
            files=files)

            print(response.json())
        - lang: JavaScript
          label: fetch
          source: >
            const form = new FormData();

            form.append("model", "whisper-1");

            form.append("prompt", "A cinematic shot of a quiet city street at
            sunset.");

            form.append("response_format", "json");

            form.append("file", new Blob(["replace with file bytes"]),
            "audio.mp3");


            const response = await
            fetch("https://api.deerapi.com/v1/audio/transcriptions", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.DEERAPI_KEY}` },
              body: form,
            });


            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a DeerAPI API Key as a Bearer token.

````