# Whisper API

### About

With its intuitive interface and robust functionality, Whisper API enables developers to effortlessly integrate audio transcription capabilities into their applications. Whether you're building a voice recognition system, developing a podcasting platform, or enhancing accessibility features, Whisper API provides the tools you need to convert audio files into accurate and editable text.

Using advanced machine learning algorithms, Whisper API delivers precise transcriptions with high accuracy, even for challenging audio recordings. Developers can customize transcription settings to optimize results for different languages, accents, and audio quality levels. With support for various audio formats, including MP3, WAV, and more, Whisper API ensures compatibility with a wide range of media sources.

Beyond transcription, Whisper API offers powerful scripting features to enhance the usability of transcribed text. Developers can segment audio transcripts into logical sections, add timestamps for easy navigation, and annotate content with metadata for organization and analysis purposes. With these scripting capabilities, developers can create rich, interactive experiences that leverage the insights extracted from audio content.

Whisper API is built with scalability and reliability in mind, allowing developers to process large volumes of audio data efficiently. With flexible pricing plans and straightforward integration options, Whisper API empowers developers to focus on building innovative audio-driven applications without worrying about the complexities of transcription technology.

Whether you're developing voice-enabled applications, conducting research, or creating multimedia content, Whisper API provides the foundation you need to unlock the potential of audio data. With its comprehensive features and developer-friendly design, Whisper API is the ideal solution for audio transcription and scripting needs.

#### Developer Portal:  <https://api.market/store/magicapi/whisper>

![image](https://telegra.ph/file/abb3a14db85ba00bdcf86.png)

### Curl Requests and Responses <a href="#curl-requests-and-responses" id="curl-requests-and-responses"></a>

**Process the API**

{% tabs %}
{% tab title="Curl" %}

```bash
curl -X 'POST' \
  'https://prod.api.market/api/v1/magicapi/whisper/whisper' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "audio": "https://replicate.delivery/mgxm/e5159b1b-508a-4be4-b892-e1eb47850bdc/OSR_uk_000_0050_8k.wav",
  "model": "large-v3",
  "translate": false,
  "temperature": 0,
  "transcription": "plain text",
  "suppress_tokens": "-1",
  "logprob_threshold": -1,
  "no_speech_threshold": 0.6,
  "condition_on_previous_text": true,
  "compression_ratio_threshold": 2.4,
  "temperature_increment_on_fallback": 0.2
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
    'Content-Type': 'application/json',
}

json_data = {
    'audio': 'https://replicate.delivery/mgxm/e5159b1b-508a-4be4-b892-e1eb47850bdc/OSR_uk_000_0050_8k.wav',
    'model': 'large-v3',
    'translate': False,
    'temperature': 0,
    'transcription': 'plain text',
    'suppress_tokens': '-1',
    'logprob_threshold': -1,
    'no_speech_threshold': 0.6,
    'condition_on_previous_text': True,
    'compression_ratio_threshold': 2.4,
    'temperature_increment_on_fallback': 0.2,
}

response = requests.post('https://api.magicapi.dev/api/v1/magicapi/whisper/whisper', headers=headers, json=json_data)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/magicapi/whisper/whisper');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-magicapi-key: API_KEY',
    'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n  \"audio\": \"https://replicate.delivery/mgxm/e5159b1b-508a-4be4-b892-e1eb47850bdc/OSR_uk_000_0050_8k.wav\",\n  \"model\": \"large-v3\",\n  \"translate\": false,\n  \"temperature\": 0,\n  \"transcription\": \"plain text\",\n  \"suppress_tokens\": \"-1\",\n  \"logprob_threshold\": -1,\n  \"no_speech_threshold\": 0.6,\n  \"condition_on_previous_text\": true,\n  \"compression_ratio_threshold\": 2.4,\n  \"temperature_increment_on_fallback\": 0.2\n}");

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.post(
  'https://api.magicapi.dev/api/v1/magicapi/whisper/whisper',
  {
    'audio': 'https://replicate.delivery/mgxm/e5159b1b-508a-4be4-b892-e1eb47850bdc/OSR_uk_000_0050_8k.wav',
    'model': 'large-v3',
    'translate': false,
    'temperature': 0,
    'transcription': 'plain text',
    'suppress_tokens': '-1',
    'logprob_threshold': -1,
    'no_speech_threshold': 0.6,
    'condition_on_previous_text': true,
    'compression_ratio_threshold': 2.4,
    'temperature_increment_on_fallback': 0.2
  },
  {
    headers: {
      'accept': 'application/json',
      'x-magicapi-key': 'API_KEY',
      'Content-Type': 'application/json'
    }
  }
);
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://api.magicapi.dev/api/v1/magicapi/whisper/whisper', {
  method: 'POST',
  headers: {
    'accept': 'application/json',
    'x-magicapi-key': 'API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    'audio': 'https://replicate.delivery/mgxm/e5159b1b-508a-4be4-b892-e1eb47850bdc/OSR_uk_000_0050_8k.wav',
    'model': 'large-v3',
    'translate': false,
    'temperature': 0,
    'transcription': 'plain text',
    'suppress_tokens': '-1',
    'logprob_threshold': -1,
    'no_speech_threshold': 0.6,
    'condition_on_previous_text': true,
    'compression_ratio_threshold': 2.4,
    'temperature_increment_on_fallback': 0.2
  })
});
```

{% endtab %}
{% endtabs %}

```json
{
  "request_id": REQUEST_ID
}
```

**Get the result**

{% tabs %}
{% tab title="Curl" %}

```bash
curl -X 'GET' \
  'https://api.magicapi.dev/api/v1/magicapi/whisper/predictions/REQUEST_ID' \
  -H 'accept: application/json' \
  -H 'x-api-market-key: API_KEY'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY',
}

response = requests.get('https://prod.api.market/api/v1/magicapi/whisper/predictions/REQUEST_ID', headers=headers)
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://prod.api.market/api/v1/magicapi/whisper/predictions/REQUEST_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'accept: application/json',
    'x-api-market-key: API_KEY',
]);

$response = curl_exec($ch);

curl_close($ch);
```

{% endtab %}

{% tab title="NodeJs" %}

```javascript
import axios from 'axios';

const response = await axios.get('https://prod.api.market/api/v1/magicapi/whisper/predictions/REQUEST_ID', {
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  }
});
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
fetch('https://prod.api.market/api/v1/magicapi/whisper/predictions/REQUEST_ID', {
  headers: {
    'accept': 'application/json',
    'x-api-market-key': 'API_KEY'
  }
});
```

{% endtab %}
{% endtabs %}

```json
{
  "status": "succeeded",
  "result": "RESULT_URL"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.api.market/api-product-docs/magicapi/whisper-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
