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

# Speech Translation

> Upload audio and receive translated English text.

Use `POST /v1/audio/translations` when you want uploaded speech converted into English text.

This endpoint is similar to transcription, but the returned `text` is translated English output rather than a same-language transcript.

## Required and optional fields

| Field      | Required | Notes                                         |
| ---------- | -------- | --------------------------------------------- |
| `model`    | Yes      | Translation model                             |
| `file`     | Yes      | Binary audio upload                           |
| `prompt`   | No       | Optional formatting or name-preservation hint |
| `language` | No       | Optional language hint                        |

## Multipart Request Example

<CodeGroup>
  ```python Python theme={null}
  from pathlib import Path
  from openai import OpenAI

  client = OpenAI(
      base_url="https://api.naga.ac/v1",
      api_key="YOUR_API_KEY",
  )

  translation = client.audio.translations.create(
      model="whisper-1",
      file=Path("spanish-interview.mp3"),
      prompt="Preserve product names exactly as spoken.",
  )

  print(translation.text)
  ```

  ```javascript Node.js theme={null}
  import fs from 'fs';
  import OpenAI from 'openai';

  const client = new OpenAI({
    baseURL: 'https://api.naga.ac/v1',
    apiKey: 'YOUR_API_KEY',
  });

  const translation = await client.audio.translations.create({
    model: 'whisper-1',
    file: fs.createReadStream('spanish-interview.mp3'),
    prompt: 'Preserve product names exactly as spoken.',
  });

  console.log(translation.text);
  ```

  ```bash cURL theme={null}
  curl https://api.naga.ac/v1/audio/translations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=whisper-1" \
    -F "file=@spanish-interview.mp3" \
    -F "prompt=Preserve product names exactly as spoken."
  ```
</CodeGroup>

## Response Shape

```json theme={null}
{
  "text": "The speaker says the launch will happen next week."
}
```

## When to use translation vs transcription

* use translation when you want English text output from non-English audio
* use [Speech to Text](/api/audio/speech-to-text) when you want a same-language transcript

## Common mistakes

* expecting the output language to match the source audio
* forgetting multipart form encoding
* using the wrong endpoint when a transcript would be enough

## Reference

* [Create translation](/api-reference/endpoints/audio/translations)
