TTS API

tokenflow-tts-1

Generate speech from text using preset or described voices.

InputUp to 4,000 characters / request
Pricing$1.00 / audio hour
Default organization cap20 billed hours / month

Try it in the console playground — you sign in first, and it uses your organization’s quota.

Quickstart

Set TOKENFLOW_API_KEY privately in your shell. This page never asks for your key or runs a request.

Speech synthesis

POST /v1/audio/speech · application/json

curl · writes speech.mp3
curl --fail-with-body 'https://api.tokenflow.dev/v1/audio/speech' \
  -H "Authorization: Bearer $TOKENFLOW_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "tokenflow-tts-1",
  "input": "你好,欢迎使用语音服务。",
  "voice": "zh-female-calm"
}' \
  --output speech.mp3

  • Input and instructions must contain non-whitespace text.
  • Choose voice or instructions, never both. Instructions cannot contain parentheses.
  • Formats as OpenAI names them: mp3 (default), opus, aac, flac, wav, pcm. pcm is 24 kHz 16-bit little-endian mono, streamed or not. Streaming takes pcm (default) or opus.
  • Every audio response names its origin in the x-aigc-label header; mp3, aac, opus, flac and wav also carry it in the file. Keep it when you store or pass audio on.
  • No cloning from your own recordings. Disclose AI speech and preserve origin metadata.

Parameters & limits

Input text
Up to 4,000 characters
Voice description
Up to 200 characters; use voice or instructions, never both
Voice IDs
Chinese / calm female preset: zh-female-calm; Chinese / warm male preset: zh-male-warm; English / clear female preset: en-female-clear; Chinese / Sun Wukong, licensed recording: zh-sunwukong; English (US) / warm, gentle female, designed voice: en-female-warm-us; English (US) / sweet, playful female, designed voice: en-female-sweet-us; English (US) / rich, mature female, designed voice: en-female-mature-us; English (US South) / soft drawl female, designed voice: en-female-southern-us; English (US) / hushed, soft-spoken female, designed voice: en-female-bedtime-us; English (UK) / calm, soothing female, designed voice: en-female-soft-uk; English (UK, RP) / crisp, elegant female, designed voice: en-female-posh-uk; English (Irish) / lilting, lively female, designed voice: en-female-lilt-ie; English (Australian) / bright, cheerful female, designed voice: en-female-bright-au; English (Australian) / low, mellow female, designed voice: en-female-mellow-au
Output
MP3 by default; opus, aac, flac, wav or pcm (24 kHz 16-bit). Streaming: pcm or opus
Request size
64 KiB
Voice cloning
Cloning from your own recordings is not offered

Read the speech guide →

Pricing & usage

$1.00 / audio hour

We bill the audio we send you, by the 0.1 s, at least 1 second per request. It is held between two-thirds and twice what the text should take to say, so slow or silent output never costs more than double. A stream you stop is billed for the audio already sent; failed requests and empty audio are free. Voice instructions make no audio and cost nothing.

Default monthly cap
20 billed hours / month
Concurrent requests
4 per organization; 8 across external organizations

All keys share the organization’s UTC-month allowance. An administrator can change it. These are default caps, not your remaining quota or free credits.

Reference price checked 2026-11-18. Your customer agreement governs settlement.

Quota errors and retry guidance →

View the machine-readable contract

Published specification only. Inspect the discovery API for runtime observations; discovery does not reserve capacity.

{
  "id": "tokenflow-tts-1",
  "kind": "tts",
  "summary": "Generate speech from text using preset or described voices.",
  "tags": [
    "audio",
    "synthesis",
    "语音合成",
    "朗读"
  ],
  "protocols": [
    {
      "id": "speech",
      "method": "POST",
      "path": "/v1/audio/speech",
      "content_type": "application/json",
      "modes": [
        "mp3",
        "opus",
        "aac",
        "flac",
        "wav",
        "pcm",
        "stream_pcm",
        "stream_opus"
      ],
      "schema_scope": "complete_fields",
      "input_schema": {
        "type": "object",
        "properties": {
          "model": {
            "const": "tokenflow-tts-1"
          },
          "input": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "voice": {
            "type": "string",
            "enum": [
              "zh-female-calm",
              "zh-male-warm",
              "en-female-clear",
              "zh-sunwukong",
              "en-female-warm-us",
              "en-female-sweet-us",
              "en-female-mature-us",
              "en-female-southern-us",
              "en-female-bedtime-us",
              "en-female-soft-uk",
              "en-female-posh-uk",
              "en-female-lilt-ie",
              "en-female-bright-au",
              "en-female-mellow-au"
            ]
          },
          "instructions": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "pattern": "^[^()()]+$"
          },
          "response_format": {
            "enum": [
              "mp3",
              "opus",
              "aac",
              "flac",
              "wav",
              "pcm"
            ],
            "default": "mp3"
          },
          "stream": {
            "type": "boolean"
          },
          "seed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2147483647
          },
          "speed": {
            "type": "number",
            "minimum": 0.75,
            "maximum": 1.5,
            "default": 1
          }
        },
        "required": [
          "model",
          "input"
        ],
        "additionalProperties": false,
        "not": {
          "required": [
            "voice",
            "instructions"
          ]
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "stream": {
                  "const": true
                }
              },
              "required": [
                "stream"
              ]
            },
            "then": {
              "properties": {
                "response_format": {
                  "enum": [
                    "pcm",
                    "opus"
                  ]
                }
              }
            }
          }
        ]
      },
      "constraints": [
        "Input and instructions must contain non-whitespace text.",
        "Choose voice or instructions, never both. Instructions cannot contain parentheses.",
        "Formats as OpenAI names them: mp3 (default), opus, aac, flac, wav, pcm. pcm is 24 kHz 16-bit little-endian mono, streamed or not. Streaming takes pcm (default) or opus.",
        "Every audio response names its origin in the x-aigc-label header; mp3, aac, opus, flac and wav also carry it in the file. Keep it when you store or pass audio on.",
        "No cloning from your own recordings. Disclose AI speech and preserve origin metadata."
      ],
      "example": {
        "model": "tokenflow-tts-1",
        "input": "你好,欢迎使用语音服务。",
        "voice": "zh-female-calm"
      }
    }
  ],
  "guaranteed": {
    "max_input_characters": 4000,
    "max_instructions_characters": 200,
    "max_request_bytes": 65536,
    "voices": [
      "zh-female-calm",
      "zh-male-warm",
      "en-female-clear",
      "zh-sunwukong",
      "en-female-warm-us",
      "en-female-sweet-us",
      "en-female-mature-us",
      "en-female-southern-us",
      "en-female-bedtime-us",
      "en-female-soft-uk",
      "en-female-posh-uk",
      "en-female-lilt-ie",
      "en-female-bright-au",
      "en-female-mellow-au"
    ]
  },
  "documented": {
    "guide": "https://tokenflow.dev/speech",
    "limits": [
      "Text-based voice design; no cloning from your own audio."
    ]
  },
  "billing": {
    "meter": "tts_audio_ms",
    "minimum_billed_units": 1000,
    "measured": "delivered_audio_ms",
    "pricing": {
      "meter": "tts_audio_ms",
      "usd_per_hour": 1,
      "unit": "audio_hour",
      "status": "open",
      "currency": "USD",
      "checked_at": "2026-11-18",
      "settlement": "customer_agreement"
    }
  },
  "external_limits": {
    "concurrency": {
      "perTenant": 4,
      "external": 8,
      "retryAfterS": 5
    },
    "default_monthly": {
      "limit": 72000000,
      "unit": "tts_audio_ms"
    },
    "quota_is_not_free_credit": true
  },
  "schema_version": 1,
  "publication": "public",
  "next": [
    {
      "method": "POST",
      "path": "/v1/audio/speech",
      "content_type": "application/json",
      "body": {
        "model": "tokenflow-tts-1",
        "input": "你好,欢迎使用语音服务。",
        "voice": "zh-female-calm"
      }
    }
  ]
}

For developers and agents

Choose your way in

Human guides and machine-readable contracts describe the same APIs.

Need runtime observations? Use the public discovery API. Tenant access and quotas require your API key.

Published contract updated 2 November 2026. Terms · Data policy · All capabilities