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

# 音声翻訳

> <ul><li>音声を英語テキストに翻訳します</li></ul>

<RequestExample>
  ```bash cURL theme={null} theme={null}
  curl --request POST \
    --url 'https://api.elkapi.com/v1/audio/translations' \
    --header 'Authorization: Bearer <token>' \
    --form 'file=@audio.mp3' \
    --form 'model=whisper-1' \
    --form 'prompt=日差しのある庭を走る小さな子猫、映画的、高精細' \
    --form 'response_format=json' \
    --form 'temperature=1'
  ```

  ```python Python theme={null} theme={null}
  import requests

  url = "https://api.elkapi.com/v1/audio/translations"
  headers = {
      "Authorization": "Bearer <token>"
  }
  files = {
      "file": open("audio.mp3", "rb"),
  }
  data = {
      "model": "whisper-1",
      "prompt": "日差しのある庭を走る小さな子猫、映画的、高精細",
      "response_format": "json",
      "temperature": "1",
  }

  response = requests.request("POST", url, headers=headers, data=data, files=files)
  print(response.text)
  ```

  ```javascript JavaScript theme={null} theme={null}
  const url = "https://api.elkapi.com/v1/audio/translations";

  const headers = {
    "Authorization": "Bearer <token>"
  };
  const form = new FormData();
  form.append("file", fileInput.files[0]);
  form.append("model", "whisper-1");
  form.append("prompt", "日差しのある庭を走る小さな子猫、映画的、高精細");
  form.append("response_format", "json");
  form.append("temperature", "1");

  const response = await fetch(url, {
    method: "POST",
    headers,
    body: form
  });

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

<ResponseExample>
  ```json 200 theme={null} theme={null}
  {
    "text": "こんにちは、自己紹介してください"
  }
  ```
</ResponseExample>

## Authorizations

<ParamField header="Authorization" type="string" required>
  すべてのエンドポイントで Bearer Token 認証が必要です。

  リクエストヘッダーに追加します:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Body

<ParamField body="file" type="file" required />

<ParamField body="model" type="string" required default="whisper-1">
  例:`whisper-1`
</ParamField>

<ParamField body="prompt" type="string" />

<ParamField body="response_format" type="string" />

<ParamField body="temperature" type="number" />

## Response

<ResponseField name="text" type="string" />
