Meritlives Meritlives

Browse Sections

VoiceFlow API Documentation

Integrate ultra-realistic text-to-speech into your applications with our REST API. Powered by Microsoft Edge TTS for free, high-quality voice generation.

API Status: Operational Check health: GET /api/health
99.9%
Uptime SLA
<150ms
Avg Latency
v2.5
Latest Version
Base URL
https://api.voiceflow.com/v2

Local development

For local testing run the backend (default port 3000). Use the local API base URL below or, when the frontend proxies requests, the relative path /api/v2/text-to-speech.

Local (dev)
curl -X POST http://localhost:3000/api/v2/text-to-speech \
  -H "x-api-key: vf_sk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world!", "voice_id": "en-US-AriaNeural"}'

Authentication

API Key Authentication

All API requests require authentication using your API key. Include it in the x-api-key header.

!

Security Critical

Never expose your API key in client-side JavaScript, HTML, or public repositories. Always proxy requests through your backend server.

Correct: Server-side usage (Node.js)

Safe: API key in environment variable
const response = await fetch('https://api.voiceflow.com/v2/text-to-speech', {
  method: 'POST',
  headers: {
    'x-api-key': process.env.VOICEFLOW_API_KEY, // Server-side only
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ text: 'Hello', voice_id: 'en-US-AriaNeural' })
});

Never do this in frontend code:

headers: { 'x-api-key': 'vf_sk_123...' } // Exposed to all users!

Getting Your API Key

  1. Sign up for a VoiceFlow account
  2. Navigate to Dashboard -> Settings -> API Keys
  3. Click "Generate New Key"
  4. Copy and store securely in environment variables

Quickstart

cURL example
curl -X POST https://api.voiceflow.com/v2/text-to-speech \
  -H "x-api-key: $VOICEFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello world!", "voice_id": "en-US-AriaNeural"}'

Text to Speech

POST /v2/text-to-speech

Generate natural-sounding speech from text input.

Request Body Parameters

Parameter Type Required Default Description
textstringYes-Text to convert (max 5000 chars)
voice_idstringYes-Voice ID (e.g., en-US-AriaNeural)
modelstringNomultilingual_v2multilingual_v2, flash_v2.5, v3_alpha
stabilityfloatNo0.5Voice stability (0.0 - 1.0)

Response (200 OK)

{
  "success": true,
  "generation": {
    "id": "gen_abc123",
    "audio_url": "/audio/tts_abc123.mp3",
    "duration": 2.5,
    "credits_used": 25,
    "credits_remaining": 9975
  }
}

Voices

GET /v2/voices

Retrieve available voices for text-to-speech generation.

Query Parameters

Parameter Type Description
languagestringFilter by language (e.g., en-US, es-ES, fr-FR)
genderstringFilter: male, female

Models

GET /v2/models
Model IDLanguagesQualityLatency
multilingual_v270High~500ms
flash_v2.532High<200ms
v3_alpha70Ultra~800ms

History

GET /v2/history

Get your generation history, sorted by newest first.

DELETE /v2/history/:id

Delete a specific generation by its ID.

SDKs & Libraries

PY

Python SDK

Official Python client for VoiceFlow.

pip install voiceflow-sdk
JS

Node.js SDK

JavaScript/TypeScript client.

npm install @voiceflow/sdk

Rate Limits

PlanRequests/minCredits/monthMax text length
Free3010,000500 chars
Starter6030,0002,000 chars
Creator120100,0005,000 chars
Pro300500,0005,000 chars
Note: rate limit headers are included in responses: X-RateLimit-Remaining, X-RateLimit-Reset

Error Codes

CodeMeaning
400Bad request - missing required parameters
401Unauthorized - invalid or missing API key
402Payment required - insufficient credits
429Too many requests - rate limit exceeded
500Internal server error - try again later

API Playground

Test the API directly from your browser. Your API key is only used for this request and not stored.