# Create a transcription

Send a recording in OpenAI’s audio transcriptions shape and get its transcript. An OpenAI SDK’s audio.transcriptions.create works unchanged with its base URL set to the /v1 address.

`POST https://api.momor.ai/v1/audio/transcriptions`

A call routes exactly as one sent to [POST /models/transcribe](/docs/gateway/reference/transcribe/) does, among transcription models only.

## Headers

- `Authorization` (string, required): Bearer and your API key. A signed-in Momor session works too.
- `Content-Type` (string, required): multipart/form-data. Anything else is refused with 415.

## Form fields

- `file` (file, required): The recording, one audio file. A part sent as application/octet-stream is read by its file name, so standup.mp3 is audio/mpeg.
- `model` (string, required): A model name, auto, or a selector, as model is on Chat Completions. One value, not a list.
- `prompt` (string): Words the recording uses, passed on to the model.
- `temperature` (number): Passed on to the model.
- `response_format` (string, default `json`): json answers { "text": … }; text answers the transcript as plain text. Any other format is a 400. Values: `json`, `text`.

## Response

- `text` (string): The transcript. With response_format text, the whole body is the transcript as text/plain.

The answer carries the call’s id in `X-Momor-Request-Id`; read the call back with [Get a generation](/docs/gateway/reference/generation/).

## Errors

Errors are OpenAI’s error object, as on [Create a chat completion](/docs/gateway/reference/chat-completions/#errors).

| Status | Code | What happened |
| --- | --- | --- |
| `400` | `invalid_value` | No file or no model, a response_format other than json or text, a temperature that is not a number, or a file that is not one audio recording. |
| `401` | `invalid_api_key` | The key is missing, revoked, expired or not a Momor key. |
| `404` | `model_not_found` | No transcription model answers to the model you named. |
| `413` | `request_too_large` | The body is larger than 30 MiB. |
| `415` | `unsupported_media_type` | The body is not multipart/form-data. |
| `429` | `rate_limit_exceeded` | Too many requests; wait for Retry-After. |
| `503` | `providers_unavailable` | Every candidate failed or was unavailable. |

```bash title="Request"
curl https://api.momor.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer $MOMOR_API_KEY" \
  -F file=@standup.mp3 \
  -F model=whisper-large-v3
```

```python
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.momor.ai/v1", api_key=os.environ["MOMOR_API_KEY"])

with open("standup.mp3", "rb") as recording:
    print(client.audio.transcriptions.create(model="whisper-large-v3", file=recording).text)
```

```typescript
import fs from "node:fs";
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.momor.ai/v1", apiKey: process.env.MOMOR_API_KEY });

const transcript = await client.audio.transcriptions.create({
  model: "whisper-large-v3",
  file: fs.createReadStream("standup.mp3"),
});
console.log(transcript.text);
```

```csharp
using System.ClientModel;
using OpenAI;
using OpenAI.Audio;

var client = new AudioClient(
    model: "whisper-large-v3",
    credential: new ApiKeyCredential(Environment.GetEnvironmentVariable("MOMOR_API_KEY")!),
    options: new OpenAIClientOptions { Endpoint = new Uri("https://api.momor.ai/v1") });

AudioTranscription transcript = await client.TranscribeAudioAsync("standup.mp3");
Console.WriteLine(transcript.Text);
```

```json title="Response"
{ "text": "Morning, everyone. The checkout fix shipped last night." }
```

```json
{
  "error": {
    "message": "'response_format' is json or text.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_value"
  }
}
```
