Signup comes with $1 in credit. No subscription needed.Claim your $1

Tools / AI creative / API

Generate a voiceover from a Python script, with word timings for captions

From Python this is one requests.post to the RouterGrowth run endpoint: capability creative.speech and your script as input. Read audio.url and download the file. Set timestamps to true and the same result lists each word with its start and end, which is what captions need. No SDK to install beyond an HTTP client.

Real run: 1 record $0.0875 per 1k characters creative.speech MCP · REST · CLI

Ask your agent

Write me a Python script that voices each line of this text file with creative.speech and saves one MP3 per line.

Connect RouterGrowth once, then ask in plain words. New workspaces start with $1 of credit. Get a key or read the setup guide.

A real run

What does it return?

One call to creative.speech (voiceover), run through RouterGrowth on November 2, 2026. These are the first rows it returned; fields that name a person are masked.

1records returned
1.2 sto answer
$0.02charged for the run
voicecharactersfile_sizetimingslast_word_end
Daniel2002324293914.303

A 200 character weekly update returned an MP3 and 39 word timings ending at 14.3 seconds; one word came back split in two, table as tabl and e, so captions need a cleanup pass.

Step by step

How do you do it?

  1. Keep the key out of the code

    Read the RouterGrowth key from an environment variable and send it as a Bearer header.

  2. POST the script

    Body: capability creative.speech, input with text, voice, model and timestamps. requests or httpx both work.

  3. Download the audio

    Read result.audio.url and save the bytes to disk straight away, since the URL is temporary.

  4. Build captions

    Loop over result.timestamps, each with word, start and end, and group them into caption lines.

Price

What does it cost?

List prices on this call, read from the catalog when this page was built. The exact figure is quoted before every run, and a monthly plan lowers it.

$0.0875per 1k characters
No seatand no monthly plan needed
$0when the call finds nothing

In practice

What do you ask it?

You describe the job; the agent picks the calls, shows the price and runs them.

Write me a Python script that voices each line of this text file with creative.speech and saves one MP3 per line.

Voice this script with timestamps on and turn the word timings into an SRT caption file.

Connect

How do you connect it?

One MCP server for Claude, ChatGPT, Claude Code, Codex and Cursor, or the same call over the CLI and REST with the input above.

MCP server
claude mcp add --transport http routergrowth https://api.routergrowth.com/mcp
CLI
npm install -g routergrowth && routergrowth setup
routergrowth run -c creative.speech -i '{"text": "Welcome back to the weekly numbers. Signups rose a little, churn stayed flat, and support tickets fell for the third week in a row. The full table is in the notes, and the next update lands on Monday.", "voice": "Daniel", "model": "eleven-turbo", "timestamps": true}'
REST
curl -X POST https://api.routergrowth.com/v1/run \
  -H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
  -d '{"capability": "creative.speech", "input": {"text": "Welcome back to the weekly numbers. Signups rose a little, churn stayed flat, and support tickets fell for the third week in a row. The full table is in the notes, and the next update lands on Monday.", "voice": "Daniel", "model": "eleven-turbo", "timestamps": true}}'

Worth knowing

What should you know first?

Merge split words

In this run one word came back as two timing entries. Compare against your script when you build captions.

Long scripts need chunks

Each call takes up to 5,000 characters, so a loop has to split on sentence ends and join the audio.

Timestamps are opt in

They are off by default. Without them the result holds the audio and the character count only.

FAQ

Questions about text to speech api python

Is there a Python package to install?

None is needed. The API takes JSON, so any HTTP client works.

Does it stream audio?

The result gives a URL to a finished file. Streaming is not part of this call.

Can I voice many lines in one script?

Each call is its own run, so a loop can send one per line. Budget for the total characters, since the charge follows length.

Which voice names can I pass?

The ones the catalog lists, such as Daniel, Aria, George or Lily. Omit voice for the model's default.

More on AI creative

Related pages

Reading this as an agent? This page as markdown: /tools/ai-creative/text-to-speech-api-python.md

One key. Every network.

Connect your agent once. The first calls run on the $1 that comes with signup.