Home / API Reference

API Reference

Base URL https://api.sayitapi.com. Speech is powered by Grok TTS. Audio URLs expire after 24 hours.

Overview

Send text, receive a signed MP3 or WAV URL. Authenticate with the SAYIT-API-KEY header. Keys issued by SayIt start with sk_live_. There is no separate sandbox key.

Authentication

Every /v1 route except the payment webhooks and GET /v1/payments/config requires the header.

http
SAYIT-API-KEY: YOUR_API_KEY

POST /v1/tts

Synthesize one clip. Character balance is reduced by text.length.

bash
curl -X POST https://api.sayitapi.com/v1/tts \
  -H "SAYIT-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello","voice_id":"eve","language":"en","output_format":"mp3","speech_tags":true,"speed":1}

A completed response includes id, audio_url, characters_used, duration_seconds, voice_id, and created_at. When text is translated, translated and source_language are added. tts.complete webhooks fire for this route only, not for batch items.

Request builder

Pick a voice, language, and format, then copy a ready-to-run POST /v1/tts request. Every option below matches the parameter rules.

91 characters billed · fits demo, free, paid
output_format
bash
curl -X POST https://api.sayitapi.com/v1/tts \
  -H "SAYIT-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello from SayIt. <emphasis>This</emphasis> is my first clip. [pause] Thanks for listening!","voice_id":"eve","language":"en","output_format":"mp3","speed":1,"sample_rate":22050,"speech_tags":true}'

Snippets are generated in your browser; nothing is sent from this page. Replace YOUR_API_KEY (or set SAYIT_API_KEY) with the key from your dashboard. Running a snippet uses characters from your balance.

POST /v1/tts/batch

Paid keys only (batch size 50). Body is { "requests": [ { "text": "..." } ] }. The balance is reserved up front and failed items are refunded. Response is { "results": [...], "total": n }. Free and demo keys receive plan_required.

GET /v1/account

Returns email, plan (demo, free, or paid), key, chars_balance, chars_used, max_text_length, rpm, and batch_size.

bash
curl https://api.sayitapi.com/v1/account -H "SAYIT-API-KEY: YOUR_API_KEY"

GET /v1/account/usage

Characters per day for the last 30 UTC days, including zeros. { "days": [ { "date": "2026-10-23", "characters": 120 } ] }.

POST /v1/account/rotate

Issues an additional key. History, payments, and webhooks stay on the original key. By default the previous key keeps working for grace_hours (1–168, default 24). Send { "revoke": true } to invalidate the previous key immediately. Response: key, revoked, previous_key_valid_until. The route is available when key rotation is enabled.

GET /v1/history

Page of requests from the last 24 hours. Query page (10 per page). Response: requests, total, page, total_pages. Replay uses audio_url until it expires.

GET /v1/history/export returns CSV for paid keys. Other plans receive plan_required.

Webhooks

Paid keys can register HTTPS URLs. Private and loopback hosts are rejected. Events: tts.complete, usage.alert_80 (balance at or below 100,000 characters), usage.alert_100 (balance at zero).

  • GET /v1/webhooks lists id, url, events, active, created_at.
  • POST /v1/webhooks with url, optional secret, and events.
  • DELETE /v1/webhooks/:id returns { "deleted": true }.

If a secret is set, the raw JSON body is signed with HMAC-SHA256. The header is X-SayIt-Signature: sha256=<hex>.

javascript
const crypto = require("crypto");
function verify(rawBody, header, secret) {
  const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  const a = Buffer.from(expected);
  const b = Buffer.from(header || "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Payments

POST /v1/payments/create with { "pack": "basic" | "standard" | "premium" } returns { "invoice_url", "payment_id" } for a NOWPayments invoice. Packs: basic 1,000,000 / $25, standard 5,000,000 / $100, premium 20,000,000 / $360. The Sample pack is 200,000 characters for $5 and is card-only.

GET /v1/payments lists your payments. GET /v1/payments/:id returns status for the checkout page. Credits are added once, when the provider confirms the same order id.

Character packs are one-time cryptocurrency payments through NOWPayments. The $5 Sample pack (200,000 characters) is card-only and is unavailable while card payments are disabled.

Parameters

FieldRules
textRequired string. Demo 250, free 1,000, paid 10,000 characters.
voice_ideve, ara, rex, sal, leo. Default eve.
languageauto or one of the 57 codes below, including es, pt, and ar. Default auto. The request body is unchanged.
output_formatmp3 or wav. Both are accepted on every plan.
speedNumber from 0.5 to 2.0. The speech engine applies 0.7–1.5 and clamps values outside that range. Default 1.
sample_rate8000, 16000, 22050, or 44100. Default 22050.
speech_tagsBoolean. Tags are written inline in the text.

af, ar, hy, az, be, bs, bg, ca, zh, hr, cs, da, nl, en, et, fi, fr, gl, de, el, he, hi, hu, is, id, it, ja, kn, kk, ko, lv, lt, mk, ms, mr, mi, ne, no, fa, pl, pt, ro, ru, sr, sk, sl, es, sw, sv, tl, ta, th, tr, uk, ur, vi, cy

Translation into 57 languages. Native voice support for 20+: en, ar-EG, ar-SA, ar-AE, bn, zh, fr, de, hi, id, it, ja, ko, pt-BR, pt-PT, ru, es-MX, es-ES, tr, and vi. Plain es, pt, and ar map to es-ES, pt-BR, and ar-SA after translation. Any other accepted code is sent to the speech engine as auto.

Speech tags

Inline in text: <emphasis>, <whisper>, <soft>, [pause], [laugh].

Rate limits

Per API key, counted in a rolling one-minute window. A 429 includes a Retry-After header and retry_after in the body.

PlanReq/minConcurrent batch workersMax textBatch
demo51250No
free1011,000No
paid2001010,00050 items

The website demo (POST /api/tts) also limits each IP to 5 requests per minute. Sign-up is 5 requests per hour per IP, login is 10 per hour, code checks are 10 per 15 minutes, and at most 2 accounts can be created per IP per day. Requests time out after 120 seconds with HTTP 408.

Error codes

Errors use { "error": { "code", "message" } }. param is not returned.

CodeHTTPWhen
invalid_api_key401Missing or unknown key, or a revoked / expired rotated key.
invalid_request400Missing fields, bad pack, bad URL, speed, or format.
invalid_voice400voice_id is not eve, ara, rex, sal, or leo.
invalid_language400language is not in the supported set.
text_too_long400text is longer than the plan allows.
quota_exceeded402Character balance is too low for this request. Balance does not reset monthly.
plan_required403Batch, webhooks, or CSV export need a paid key.
email_taken409Sign-up email already has an account.
not_found404Unknown webhook, payment, or route.
rate_limit_exceeded429Per-key or auth rate limit. See Retry-After.
server_error500Synthesis, storage, or email send failed. Retry.

Questions: support@sayitapi.com