# Transcription API docs · Speechtrace

> Transcribe audio with an OpenAI-compatible endpoint, a batch API with webhooks, or a folder tool. Words with timestamps and speakers, plus SRT and VTT subtitles.

Web page: https://speechtraceai.com/docs

API reference

## API

Send an API key as `Authorization: Bearer tx_…`. Create one in your [dashboard](https://speechtraceai.com/app), with `uvx speechtrace login`, or from your program ([we email you a code](https://speechtraceai.com/docs#signin)). The full reference is at [/api-docs](https://speechtraceai.com/api-docs).

On this page

[AI assistants & CLI](https://speechtraceai.com/docs#assistants) [OpenAI-compatible](https://speechtraceai.com/docs#openai) [A whole folder](https://speechtraceai.com/docs#folder) [Batches and big files](https://speechtraceai.com/docs#batches) [Sign in from a program](https://speechtraceai.com/docs#signin) [Balance and top-ups](https://speechtraceai.com/docs#account) [Limits](https://speechtraceai.com/docs#limits) [Credits](https://speechtraceai.com/docs#credits)

### AI assistants and the command line

Tell your AI assistant what to transcribe and point it at our instructions; it signs you up, transcribes, and asks you to top up when needed. [Set-up for Claude, Cursor and Codex](https://speechtraceai.com/ai-assistants).

AI assistant:

```
Use https://speechtraceai.com to transcribe the audio files in ~/Recordings into text. Instructions for AI assistants: https://speechtraceai.com/llms.txt
```

Command line:

```bash
uvx speechtrace login --email you@example.com   # we email you a code
uvx speechtrace login --code 123456
uvx speechtrace transcribe ./recordings --formats txt,srt,json
```

The command line tool is `speechtrace` on PyPI (run it with `uvx`, `pipx run` or after `pip install speechtrace`). It also runs as an MCP server: `uvx speechtrace mcp`.

### OpenAI-compatible simplest

Existing code that calls OpenAI's transcription API works by changing the base URL. The response comes when the transcript is ready (files up to 200 MB).

OpenAI SDK:

```python
from openai import OpenAI

client = OpenAI(base_url="https://speechtraceai.com/v1", api_key="tx_...")
text = client.audio.transcriptions.create(model="default", file=open("talk.mp3", "rb")).text
```

response\_format: json, text, srt, vtt or verbose\_json (segments with speakers, and word times).

### A whole folder

The open-source `speechtrace` tool sends every audio and video file under a folder, saves the transcripts in a matching structure, and picks up where it stopped if interrupted. Prefer one file? The same code is a single script.

Command line:

```bash
uvx speechtrace login --email you@example.com   # we email you a code
uvx speechtrace login --code 123456
uvx speechtrace transcribe ./recordings --formats txt,srt,json
```

Single-file script:

```bash
curl -O https://speechtraceai.com/bulk-transcribe.py
pip install requests
export SPEECHTRACE_API_KEY=tx_...   # from your dashboard
python bulk-transcribe.py ./recordings --out ./transcripts --formats txt,srt,json
```

### Batches and big files

1.  Ask for an upload link, then PUT the file to it:
    
    Upload:
    
    ```bash
    curl -s https://speechtraceai.com/v1/uploads -H "Authorization: Bearer $KEY" \
      -H "Content-Type: application/json" \
      -d '{"filename": "talk.mp3", "content_type": "audio/mpeg"}'
    # -> {"upload_id": "...", "put_url": "https://..."}
    
    curl -X PUT -H "Content-Type: audio/mpeg" --upload-file talk.mp3 "$PUT_URL"
    ```
    
2.  Start the transcription (or pass `audio_url` instead of `upload_id` for a public link to the file itself, or `link` for a page with a video on it; see below):
    
    Start:
    
    ```bash
    curl -s https://speechtraceai.com/v1/transcriptions -H "Authorization: Bearer $KEY" \
      -H "Content-Type: application/json" \
      -d '{"upload_id": "...", "speakers": true, "webhook_url": "https://you.example/hook"}'
    ```
    
3.  Poll `GET /v1/transcriptions/{id}` (or wait for the webhook), then fetch the result:
    
    Result:
    
    ```bash
    curl -s "https://speechtraceai.com/v1/transcriptions/$ID/result?format=json" -H "Authorization: Bearer $KEY"
    ```
    
    format: json (words with start/end/speaker, plus speaker segments), txt, srt or vtt.
    

The webhook receives `{"type": "transcription.done", "data": {…}}` (or `transcription.failed`) with the same fields as the status call.

### Sign in from a program

Programs can create the account and get a key without a browser. We email the person a 6-digit code and an Approve link; your program sends the code back (or, without it, waits until they approve and type the 2-digit `match_number` you show them). The key comes back once. New addresses get 10 free hours.

Sign in:

```bash
curl -s https://speechtraceai.com/v1/auth/email -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "client_name": "My app"}'
# -> {"request_token": "txr_...", "match_number": "42", ...}; we email you a 6-digit code

curl -s https://speechtraceai.com/v1/auth/email/complete -H "Content-Type: application/json" \
  -d '{"request_token": "txr_...", "code": "123456"}'
# -> {"api_key": "tx_...", "balance_hours": 10, ...}
```

### Balance and top-ups

`GET /v1/account` gives the hours left. When a call answers `402`, the account is out of hours: create a checkout link and give it to the person. Only they can pay, on Stripe's page; the hours arrive within seconds (watch `GET /v1/billing/payments`).

Buy hours:

```bash
curl -s https://speechtraceai.com/v1/account -H "Authorization: Bearer $KEY"
curl -s https://speechtraceai.com/v1/billing/checkout -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" -d '{"usd": 10}'
# -> {"url": "https://checkout.stripe.com/...", "hours": 125}: open it and pay
```

### Limits

-   Files up to 3 hours; English.
-   Audio is deleted after transcription; transcripts after 30 days or when you delete them.

### Credits

The home page's sample clips: [NASA's Houston We Have a Podcast](https://www.nasa.gov/podcasts/houston-we-have-a-podcast/ai-at-nasa/) and the [Supreme Court of the United States](https://www.supremecourt.gov/oral_arguments/audio/2025/25-406) (both public domain), and the Office for National Statistics' [Statistically Speaking](https://blog.ons.gov.uk/2023/07/28/in-the-field-surveying-the-nation/), which contains public sector information licensed under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/). None of them endorses Speechtrace.
