# Speech to Text API

Turn audio and video files into text with the speech-to-text model you pick (Whisper, Deepgram, ElevenLabs Scribe, AssemblyAI and more): one row per file with the transcript, the language, the duration, timestamped segments, the exact model version, its maker and the exact cost of that call. You pay exactly what each call costs at the model's own rate.

**Pricing:** Metered: you pay exactly each call's cost at the selected model's rates (default OpenAI: Whisper Large V3 Turbo: $0.0002 per minute of audio). Each model's rates are listed with the `model` parameter's options in the API schema.

**Endpoint:** `POST /v1/data/ai/transcription/run`

**Auth:** `Authorization: Bearer mk_live_...`

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `files` | array | Yes | Public URLs of the audio or video files to transcribe, one row per file. Each file is one call to the model. |
| `model` | string | No | The speech-to-text model. Pick from the list (popular models first). Each model shows its own rate (per minute of audio, or per 1M tokens), and that is exactly what each call costs. |
| `language` | string | No | The spoken language. Leave empty to detect it automatically. |

## Example

`?wait=true` holds the request open until the run finishes (up to 60s) and returns the rows inline: one request, no polling.

```bash
curl -X POST "https://api.mindcase.co/v1/data/ai/transcription/run?wait=true" \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{"files":["..."]}}'
```

```python
import requests

resp = requests.post(
    "https://api.mindcase.co/v1/data/ai/transcription/run",
    params={"wait": "true"},
    headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
    json={"params": {
    "files": [
        "..."
    ]
}},
)
rows = resp.json()["data"]
```

## Longer runs

If the run is still going at the 60s ceiling you get back `{ job_id, status: "running" }` instead of rows (same if the result is over 100 rows; those come back `truncated`). Poll with that `job_id`:

```bash
# 1) check status
curl https://api.mindcase.co/v1/jobs/JOB_ID \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"

# 2) when status == completed, fetch the rows
curl https://api.mindcase.co/v1/jobs/JOB_ID/results \
  -H "Authorization: Bearer mk_live_YOUR_API_KEY"
```

Full API reference (auth, jobs, balance, SDKs, MCP): https://mindcase.co/skills.md

## Response columns

| Field | Display name | Type |
|-------|--------------|------|
| `id` | ID | text |
| `fileUrl` | File URL | text |
| `transcript` | Transcript | text |
| `language` | Language | text |
| `durationSeconds` | Duration (Seconds) | number |
| `segments` | Segments | object_array |
| `model` | Model | text |
| `provider` | Provider | text |
| `costUsd` | Cost (USD) | number |
| `error` | Error | text |
| `createdAt` | Created At | datetime |
