---
title: What surprised me about TTS API design after years of STT
description: "After years of speech-to-text, TTS API design broke my assumptions: output parameters everywhere, SSML that fights you, and speech marks nobody mentions."
canonical: https://lukeocodes.dev/what-surprised-me-about-tts-api-design
type: article
locale: en_GB
published: 2026-07-05T00:00:00.000Z
modified: 2026-07-05T00:00:00.000Z
authors:
  - Luke Oliff
section: API Design
tags:
  - API Design
  - Text-to-Speech
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/what-surprised-me-about-tts-api-design#article
        headline: What surprised me about TTS API design after years of STT
        alternativeHeadline: What surprised me about TTS API design after years of STT
        description: "After years of speech-to-text, TTS API design broke my assumptions: output parameters everywhere, SSML that fights you, and speech marks nobody mentions."
        datePublished: 2026-07-05T00:00:00.000Z
        dateModified: 2026-07-05T00:00:00.000Z
        url: https://lukeocodes.dev/what-surprised-me-about-tts-api-design
        mainEntityOfPage: https://lukeocodes.dev/what-surprised-me-about-tts-api-design
        inLanguage: en
        author:
          - "@id": https://lukeocodes.dev/authors/luke#person
        isPartOf:
          "@id": https://lukeocodes.dev/#website
        keywords: API Design, Text-to-Speech
        articleSection: API Design
        about:
          - "@type": Thing
            name: API Design
          - "@type": Thing
            name: Text-to-Speech
        abstract: Switching from speech-to-text to text-to-speech APIs means unlearning a bunch of assumptions about how voice APIs should work. Here are the things that caught me off guard.
        speakable:
          "@type": SpeakableSpecification
          cssSelector:
            - .post-tldr
            - h1
        image: https://lukeocodes.dev/og.png?h=What+surprised+me+about+TTS+API+design+after+years+of+STT&d=After+years+of+speech-to-text%2C+TTS+API+design+broke+my+assumptions%3A+output+parameters+everywhere%2C+SSML+that+fights+you%2C+and+speech+marks+nobody+mentions.&e=Writing
        wordCount: 567
        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: What surprised me about TTS API design after years of STT
            item: https://lukeocodes.dev/what-surprised-me-about-tts-api-design
---

[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)

# What surprised me about TTS API design after years of STT

Jul 2026 · [API Design](/blog/category/api-design) · 3 min read · [Luke Oliff](/authors/luke)

Switching from speech-to-text to text-to-speech APIs means unlearning a bunch of assumptions about how voice APIs should work. Here are the things that caught me off guard.

### Output is harder than input

With STT, the API receives audio and returns text. The hard part is accuracy and latency. The API surface is relatively simple: send audio, get transcription. Streaming adds complexity but the core contract is straightforward.

With TTS, the API receives text and returns audio. That sounds symmetric but it's not. The output has parameters that don't exist on the input side. Voice selection, speed, pitch, emotion, SSML tags, sample rate, bitrate, output format. Each one multiplies the design surface and every combination needs to work reliably.

The streaming path is also more complex on the TTS side. With STT, you stream audio in and get partial transcripts back. The contract is append-only. With TTS, you send text and get audio chunks back. But those chunks have timing information - speech marks that tell you which word is being spoken at which millisecond. That data is essential for captions, highlighting, and synchronisation, but it means the API needs to return two parallel streams or a multiplexed one.

### SSML is both powerful and painful

Speech Synthesis Markup Language has been around for years and it shows. It works. You can control emphasis, pacing, pitch, pronunciation, and silence with XML tags. But it's verbose and easy to get wrong.

The trend in newer APIs is toward natural language control instead of XML markup. "Speak this sentence with excitement" instead of wrapping it in `<prosody pitch="high">` tags. I think that's the right direction but SSML still has more granular control for use cases where you need it. Supporting both means maintaining two code paths.

### Speech marks are the killer feature nobody talks about

Every TTS API returns word-level timestamps if you ask for them. They're called speech marks and they tell you exactly when each word starts and ends in the generated audio. This data is incredibly useful - captions, karaoke-style highlighting, aligning audio with video cuts - but most developers I've talked to didn't know it existed.

It's one of those features that isn't prominent in documentation because it was added as metadata rather than a product surface. But it's the kind of thing that, once you know about it, changes how you think about building with TTS.

### The pricing problem

TTS pricing varies wildly across providers. Per-character, per-second, per-token. With and without tiers. Voice cloning costs extra. Emotion control costs extra. Streaming sometimes costs the same as non-streaming, sometimes more. Comparing options requires a spreadsheet.

A few years ago, the quality gap between premium and budget TTS was wide enough that you paid up or accepted noticeably worse output. That gap has narrowed significantly. The top models are close enough that pricing is now a primary decision factor, which is a shift from the STT market where a couple of providers clearly lead on quality and everyone else competes on price or niche coverage.

### The takeaway

TTS API design is harder than STT API design because the output space is larger and more subjective. That makes choosing a provider more nuanced. It also makes building on one more rewarding when the results are good. The craft matters in a way that it doesn't on the input side, and I find that motivating.

[← Newer: Voice AI mid-2026: the trends I am watching](/voice-ai-industry-thoughts-mid-2026)

[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)
