Skip to main content
Lesson 7 of 14 · Text-to-Speech API

Combine expressive tags

Lesson 7 of 14 Updated July 30, 2026 Developer
On this page
  1. Create rich, natural-sounding speech
  2. Combination principles
  3. Recipes by type of content
  4. Common mistakes to avoid
  5. Impact on billing
  6. Key takeaways

Create rich, natural-sounding speech

The expressive tags of the Grok TTS API show their full power when you combine them. By mixing inline and wrapping tags, you can produce speech that rivals a professional human reading.

Combination principles

Inline tags inside a wrapping tag

You can insert inline [tag] tags inside wrapping <tag> tags. It’s the most common combination:

<soft>I'm going to tell you something. [pause] Listen closely. [breath] It was a Tuesday night...</soft>

The inline tags produce their one-off effects (a pause, a breath) while the wrapping style stays in place (a soft voice, in this example).

Nested wrapping tags

You can nest several wrapping tags to stack their effects:

<slow><soft>This passage is spoken softly and slowly.</soft></slow>

The effects combine: the voice is both soft and slow. Stick to two or three levels of nesting to avoid unpredictable results.

Alternating styles

Real naturalness comes from alternating between styles within the same text:

Here are the quarterly results. [pause]
<emphasis>Revenue grew by 23%.</emphasis> [pause]
<soft>That's an all-time record for the company.</soft> [long-pause]
<loud>And we're not stopping there!</loud> [laugh]

Recipes by type of content

Narrative podcast

An effective podcast alternates between normal narration, intimate passages, and moments of emphasis:

{
  "text": "[breath] <soft>Welcome to a new episode of our podcast.</soft> [long-pause] Today, we're tackling a topic that's especially close to my heart. [pause] <emphasis>AI speech synthesis.</emphasis> [pause] <soft>Just five years ago, nobody would have imagined this level of quality.</soft> [chuckle] And yet, here we are. [breath] <slow>Let's start at the beginning.</slow>",
  "voice_id": "ara",
  "language": "en"
}

Technical tutorial

For a tutorial, alternate between normal explanation and slowed-down instructions:

{
  "text": "[breath] In this step, you'll set up your environment. [pause] <slow>Open your terminal and type the following command.</slow> [long-pause] <emphasis>Careful, the order of the parameters matters.</emphasis> [pause] If you get an error, <soft>don't panic</soft>, just check your API key.",
  "voice_id": "rex",
  "language": "en"
}

Promotional announcement

An announcement needs energy, with emphasis on the selling points:

{
  "text": "<loud>Discover our new offer!</loud> [pause] Corsen Academy brings you <emphasis>free courses</emphasis> to master artificial intelligence. [pause] <fast>No commitment, instant access.</fast> [pause] <slow><emphasis>Start learning today.</emphasis></slow>",
  "voice_id": "eve",
  "language": "en"
}

Common mistakes to avoid

Too many tags

Too many tags make speech choppy and artificial:

<!-- Overloaded -->
[breath] <emphasis>Hello</emphasis> [pause] <soft>to</soft> [pause] <loud>everyone!</loud>

<!-- Better -->
[breath] Hello, everyone! [pause]

Aim for one wrapping tag every two or three sentences, and one inline tag every sentence or two.

Invalid overlaps

Wrapping tags must be nested correctly:

<!-- Invalid -->
<soft>Start <loud>middle</soft> end</loud>

<!-- Valid -->
<soft>Start</soft> <loud>middle and end</loud>

Forgetting the closing tag

Every wrapping tag you open must be closed. An unclosed tag can produce unpredictable results across the rest of the text:

<!-- Problematic -->
<whisper>This passage is whispered, but the tag is never closed...

<!-- Correct -->
<whisper>This passage is whispered.</whisper> And this one is normal.

Impact on billing

Tags count toward the character total. For a text with 1,000 characters of actual content:

  • No tags: 1,000 characters billed
  • Moderate tagging: about 1,050 to 1,100 characters billed (+5 to 10%)
  • Heavy tagging: about 1,150 to 1,200 characters billed (+15 to 20%)

The impact on your bill stays marginal. Don’t sacrifice quality to save a few characters of tags.

Key takeaways

  • Combine inline and wrapping tags for a natural result
  • Alternate styles rather than overloading a single passage
  • Limit nesting to two or three levels
  • Follow LIFO order for wrapping tags
  • Aim for balance: too many tags hurt fluency
  • The impact of tags on billing is marginal (+5 to 20%)