# Speech to Text: Whisper Audio & Video Transcriber (`lightning_ak/speech-to-text-whisper`) Actor

Transcribe audio and video to text with faster-whisper running inside Apify. Get language detection, word timestamps, SRT/VTT/TXT exports, and reliable batch processing with per-file error handling—no API key needed.

- **URL**: https://apify.com/lightning_ak/speech-to-text-whisper.md
- **Developed by:** [Lightning](https://apify.com/lightning_ak) (community)
- **Categories:** AI, Videos, Automation
- **Security:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 40.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 basic models — audio minutes

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Speech to Text: Whisper Audio & Video Transcriber

**Transcribe audio and video to text with Whisper running inside Apify. Upload files or paste media URLs, then receive clean transcripts, timestamped segments, and ready-to-use SRT, VTT, TXT, or JSON output. Language detection, translation to English, word timestamps, silence skipping, and batch processing are built in—no external speech-to-text API key is required.**

### 🎙️ What does Speech to Text: Whisper Audio & Video Transcriber do?

1. Reads each direct audio/video URL or uploaded file from your input, along with your model and language options.
2. Streams each download to disk with retries, size protection, and timeouts instead of loading the whole file into memory.
3. Uses ffmpeg to decode the media and prepare it for transcription. Video files work when they contain an audio track.
4. Runs faster-whisper locally inside the Actor with the model you choose: `tiny`, `base`, `small`, `medium`, or `large-v3`.
5. Detects the spoken language automatically, or uses the ISO language code you provide. It can transcribe the original language or translate the speech to English.
6. Optionally skips long silences with voice activity detection (VAD) and adds word-level timestamps to each segment.
7. Saves the selected transcript formats to the run's key-value store and adds SRT, VTT, and TXT links to the dataset item.
8. Processes every source independently. If one file is corrupt, has no audio, or cannot be downloaded, that item is marked `failed`; the rest of the batch continues.
9. Saves a run summary under the `OUTPUT` key, including item counts, audio processed, timing, and errors.

### 👥 Who is it for?

- **Podcasters** who need transcripts and subtitle files from episodes.
- **Researchers** working with interviews, oral histories, lectures, and field recordings.
- **Journalists** turning recordings into searchable notes and quotes for review.
- **Marketers and content teams** repurposing webinars, videos, and social clips.
- **Accessibility teams** producing captions and text alternatives.
- **Developers and AI builders** preparing audio for search, RAG pipelines, summaries, or LLM workflows.
- **Video creators** who want SRT or VTT captions without operating a separate speech API.

### ⚡ Why use this Actor?

- **No separate speech-to-text API key.** Whisper runs inside the Actor container.
- **Batch processing.** Submit multiple URLs or uploads in one run and get one dataset item per source.
- **Useful output formats.** Request JSON, TXT, SRT, and VTT files to match your downstream workflow.
- **Model choice.** Use `tiny` for quick drafts or `large-v3` when accuracy matters more than speed.
- **Language detection or fixed language.** Let Whisper detect the language, or provide an ISO code for more predictable results.
- **Translation to English.** Set `task` to `translate` when you need English text from non-English audio.
- **Silence handling.** VAD is enabled by default and can reduce wasted transcription on long pauses.
- **Word-level timestamps.** Enable `wordTimestamps` when you need timing inside each segment.
- **Fault isolation.** One bad file is recorded as `failed` and does not stop the batch.
- **Transparent billing.** Pay per started audio minute for successful files, with a price tier for every model. Failed files are not charged per minute.
- **Streamed downloads and retries.** The Actor handles redirects, temporary network errors, and download limits.
- **Video-page support via yt-dlp.** Public YouTube and other supported video pages can be used in addition to direct media URLs.

### 📄 Sample output

The example below uses the public-domain JFK inaugural address sample distributed with whisper.cpp:

`https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav`

| Source | Language | Duration | Segments | Status | Files |
|---|---|---:|---:|---|---|
| `jfk.wav` | en | 11.0 s | 1 | success | SRT, VTT, TXT |

The transcript text and segment data below are illustrative; timing, confidence, punctuation, and example links vary by model, audio, and run.

```json
{
  "sourceUrl": "https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav",
  "text": "And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.",
  "language": "en",
  "languageProbability": 0.97,
  "duration": 11.0,
  "processingTime": 2.6,
  "segments": [
    {
      "start": 0.0,
      "end": 11.0,
      "text": "And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country."
    }
  ],
  "status": "success",
  "error": null,
  "srtUrl": "https://api.apify.com/v2/key-value-stores/AbCdEf123456/records/transcripts-0001-jfk.wav.srt",
  "vttUrl": "https://api.apify.com/v2/key-value-stores/AbCdEf123456/records/transcripts-0001-jfk.wav.vtt",
  "txtUrl": "https://api.apify.com/v2/key-value-stores/AbCdEf123456/records/transcripts-0001-jfk.wav.txt"
}
```

When `wordTimestamps` is enabled, each segment also includes a `words` array with per-word timing and confidence.

### 🎛️ Input

At least one source is required: provide `audioUrls`, upload files through `audioFiles`, or use both.

```json
{
  "audioUrls": [
    "https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav"
  ],
  "modelSize": "base",
  "language": "auto",
  "task": "transcribe",
  "outputFormats": ["json", "txt", "srt", "vtt"],
  "wordTimestamps": false,
  "vadFilter": true
}
```

| Field | Type | Default | Description |
|---|---|---|---|
| `audioUrls` | array of strings | `[]` | Direct audio or video URLs. Public YouTube and other supported video pages can be processed through yt-dlp. Direct media URLs are the most reliable option. |
| `audioFiles` | array of strings | `[]` | Files uploaded through the input's file upload field. They are stored in a key-value store and transcribed like URL sources. |
| `modelSize` | string enum | `base` | Whisper model: `tiny`, `base`, `small`, `medium`, or `large-v3`. |
| `language` | string | `auto` | `auto` for language detection, or an ISO language code such as `en`, `de`, `es`, or `zh`. |
| `task` | string enum | `transcribe` | `transcribe` keeps the original language; `translate` produces English text. |
| `outputFormats` | array of strings | `json`, `txt`, `srt`, `vtt` | Transcript files to save in the key-value store. The structured result is always returned in the dataset. |
| `wordTimestamps` | boolean | `false` | Adds word-level timing and confidence inside each segment. |
| `vadFilter` | boolean | `true` | Uses voice activity detection to skip silence. |
| `maxConcurrency` | integer | `0` (automatic) | Controls how many files are transcribed concurrently. `0` lets the Actor choose a safe value for the allocated memory and CPU. |
| `beamSize` | integer | `5` | Beam search width. Higher values may improve recognition at the cost of speed. |
| `temperature` | number | `0` | Decoding temperature. `0` uses Whisper's standard fallback behavior; higher values allow more sampling. |
| `initialPrompt` | string | empty | Optional vocabulary or context hint for names, jargon, acronyms, or expected wording. |

### 📦 Output

Each source produces one dataset item, including failed sources.

| Field | Type | Description |
|---|---|---|
| `sourceUrl` | string / null | Resolved URL used for the source; may be empty for an uploaded file without an HTTP URL. |
| `text` | string | Full transcript. Empty for failed items and for audio where no speech is detected. |
| `language` | string / null | Detected or requested language code. |
| `languageProbability` | number / null | Confidence of the language detection. |
| `duration` | number / null | Audio duration in seconds. |
| `processingTime` | number | Wall-clock processing time for the item in seconds. This varies by model, hardware, and audio. |
| `segments` | array of objects | Timestamped segments, each with `start`, `end`, and `text`. When `wordTimestamps` is enabled, each segment also includes `words`. |
| `status` | string | `success` or `failed`. |
| `error` | string / null | Clear error message when `status` is `failed`; `null` on success. |
| `srtUrl` | string / null | Link to the SRT file when SRT output was requested and the item succeeded. |
| `vttUrl` | string / null | Link to the VTT file when VTT output was requested and the item succeeded. |
| `txtUrl` | string / null | Link to the TXT file when TXT output was requested and the item succeeded. |

**Run summary:** the `OUTPUT` key in the run's key-value store contains the summary for the whole run, including processed and failed counts and the errors collected during the batch.

#### Downloading results

- Open the run in Apify Console and use the **Output** tab to view or export the dataset.
- Use the API with the run's dataset ID:

```bash
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&clean=true" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

SRT, VTT, and TXT files are available through the links in each dataset item and in the run's key-value store.

### 🧠 Choosing a model

| `modelSize` | Best for | Relative speed | Relative accuracy | Recommended Actor memory |
|---|---|---|---:|---:|
| `tiny` | Quick drafts, clear speech, low-resource runs | Fastest | Basic | 2048 MB |
| `base` | Everyday transcription and the default balance | Fast | Good | 4096 MB |
| `small` | Accents, noisier recordings, better detail | Moderate | Better | 8192 MB |
| `medium` | High-stakes transcripts and complex audio | Slower | High | 8192 MB |
| `large-v3` | Difficult audio where accuracy matters most | Slowest | Highest | 16384 MB |

These are relative descriptions, not benchmark guarantees. Actual speed depends on the allocated CPU and memory, the number and length of files, and the selected options. On Apify, more memory also increases the available CPU share.

The Actor minimum is **2048 MB**. A 2 GB run with the `base` model was verified with a **380 MB peak memory** footprint. Use 4 GB or more for faster CPU throughput on long recordings.

The Actor image includes the `base` model. Selecting another size can add startup time on its first use while that model is prepared.

### 💳 Pricing

This Actor uses pay-per-event billing. Prices depend on the selected model tier:

| Event name | Price | When it applies |
|---|---:|---|
| `apify-actor-start` | **$0.00005 per memory unit** (Apify default) | Charged automatically once per run. A 4 GB run is charged 4 units = **$0.0002**. |
| `audio-minute-basic` | **$0.02 per started audio minute** | Successful files transcribed with `tiny` or `base`. This is the primary event. |
| `audio-minute-small` | **$0.04 per started audio minute** | Successful files transcribed with `small`. |
| `audio-minute-medium` | **$0.08 per started audio minute** | Successful files transcribed with `medium`. |
| `audio-minute-large` | **$0.16 per started audio minute** | Successful files transcribed with `large-v3`. |
| `apify-default-dataset-item` | Removed | No per-item charge. |

A run uses one model, so exactly one per-minute event is charged. Billing rounds up to the next whole minute, with a one-minute minimum for each successfully transcribed file. **Failed files do not incur per-minute charges**, but the automatic actor-start event still applies when a run starts. Platform usage is included in the per-minute prices shown above; no separate platform-usage charge is added for standard runs.

| Audio length | Model | Event | Billable minutes | Per-minute cost |
|---|---|---|---:|---:|
| 12:40 | `tiny` / `base` | `audio-minute-basic` | 13 | $0.26 |
| 12:40 | `small` | `audio-minute-small` | 13 | $0.52 |
| 12:40 | `medium` | `audio-minute-medium` | 13 | $1.04 |
| 12:40 | `large-v3` | `audio-minute-large` | 13 | $2.08 |
| 1:00:00 | `tiny` / `base` | `audio-minute-basic` | 60 | $1.20 |
| 1:00:00 | `small` | `audio-minute-small` | 60 | $2.40 |
| 1:00:00 | `medium` | `audio-minute-medium` | 60 | $4.80 |
| 1:00:00 | `large-v3` | `audio-minute-large` | 60 | $9.60 |
| 20:00, failed file | Any | Any | 0 | $0.00 |

At the default 4 GB Actor memory, add **$0.0002** for the actor-start event to each run.

### 💡 Use cases

- **Podcast and interview transcription** for notes, show pages, and search.
- **Subtitle generation** for video libraries using SRT or VTT.
- **Research archives** that need searchable transcripts and timestamped quotes.
- **Accessibility workflows** for captions and text versions of spoken content.
- **Content repurposing** into articles, summaries, social posts, and newsletters.
- **AI and RAG pipelines** that need clean text plus segment timing.
- **Call and meeting analysis** where batch processing and per-file failures matter.

### ✨ Tips for best accuracy

- Use a larger model when the recording has accents, background noise, or specialized vocabulary.
- Set `language` explicitly when you already know the spoken language; automatic detection is convenient but less predictable on very short or noisy clips.
- Use `initialPrompt` for recurring names, product terms, or acronyms.
- Feed the cleanest audio you have. Excessive clipping, music, and overlapping speakers make transcription harder for any Whisper model.
- Keep `vadFilter` enabled for recordings with long pauses; disable it if quiet speech is being skipped.
- Enable `wordTimestamps` only when you need word timing; it adds processing time.
- If a long recording returns a short transcript, compare the audio `duration` with the last segment end. VAD may be excluding silence; set `vadFilter: false` to process the full timeline, but expect possible hallucinations over silence.
- Test a representative sample before processing a large batch.

### 📌 Limitations

- **Whisper is not guaranteed to be perfect.** Accents, technical terms, music, overlapping speech, and poor recordings can cause errors. Review important transcripts.
- **No speaker labels or diarization.** The output tells you what was said, not who said it.
- **Translation is English-only.** The `translate` task converts speech to English; it is not a general translation service.
- **CPU inference takes time.** Larger models and long recordings take longer than `tiny` or `base`.
- **Public video pages only.** YouTube and other video-page support depends on yt-dlp and public access. Login-gated, private, DRM-protected, or geo-restricted media may fail.
- **No live transcription.** This is a batch Actor, not a real-time streaming service.
- **Word timestamps are estimates.** They can be less precise on music-heavy or overlapping audio.
- **Authentication-protected media URLs** are not supported unless the source is directly accessible to the Actor.
- **A silent recording may produce an empty transcript.** It can still complete successfully because the file itself is valid.

### ❓ FAQ

**How do I convert an MP3 to text?**\
Upload the MP3 through `audioFiles` or paste a direct URL into `audioUrls`, then run the Actor. The transcript is returned in the dataset.

**Can I turn a YouTube video into text?**\
Yes, for public pages supported by yt-dlp. Direct media URLs are more reliable; private, age-restricted, or DRM-protected videos are not supported.

**Which languages are supported?**\
Whisper is multilingual. Use `auto` for detection or provide an ISO language code. Translation, when enabled, is to English only.

**Do I need an API key?**\
No separate speech-to-text API key is needed. You need an Apify account to run the Actor and an Apify API token only if you call it programmatically.

**Can I generate SRT or VTT subtitles?**\
Yes. Include `srt`, `vtt`, or both in `outputFormats`. The dataset item links to the files saved in the key-value store.

**Can I transcribe more than one file per run?**\
Yes. Add multiple URLs or uploads; each source becomes its own dataset item.

**What happens if one file fails?**\
The item is returned with `status: "failed"` and an `error` message. Other files continue processing, and the failed file is not billed.

**Can it identify different speakers?**\
No. The Actor does not provide speaker labels or diarization.

**Can I get word-level timestamps?**\
Yes. Set `wordTimestamps: true` to add word timing and confidence inside each segment.

**Can I call it from code or an AI agent?**\
Yes. Use the Apify API or an Apify client. It can also be run through Apify's MCP server in compatible MCP clients.

**Is this real-time transcription?**\
No. It is designed for batch jobs and recordings, not live audio streams.

**Which model should I start with?**\
Start with `base`. Move to `small` or larger when accuracy matters, or use `tiny` for quick drafts and very clear audio.

### 🛠️ Troubleshooting

| What you may see | Likely cause | Fix |
|---|---|---|
| `The URL returned text/html instead of audio` | The link points to a web page, not a media file | Use a direct media URL, upload the file, or use a supported public video page. |
| `No audio track was found in the file` | The video or container has no audio stream | Use a source that contains audio. |
| `ffprobe could not read the input` | The file is corrupt, truncated, or uses an unsupported container | Re-encode it to a common format such as MP3, WAV, or M4A and retry. |
| `The audio is empty or has no measurable duration` | The file has no usable audio content | Check the recording with a media player or ffprobe. |
| `HTTP 403`, `HTTP 404`, or a download error | The URL is private, expired, moved, or blocked | Use a fresh direct URL or upload the file. |
| `HTTP 429` or a timeout | The host is rate-limiting or slow | Retry later; the Actor already retries transient download failures. |
| `The file is larger than the limit` | The media exceeds the Actor's download limit | Use a smaller or lower-bitrate version, or split the recording. |
| `Transcription failed: ...` | The model or decoder could not process this audio | Retry once, try a smaller model, or clean up the audio. |
| `Model loading failed` | The selected model could not be prepared | Retry the run or choose a smaller model. |
| Empty `text` with `status: success` | The recording contains no detected speech, or VAD skipped it | Check the audio; try a clearer recording or disable VAD if quiet speech is present. |

### 🧑‍💻 API usage

The examples use the deployed Actor ID `lightning_ak/speech-to-text-whisper`.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("lightning_ak/speech-to-text-whisper").call(
    run_input={
        "audioUrls": ["https://example.com/interview.mp3"],
        "modelSize": "base",
        "language": "auto",
        "task": "transcribe",
        "outputFormats": ["json", "srt", "vtt", "txt"],
        "wordTimestamps": True,
        "vadFilter": True,
    },
)

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('lightning_ak/speech-to-text-whisper').call({
  audioUrls: ['https://example.com/interview.mp3'],
  modelSize: 'base',
  language: 'auto',
  task: 'transcribe',
  outputFormats: ['json', 'srt', 'vtt', 'txt'],
  wordTimestamps: true,
  vadFilter: true,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/lightning_ak~speech-to-text-whisper/runs?waitForFinish=300" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "audioUrls": ["https://example.com/interview.mp3"],
    "modelSize": "base",
    "language": "auto",
    "task": "transcribe",
    "outputFormats": ["json", "srt", "vtt", "txt"],
    "wordTimestamps": true,
    "vadFilter": true
  }'
```

Read the dataset using the `defaultDatasetId` from the run response:

```bash
curl "https://api.apify.com/v2/datasets/DATASET_ID/items?format=json&clean=true" \
  -H "Authorization: Bearer $APIFY_TOKEN"
```

**Apify MCP:** this Actor can also be discovered and run through Apify's MCP server in compatible AI clients, making it possible to transcribe media from an agent workflow.

### ⚖️ Legal and responsible use

Only process audio and video that you have the right to use. You are responsible for obtaining consent from speakers, respecting copyright, and following the terms of the platform that hosts the source media. Do not upload confidential, sensitive, or personal recordings without authorization. Transcripts can contain errors and should not be treated as a substitute for professional legal, medical, or compliance review.

### 💬 Feedback and support

Found a bug or need a different output format? Open an issue from the Actor's page in Apify Console and include the input type (URL or upload), selected `modelSize`, and the error message. Do not post private audio, personal data, or API tokens.

### 🔗 Related Actors

Explore related tools in the Apify Store:

- [AI Actors](https://apify.com/store/categories/ai)
- [Videos Actors](https://apify.com/store/categories/videos)
- [Automation Actors](https://apify.com/store/categories/automation)

# Actor input Schema

## `audioUrls` (type: `array`):

Direct links to mp3, wav, m4a, mp4, webm, ogg, flac, and similar media files. YouTube, Vimeo, SoundCloud, and other supported pages are also accepted.

## `audioFiles` (type: `array`):

Upload files here (they are stored in a key-value store) or paste key-value store record keys/URLs. Files larger than the configured limit (1 GB by default) are rejected.

## `modelSize` (type: `string`):

Larger models are more accurate but slower. The Docker image bakes in the 'base' model by default; other sizes download on first use unless the image is rebuilt with a different WHISPER_MODEL build arg. Billing uses audio-minute-basic for tiny/base, audio-minute-small for small, audio-minute-medium for medium, and audio-minute-large for large-v3.

## `language` (type: `string`):

ISO 639-1/2 code such as en, de, es, or zh, or 'auto' to detect the language automatically.

## `task` (type: `string`):

Transcribe keeps the original language. Translate always produces English text.

## `outputFormats` (type: `array`):

Transcript files are saved to the default key-value store with the transcripts- key prefix and linked from every dataset item. The dataset always contains the full JSON result.

## `wordTimestamps` (type: `boolean`):

Add a word array with start/end times to every segment. Slower than segment-only timestamps.

## `vadFilter` (type: `boolean`):

Use voice activity detection to skip silence and speed up long recordings. Disable it to force processing of the entire timeline; silent stretches may produce hallucinated text.

## `maxConcurrency` (type: `integer`):

0 selects a safe value automatically from allocated memory and CPU. Higher values can improve throughput but use more RAM; the Actor clamps the value to a safe limit.

## `beamSize` (type: `integer`):

Beam search width. 5 is a good default; 1 is greedy and fastest.

## `temperature` (type: `number`):

Sampling temperature. 0 (recommended) uses Whisper's standard fallback ladder (0.0, 0.2, ... 1.0) to recover from repetition and decoding failures.

## `initialPrompt` (type: `string`):

Optional context for the model, such as names, terminology, or a list of expected words. Keep it short.

## Actor input object example

```json
{
  "audioUrls": [
    "https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav"
  ],
  "audioFiles": [],
  "modelSize": "base",
  "language": "auto",
  "task": "transcribe",
  "outputFormats": [
    "json",
    "txt",
    "srt",
    "vtt"
  ],
  "wordTimestamps": false,
  "vadFilter": true,
  "maxConcurrency": 0,
  "beamSize": 5,
  "temperature": 0
}
```

# Actor output Schema

## `results` (type: `string`):

One dataset item per input source, including transcript text, language, duration, timestamped segments, status, error, and links to transcript files.

## `runSummary` (type: `string`):

JSON summary stored under the OUTPUT key, including item counts, audio processed, billing events, and errors.

## `transcriptFiles` (type: `string`):

SRT, VTT, TXT, and JSON transcript files stored with the transcripts- key prefix in the default key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "audioUrls": [
        "https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav"
    ],
    "audioFiles": [],
    "outputFormats": [
        "json",
        "txt",
        "srt",
        "vtt"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lightning_ak/speech-to-text-whisper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "audioUrls": ["https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav"],
    "audioFiles": [],
    "outputFormats": [
        "json",
        "txt",
        "srt",
        "vtt",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("lightning_ak/speech-to-text-whisper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "audioUrls": [
    "https://github.com/ggerganov/whisper.cpp/raw/master/samples/jfk.wav"
  ],
  "audioFiles": [],
  "outputFormats": [
    "json",
    "txt",
    "srt",
    "vtt"
  ]
}' |
apify call lightning_ak/speech-to-text-whisper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lightning_ak/speech-to-text-whisper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/rznej8sBNTBSaLKO5/builds/yG5wvcVNiJsfDmDhK/openapi.json
