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

# Speech to text

> POST /v1/audio/transcriptions — Whisper / GPT-4o transcribe

Transcribe an audio file into text.

## Request

```bash theme={null}
curl https://openp.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer $OPENPAI_API_KEY" \
  -F file=@audio.mp3 \
  -F model=whisper-1 \
  -F language=en \
  -F response_format=verbose_json
```

### Parameters

| Field                       | Type   | Required | Description                                                                  |
| --------------------------- | ------ | :------: | ---------------------------------------------------------------------------- |
| `file`                      | file   |     ✅    | Audio file; supports mp3 / mp4 / mpeg / mpga / m4a / wav / webm, max 25MB    |
| `model`                     | string |     ✅    | `whisper-1` / `gpt-4o-transcribe` / `gpt-4o-mini-transcribe`                 |
| `language`                  | string |          | ISO-639-1 language code, e.g. `zh` / `en` / `ja`; leave empty to auto-detect |
| `prompt`                    | string |          | A guiding hint for domain / proper nouns / spelling                          |
| `response_format`           | string |          | `json` (default) / `text` / `srt` / `verbose_json` / `vtt`                   |
| `temperature`               | number |          | 0-1                                                                          |
| `timestamp_granularities[]` | array  |          | `word` / `segment`; requires `verbose_json`                                  |

## Response

`response_format: "json"`:

```json theme={null}
{"text": "Hello, this is a test audio clip."}
```

`response_format: "verbose_json"`:

```json theme={null}
{
  "task": "transcribe",
  "language": "en",
  "duration": 4.2,
  "text": "Hello, this is a test audio clip.",
  "segments": [
    {
      "id": 0,
      "start": 0.0,
      "end": 4.2,
      "text": "Hello, this is a test audio clip."
    }
  ]
}
```

`srt` / `vtt` return subtitle text (save directly as `.srt` / `.vtt`).

## Python

```python theme={null}
from openai import OpenAI
client = OpenAI(api_key="sk-...", base_url="https://openp.ai/v1")

with open("audio.mp3", "rb") as f:
    resp = client.audio.transcriptions.create(
        model="whisper-1",
        file=f,
        response_format="verbose_json",
        timestamp_granularities=["segment"],
    )
print(resp.text)
```

## Long-audio strategy

* Whisper has a 25MB single-file limit; **split** long audio in advance (5-10 minutes per segment recommended).
* Use `prompt` to pass the tail text of the previous segment to keep context coherent.
* A tool like `ffmpeg -i input.mp3 -f segment -segment_time 600 part_%03d.mp3` can split quickly.

## Billing

Charged by **audio duration (seconds)**; the specific multipliers are subject to the console.
