Opennan

Text to speech API

Live

Natural voiceovers in many voices and languages.

From $1.287 per 1M characters across 4 modelsCheapestKokoro
from $1.287/1M chars

Input

162 / 4,096
Format

162 chars

Output

Example
Example outputMade with this prompt

Heart

0:00 / 0:00

Compare Text to speech API models

Every model behind this endpoint, with live prices. Try one in the playground or open its page.

  • Kokorohexgrad$1.287 per 1M characters
    mp3 · wav · opus
    Page
  • Chatterbox TurboResemble AI$1.30 per 1M characters
    mp3 · wav · opus
    Page
  • Chatterbox MultilingualResemble AI$1.30 per 1M characters
    mp3 · wav · opus
    Page
  • Orpheus 3BCanopy Labs$9.10 per 1M characters
    mp3 · wav · opus
    Page

Call Text to speech API from your code

One endpoint for every model above. Change the model field to switch.

POSThttps://api.opennan.com/v1/audio/speech
  • GET/v1/models?category=voiceEvery model of this endpoint, with prices
  1. Get an API key

    Create a key in the console. It uses the same balance as the playground.

    Create a key
  2. Send your first request

    The same request the playground sends. Set OPENNAN_KEY to your key.

    curl https://api.opennan.com/v1/audio/speech \
      -H "Authorization: Bearer $OPENNAN_KEY" \
      -H "Content-Type: application/json" \
      -d '{"model":"kokoro","input":"Hello! This voice was made with one API call.","voice":"heart","response_format":"mp3"}' \
      --output speech.mp3
  3. Read the result

    The result comes back in the same response. The X-Usage-Cost-Usd header says what the call cost.

Parameters

Built from the live catalog: every value listed here is one the API accepts.

Parameters
NameTypeAllowed valuesDefaultEffect on price
modelrequiredWhich model runs the call.stringkokoro · chatterbox-turbo · chatterbox-multilingual · orpheus-3b——
inputrequiredThe text to speak.string1–4,096—Billed per character
voiceoptionalWhich voice reads the text.string———
response_formatoptionalAudio file format.stringmp3 · wav · opus——

Errors and how to fix them

  • 401Missing or wrong key

    Send the header Authorization: Bearer with a key from the console.

  • 402Balance too low

    Add credit in Billing, then send the same call again.

  • 400A value is not accepted

    Read error.message: it names the field. Use a value from the parameter table.

  • 429Too many requests

    Wait a few seconds and try again, waiting longer after each 429.

Add Opennan to your AI app

One install gives your AI every Opennan tool: video, images, chat, voice, music, sound effects, 3D, captions and dubbing. Pick your app and follow the steps.

MCP serverhttps://api.opennan.com/v1/mcp

Works in the Codex CLI, the Codex app and the Codex IDE extension: they share ~/.codex/config.toml. If the app or IDE does not see OPENNAN_KEY, use the config.toml option with your key in it. Codex asks before each tool call: approve it to go on.

  1. Get an API key

    Create a key in the console. It starts with sk- and uses the same balance as the website.

    Create a key
  2. Save your key as OPENNAN_KEY

    # macOS / Linux (zsh shown; bash: ~/.bashrc)
    echo 'export OPENNAN_KEY="sk-..."' >> ~/.zshrc
    source ~/.zshrc
    
    # Windows (PowerShell), then open a new terminal
    setx OPENNAN_KEY "sk-..."
  3. Install the Opennan plugin: the server plus a skill that teaches your AI to pick models, confirm prices and wait for results

    codex plugin marketplace add Opennan/opennan-ai-plugin
    codex plugin add opennan@opennan
  4. Or add only the server

    codex mcp add opennan --url https://api.opennan.com/v1/mcp --bearer-token-env-var OPENNAN_KEY
  5. Or add this to ~/.codex/config.toml

    [mcp_servers.opennan]
    url = "https://api.opennan.com/v1/mcp"
    http_headers = { Authorization = "Bearer sk-..." }
  6. Check that opennan is listed

    codex mcp list
  7. Restart Codex, then ask for anything

    “Make a 5 second video of rain on a neon street, a song to go with it and a poster image.”

Replace sk-... with your own key and keep it private: anyone who has it can spend your balance. Your app can list the tools before you add a key; making anything needs one.

This tool from your AI

Once Opennan is added, your AI calls this tool with arguments like these.

Tool
generate_speech
Example arguments
{
  "model": "kokoro",
  "input": "Hello! This voice was made with one API call.",
  "voice": "heart"
}

Text to speech API: questions

Every model and price
How much does Text to speech API cost?

From $1.287 per 1M characters with Kokoro, the cheapest of 4 models here. You see the price before you run.

How do I call it from my code?

Send POST https://api.opennan.com/v1/audio/speech with your API key. The result comes back in the same response.

Can I switch models without changing my code?

Yes. Change the model field and keep the rest of the request, the same key and the same balance.

Can my AI agent use it?

Yes. Add the MCP server https://api.opennan.com/v1/mcp and call the generate_speech tool, or point your agent at https://api.opennan.com/llms.txt.

What happens if a run fails?

A failed run is not charged. You pay only for results.

We only use the cookies the site needs, such as your language and a referral code. No ads. We count page visits with cookie-free analytics. See our Cookie Policy for details.