> ## 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/transcriptions' \
    --header 'Authorization: Bearer <token>' \
    --form 'file=@audio.mp3' \
    --form 'model=whisper-1' \
    --form 'language=language' \
    --form 'prompt=日差しのある庭を走る小さな子猫、映画的、高精細' \
    --form 'response_format=json' \
    --form 'temperature=1' \
    --form 'timestamp_granularities=word'
  ```

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

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

  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/transcriptions";

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

  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>

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

<ParamField body="language" type="string">
  ISO-639-1言語コード
</ParamField>

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

<ParamField body="response_format" type="string" default="json">
  指定可能な値:`json`、`text`、`srt`、`verbose_json`、`vtt`
</ParamField>

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

<ParamField body="timestamp_granularities" type="array<string>" />

## Response

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