---
title: "TIL: Testing an STT API With curl"
description: One curl command transcribes audio through any REST-based STT API. No SDK, no imports, just your audio file and an API key.
canonical: https://lukeocodes.dev/til-stt-curl
type: article
locale: en_GB
published: 2026-05-19T00:00:00.000Z
modified: 2026-05-19T00:00:00.000Z
authors:
  - Luke Oliff
section: TIL
tags:
  - TIL
  - Speech-to-Text
  - APIs
feed: https://lukeocodes.dev/rss.xml
search: https://lukeocodes.dev/search.json?q={query}
schema:
  - "@context": https://schema.org
    "@graph":
      - "@type": Organization
        "@id": https://ably.com/#organization
        name: Ably
        url: https://ably.com
      - "@type": WebSite
        "@id": https://lukeocodes.dev/#website
        url: https://lukeocodes.dev
        name: Luke Oliff
        alternateName: lukeocodes
        inLanguage: en
        publisher:
          "@id": https://lukeocodes.dev/authors/luke#person
        description: Personal blog and writing by Luke Oliff — developer relations, voice AI, developer experience.
        potentialAction:
          - "@type": SearchAction
            target:
              "@type": EntryPoint
              urlTemplate: https://lukeocodes.dev/blog/search?q={search_term_string}
            query-input: required name=search_term_string
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Staff engineer and Staff Tech Lead for Developer Experience at Ably. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Staff Tech Lead, Developer Experience
        worksFor:
          "@id": https://ably.com/#organization
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
  - "@context": https://schema.org
    "@graph":
      - "@type": Organization
        "@id": https://ably.com/#organization
        name: Ably
        url: https://ably.com
      - "@type": Person
        "@id": https://lukeocodes.dev/authors/luke#person
        name: Luke Oliff
        url: https://lukeocodes.dev/authors/luke
        description: Staff engineer and Staff Tech Lead for Developer Experience at Ably. Writing about developer relations, AI, and the voice industry, from the UK.
        mainEntityOfPage: https://lukeocodes.dev/authors/luke
        givenName: Luke
        familyName: Oliff
        image: https://lukeocodes.dev/authors/luke.jpg
        jobTitle: Staff Tech Lead, Developer Experience
        worksFor:
          "@id": https://ably.com/#organization
        sameAs:
          - https://www.linkedin.com/in/lukeocodes
          - https://github.com/lukeocodes
          - https://bsky.app/profile/lukeocodes.dev
          - https://x.com/lukeocodes
          - https://hashnode.com/@lukeocodes
          - https://dev.to/lukeocodes
        knowsAbout:
          - Developer Relations
          - Developer Experience
          - Voice AI
          - Text-to-Speech
          - Answer Engine Optimisation
          - Search Engine Optimisation
          - Open Source
          - Developer Tooling
          - API Design
          - Speech-to-Text
          - Voice Agents
          - Community Building
        knowsLanguage:
          - English
        nationality: British
        alumniOf:
          - "@type": Organization
            name: The Open University
      - "@type": BlogPosting
        "@id": https://lukeocodes.dev/til-stt-curl#article
        headline: "TIL: Testing an STT API With curl"
        alternativeHeadline: "TIL: Testing speech-to-text with curl"
        description: One curl command transcribes audio through any REST-based STT API. No SDK, no imports, just your audio file and an API key.
        datePublished: 2026-05-19T00:00:00.000Z
        dateModified: 2026-05-19T00:00:00.000Z
        url: https://lukeocodes.dev/til-stt-curl
        mainEntityOfPage: https://lukeocodes.dev/til-stt-curl
        inLanguage: en
        author:
          - "@id": https://lukeocodes.dev/authors/luke#person
        isPartOf:
          "@id": https://lukeocodes.dev/#website
        keywords: TIL, Speech-to-Text, APIs
        articleSection: TIL
        about:
          - "@type": Thing
            name: Speech-to-Text
        abstract: "TIL Tuesday: testing a speech-to-text API takes one curl command, not a full integration. I spent months writing SDK wrappers before realising that curl tells me everything I need to know in about three seconds."
        speakable:
          "@type": SpeakableSpecification
          cssSelector:
            - .post-tldr
            - h1
        image: https://lukeocodes.dev/blog/til-stt-curl/hero.png
        wordCount: 597
        timeRequired: PT3M
        publisher:
          "@id": https://ably.com/#organization
      - "@type": BreadcrumbList
        itemListElement:
          - "@type": ListItem
            position: 1
            name: Home
            item: https://lukeocodes.dev
          - "@type": ListItem
            position: 2
            name: Writing
            item: https://lukeocodes.dev/blog
          - "@type": ListItem
            position: 3
            name: "TIL: Testing an STT API With curl"
            item: https://lukeocodes.dev/til-stt-curl
---

[Luke Oliff.](/)

- [Blog](/blog)
- [CV](/cv)
- [Uses](/uses)
- [User manual](/user-manual)
- [Living with ADHD](/living-and-working-with-adhd)
- [RSS](/rss.xml)

[Luke Oliff · Writing](/blog)

# TIL: Testing speech-to-text with curl

May 2026 · [TIL](/blog/category/til) · 3 min read · [Luke Oliff](/authors/luke)

TIL Tuesday: testing a speech-to-text API takes one curl command, not a full integration. I spent months writing SDK wrappers before realising that curl tells me everything I need to know in about three seconds.

```bash
curl -s -X POST "https://api.deepgram.com/v1/listen?model=nova-3&language=en&punctuate=true" \
  -H "Authorization: Token YOUR_DG_API_KEY" \
  -H "Content-Type: audio/wav" \
  --data-binary @test.wav \
  | jq '.results.channels[0].alternatives[0].transcript'
```

The response comes back with the full transcript, confidence scores, word-level timings, and a bunch of metadata. Piping through `jq` grabs just the transcript. That is usually enough to know whether the format is right and the accuracy is acceptable.

## What curl reveals about speech-to-text that SDKs hide

SDKs abstract away the HTTP layer. That is their job. But when something goes wrong, the abstraction becomes a wall you have to dig through. curl shows you exactly what the API returned, status code included.

A 400 response means the audio format is wrong. A 401 means the API key is bad. A 413 means the file is too big. The SDK might wrap these into a generic exception. curl gives you the raw response, which is faster to read than stack traces.

```bash
# Check the full response headers too
curl -s -D - -X POST "https://api.deepgram.com/v1/listen?model=nova-3" \
  -H "Authorization: Token YOUR_DG_API_KEY" \
  -H "Content-Type: audio/wav" \
  --data-binary @test.wav \
  -o /dev/null
```

The `-D -` flag prints response headers to stdout. The `dg-request-id` header is the quickest way to reference a request when you need support.

## Parameters worth setting from day one

The defaults work but they are not what you want. These three parameters change the output more than anything else:

- `punctuate=true` adds capitalisation, commas, and full stops. Without it you get a wall of lowercase words.
- `model=nova-3` picks the model. The default is usually base, which is less accurate but faster. Nova-3 was the production model at Deepgram in 2026.
- `language=en` forces the language. Auto-detection works but adds latency and can guess wrong on short audio.

```bash
curl -s -X POST "https://api.deepgram.com/v1/listen?model=nova-3&language=en&punctuate=true&smart_format=true&utterances=true" \
  -H "Authorization: Token YOUR_DG_API_KEY" \
  -H "Content-Type: audio/wav" \
  --data-binary @recording.wav \
  | jq '.results.channels[0].alternatives[0].paragraphs'
```

`smart_format` converts numbers, dates, and currency into readable forms. `utterances` splits the transcript into speaker turns if diarization is enabled. I learned these one at a time as developers asked why their transcripts looked wrong.

## When curl is not enough

Curl tests the pre-recorded endpoint. For streaming audio you need a WebSocket client. But for the common case of testing an audio file against an STT model, curl is the fastest path from file to transcript.

### FAQ

**What is the minimum curl command for STT?**

A POST request to the STT endpoint with the audio file as the body and your API key in the Authorization header. Add `--data-binary @file.wav` and pipe the response through `jq` to extract the transcript.

**Why use curl instead of an SDK for testing?**

SDKs handle errors by throwing exceptions. curl shows you the raw HTTP response, which is faster to interpret when the issue is a wrong parameter or audio format mismatch. You also skip the setup step entirely.

**Does this work with any STT API?**

The URL and parameter names change between providers but the pattern is the same. POST the audio file, send an auth token, get JSON back. The curl workflow translates across providers with minimal changes.

**Can curl handle streaming STT?**

No. Streaming uses WebSockets, which require a persistent connection. For pre-recorded audio files, curl works. For live audio you need a WebSocket client like wscat or a language-specific library.

[← Newer: What nobody tells you about audio in speech-to-text](/what-nobody-tells-you-about-audio-speech-to-text)

[All posts](/blog) →

## Search this site

`GET https://lukeocodes.dev/search.json?q=<words>` returns matching posts as JSON, each with its page URL and its markdown URL. Add `&limit=<1-50>` for more than 10. How it works: [/blog/search](https://lukeocodes.dev/blog/search.md).

```sh
curl "https://lukeocodes.dev/search.json?q=developer+relations"
```

---

© 2026 Luke Oliff. Posts live at the root of this site.

- [GitHub](https://github.com/lukeocodes)
- [LinkedIn](https://www.linkedin.com/in/lukeocodes)
- [X](https://x.com/lukeocodes)
- [Bluesky](https://bsky.app/profile/lukeocodes.dev)
- [Email](mailto:luke@lukeoliff.com)
- [RSS](/rss.xml)

## Cookies

This site sets one analytics cookie, from Google Analytics, and only in a browser that accepts the cookie banner. A client that does not run scripts sets no cookies, so there is nothing to accept or decline here.

[Cookie policy](/cookies)
