REST API · Live

Voice Cloning API vs ElevenLabs

A production REST API for text-to-speech and zero-shot voice cloning. Send text and an optional 5–20 second reference clip — get back a WAV that sounds like the target speaker. The voice cloning API vs ElevenLabs comparison is simple: same $0.04 per 1,000 characters, but PixelAPI gives you 300 free credits with no credit card, 23 languages including Hindi, Arabic, and Chinese, and a clean polling API with no subscription required.

$0.04 / 1K chars Zero-shot voice cloning 23 languages 300 free credits No credit card WAV output
Get an API key (free) Quick start See pricing API docs

Quick start — one API call

Sign up, copy your key from the dashboard, and POST your text. For voice cloning, attach a reference audio file. The endpoint queues the job and returns a generation_id; poll GET /v1/tts/status/{id} until status=completed, then download the WAV from output_url.

Character limit: 400 characters per request. Split longer scripts into segments and fire them in parallel — each returns its own generation_id.

# Basic TTS
curl -X POST https://api.pixelapi.dev/v1/tts/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "text=Hello, this is a test of the text to speech API." \
  -F "language=en"
# Response: {"generation_id": "uuid", "status": "queued"}

# Voice cloning — add reference audio
curl -X POST https://api.pixelapi.dev/v1/tts/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "text=This output will match the reference voice." \
  -F "language=en" \
  -F "voice_ref=@speaker_sample.wav"

# Poll until done
curl https://api.pixelapi.dev/v1/tts/status/UUID \
  -H "Authorization: Bearer YOUR_API_KEY"
# Response: {"status": "completed", "output_url": "https://..."}
pip install pixelapi
---
import requests, time

API_KEY = "YOUR_API_KEY"
BASE = "https://api.pixelapi.dev"

# Basic TTS
r = requests.post(f"{BASE}/v1/tts/generate",
    headers={"Authorization": f"Bearer {API_KEY}"},
    data={"text": "Hello from the TTS API.", "language": "en"})
job_id = r.json()["generation_id"]

# Voice cloning — attach a reference clip
with open("speaker.wav", "rb") as f:
    r = requests.post(f"{BASE}/v1/tts/generate",
        headers={"Authorization": f"Bearer {API_KEY}"},
        data={"text": "Cloned voice output here.", "language": "en"},
        files={"voice_ref": ("speaker.wav", f, "audio/wav")})
job_id = r.json()["generation_id"]

# Poll until completed
while True:
    r = requests.get(f"{BASE}/v1/tts/status/{job_id}",
        headers={"Authorization": f"Bearer {API_KEY}"})
    if r.json()["status"] == "completed":
        audio = requests.get(r.json()["output_url"]).content
        open("output.wav", "wb").write(audio)
        break
    time.sleep(2)
npm install pixelapi
---
import FormData from "form-data";
import fetch from "node-fetch";
import fs from "fs";

const apiKey = process.env.PIXELAPI_KEY;
const base = "https://api.pixelapi.dev";

// Basic TTS
const form = new FormData();
form.append("text", "Hello from the voice cloning API.");
form.append("language", "en");
const res = await fetch(`${base}/v1/tts/generate`, {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}`, ...form.getHeaders() },
  body: form,
});
let { generation_id } = await res.json();

// Voice cloning — attach reference audio
const form2 = new FormData();
form2.append("text", "This sounds like the reference speaker.");
form2.append("language", "en");
form2.append("voice_ref", fs.createReadStream("speaker.wav"), "speaker.wav");
const res2 = await fetch(`${base}/v1/tts/generate`, {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}`, ...form2.getHeaders() },
  body: form2,
});
generation_id = (await res2.json()).generation_id;

// Poll for result
let result;
do {
  await new Promise(r => setTimeout(r, 2000));
  result = await fetch(`${base}/v1/tts/status/${generation_id}`,
    { headers: { Authorization: `Bearer ${apiKey}` } }).then(r => r.json());
} while (result.status !== "completed");
fs.writeFileSync("output.wav",
  Buffer.from(await fetch(result.output_url).then(r => r.arrayBuffer())));
composer require pixelapi/pixelapi
---
<?php
$apiKey = getenv("PIXELAPI_KEY");
$base   = "https://api.pixelapi.dev";

// Basic TTS
$ch = curl_init("$base/v1/tts/generate");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"],
  CURLOPT_POSTFIELDS => ["text" => "Hello from TTS.", "language" => "en"],
]);
$resp  = json_decode(curl_exec($ch), true);
$jobId = $resp["generation_id"];
curl_close($ch);

// Poll until done
do {
    sleep(2);
    $ch2 = curl_init("$base/v1/tts/status/$jobId");
    curl_setopt_array($ch2, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => ["Authorization: Bearer $apiKey"],
    ]);
    $result = json_decode(curl_exec($ch2), true);
    curl_close($ch2);
} while ($result["status"] !== "completed");
file_put_contents("output.wav", file_get_contents($result["output_url"]));
gem install pixelapi
---
require "net/http"
require "json"

api_key = ENV["PIXELAPI_KEY"]
base    = "https://api.pixelapi.dev"

# Basic TTS
uri = URI("#{base}/v1/tts/generate")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{api_key}"
req.set_form([["text", "Hello from TTS."], ["language", "en"]], "multipart/form-data")
res    = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
job_id = JSON.parse(res.body)["generation_id"]

# Poll until completed
loop do
  sleep 2
  uri2 = URI("#{base}/v1/tts/status/#{job_id}")
  req2 = Net::HTTP::Get.new(uri2, "Authorization" => "Bearer #{api_key}")
  result = JSON.parse(Net::HTTP.start(uri2.hostname, uri2.port, use_ssl: true) { |h| h.request(req2) }.body)
  if result["status"] == "completed"
    File.binwrite("output.wav", URI.open(result["output_url"]).read)
    break
  end
end
go get github.com/pixelapi/pixelapi-go
---
package main

import (
    "bytes"; "encoding/json"; "fmt"; "io"
    "mime/multipart"; "net/http"; "os"; "time"
)

func main() {
    apiKey := os.Getenv("PIXELAPI_KEY")
    base   := "https://api.pixelapi.dev"

    var buf bytes.Buffer
    w := multipart.NewWriter(&buf)
    w.WriteField("text", "Hello from the TTS API.")
    w.WriteField("language", "en")
    w.Close()

    req, _ := http.NewRequest("POST", base+"/v1/tts/generate", &buf)
    req.Header.Set("Authorization", "Bearer "+apiKey)
    req.Header.Set("Content-Type", w.FormDataContentType())
    resp, _ := http.DefaultClient.Do(req)
    var job struct{ GenerationID string `json:"generation_id"` }
    json.NewDecoder(resp.Body).Decode(&job)
    resp.Body.Close()

    for {
        time.Sleep(2 * time.Second)
        req2, _ := http.NewRequest("GET", base+"/v1/tts/status/"+job.GenerationID, nil)
        req2.Header.Set("Authorization", "Bearer "+apiKey)
        r2, _ := http.DefaultClient.Do(req2)
        var result struct {
            Status    string `json:"status"`
            OutputURL string `json:"output_url"`
        }
        json.NewDecoder(r2.Body).Decode(&result)
        r2.Body.Close()
        if result.Status == "completed" {
            resp3, _ := http.Get(result.OutputURL)
            data, _ := io.ReadAll(resp3.Body)
            os.WriteFile("output.wav", data, 0644)
            fmt.Println("Saved output.wav")
            break
        }
    }
}

Voice Cloning API Pricing vs ElevenLabs, play.ht, murf.ai, OpenAI TTS

ProviderFree tierPer 1,000 charsVoice cloningLanguages
PixelAPI 300 credits, no card $0.04 ✓ Zero-shot 23
ElevenLabs Flash 10K chars/mo $0.04 ✓ Yes 30+
play.ht Limited free plan see play.ht/pricing ✓ Yes 20+
murf.ai 10 min/mo (web app) see murf.ai/pricing Limited API access 20+
OpenAI TTS None see openai.com/pricing ✗ Not supported Limited

ElevenLabs Flash price verified from elevenlabs.io/pricing/api (November 2026). For play.ht, murf.ai, and OpenAI TTS, prices change frequently — check their pricing pages directly. OpenAI TTS does not support voice cloning from a reference clip.

What you get back

WAV audio file

The output is a standard uncompressed WAV file, ready for video editors, podcast platforms, game engines, IVR systems, and audiobook software. Download via the output_url in the status response.

Zero-shot voice clone

Supply a 5–20 second reference clip (WAV/MP3/M4A, under 10 MB) and the output speech matches the speaker's voice — no training, no registration, no wait. Works in all 23 supported languages.

23-language support

English uses a fast single-language model. Other languages — Arabic, Hindi, Japanese, Chinese, German, French, Spanish, Portuguese, Russian, and 13 more — are handled by the multilingual model, selected automatically.

Async polling API

POST returns a generation_id immediately. Poll GET /v1/tts/status/{id} on your schedule. Fire multiple segments in parallel and collect results independently — no blocking, no timeouts.

Common workflows

The voice cloning API powers production use cases across audiobook production, podcasting, IVR systems, and language learning platforms. See related guides:

Voice Cloning API

Zero-shot voice cloning from a reference clip. Setup guide, pricing, and code.

Free TTS API

Get started without a credit card. 300 free credits, no limits on language or voice.

TTS API vs ElevenLabs

Side-by-side feature and pricing comparison for general TTS use cases.

vs OpenAI TTS

Detailed comparison with OpenAI's TTS endpoint — cost, languages, voice cloning support.

Sound Effects API

Complement TTS with generated ambient audio and sound effects in the same pipeline.

Music Generator API

Add background music to narrated content. Instrumental generation API.

Integrations

Connect the TTS API to your existing automation stack:

Make.com

No-code audio workflow: trigger TTS generation from Google Sheets, Notion, or any app.

Zapier

One-click Zap for TTS — convert text from any source to audio automatically.

Next.js

Server-side TTS generation with streaming delivery for React/Next.js apps.

Shopify

Auto-generate audio product descriptions on new inventory uploads.

WooCommerce

WordPress plugin pattern for batch audio product page generation.

Webflow

Automate audio content for Webflow CMS collections via API.

Comparison vs alternatives

vs ElevenLabs (TTS)

Same per-character rate for API access. PixelAPI has no subscription requirement and no web app lock-in.

vs OpenAI TTS

OpenAI TTS does not support voice cloning. Compare pricing and language support.

vs play.ht

Per-character vs subscription pricing. Detailed feature breakdown for API users.

Free TTS API comparison

Which TTS APIs have a genuine free tier? What you actually get without a credit card.

Rate limits & error handling

20 requests/minute on the free trial, 60 on Starter, 120 on Pro, and 300 on Scale, with 3/10/20/50 concurrent jobs respectively. Exceeding the limit returns HTTP 429 with a Retry-After header. Recommended backoff: start at 2 seconds, double on each retry up to 30 seconds. The Python and Node SDKs handle this automatically.

Common error codes and what they mean:

HTTP StatusCodeMeaning
400text_too_longText exceeds 400 characters — split into shorter segments.
400unsupported_languageLanguage code not in the supported list (see 23 codes above).
400ref_too_shortReference audio is under 5 seconds or empty — upload a longer clip.
400ref_too_largeReference audio exceeds 10 MB — compress or trim the clip.
402insufficient_creditsOut of credits — top up at pixelapi.dev/pricing.
429rate_limit_exceededToo many requests — back off and retry after the Retry-After value.
503no_live_workerService briefly warming up — retry in ~60 seconds. You are not charged.
# Python — auto-retry on 429
import requests, time

def tts_with_retry(text, api_key, retries=4):
    delay = 2
    for attempt in range(retries):
        r = requests.post(
            "https://api.pixelapi.dev/v1/tts/generate",
            headers={"Authorization": f"Bearer {api_key}"},
            data={"text": text, "language": "en"})
        if r.status_code == 429:
            time.sleep(delay)
            delay = min(delay * 2, 30)
            continue
        r.raise_for_status()
        return r.json()["generation_id"]
    raise RuntimeError("Rate limit persisted after retries")

Frequently asked questions

How does the PixelAPI voice cloning API compare to ElevenLabs?

Both PixelAPI and ElevenLabs Flash charge $0.04 per 1,000 characters for API access with voice cloning. PixelAPI gives new accounts 300 free credits with no credit card required, supports 23 languages including Hindi, Arabic, Japanese and Chinese, and returns WAV files via a standard REST polling API. ElevenLabs has a broader pre-built voice library and a consumer web app; PixelAPI focuses on the developer API with predictable per-character billing and no subscription required.

What does the voice cloning API cost?

$0.04 per 1,000 characters — the same per-character rate as ElevenLabs Flash/Turbo. Minimum charge is 1 credit ($0.001) per request. New accounts get 300 free credits (enough for ~7,500 characters of TTS), with no credit card required.

How do I clone a voice with the API?

POST to https://api.pixelapi.dev/v1/tts/generate with your text and a voice_ref audio file (5–20 seconds of clean speech, WAV/MP3/M4A, under 10 MB). The API clones the voice zero-shot — no training step, no pre-registration. Poll GET /v1/tts/status/{id} until status=completed, then download the WAV from output_url. See the Quick Start section for code in 6 languages.

What languages are supported?

23 languages: Arabic, Danish, German, Greek, English, Spanish, Finnish, French, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Dutch, Norwegian, Polish, Portuguese, Russian, Swedish, Swahili, Turkish, and Chinese. English uses a fast single-language model; all other languages use the multilingual model, selected automatically based on the language parameter.

What audio format does the API return?

The output is a standard WAV file, available via a temporary output_url in the status response. Download within 24 hours. WAV is uncompressed and works directly in video editors, podcast software, audiobook platforms, game engines, and telephony/IVR systems without conversion.

Is there a character limit per request?

Each request accepts up to 400 characters. For longer scripts, split the text into 400-character segments and call the endpoint multiple times. You can fire multiple requests in parallel — the API returns a generation_id per request which you poll independently. The Python and Node SDKs include a split_and_generate helper that handles splitting and parallel submission automatically.

What reference audio do I need for voice cloning?

Upload a WAV, MP3, or M4A file between 5 and 20 seconds of clear speech from the target speaker, under 10 MB. Background noise degrades quality — a clean recording in a quiet room gives the best results. You must have the speaker's explicit consent before cloning their voice. Images, PDFs, and video files will be rejected with a 400 error.

Is there a Python SDK?

Yes — pip install pixelapi. Official SDKs are also available for Node.js (npm install pixelapi), PHP (Composer), Ruby (Gem), and Go (go get). All SDKs handle authentication, multipart form upload, polling, and retry-on-429 with exponential backoff automatically.

What are the rate limits?

20 requests/minute on the free trial, 60 on Starter, 120 on Pro, and 300 on Scale, with 3/10/20/50 concurrent jobs respectively. HTTP 429 is returned with a Retry-After header when you exceed the limit. The Python and Node SDKs handle retries with exponential backoff automatically. Need higher limits for batch processing? Email support@pixelapi.dev with your expected volume.

Can I use PixelAPI TTS for IVR or telephony?

Yes. The WAV output works directly with Twilio, Vonage, Amazon Connect, and similar platforms. For low-latency IVR, keep each text segment under 100 characters to reduce generation time. Multiple segments can be pre-generated in parallel and cached on your CDN for instant playback at call time.

Do I need a subscription to use the API?

No subscription required to start. New accounts get 300 free credits with no credit card — enough to test around 7,500 characters of TTS. After the free trial, top-up credit packs start at $10 for 10,000 credits. There is no mandatory monthly subscription; you pay only for what you use.

Start free — 300 credits, no card Read full API docs Compare all plans