Skip to content
Toolscase Voice Studio

Developers

Voice Studio API

One REST API for text to speech and speech to text. Available on Pro and Business plans.

Overview

Base URL: https://voice.toolscase.com/api/v1. All requests and responses are JSON (except file uploads and exports). The web app uses these same endpoints, so anything you can do in the studio you can automate. New to the API? Start with the quickstart.

Authentication

Create a key in Settings → API (Pro and Business). Keys look like vs_live_…, are shown once, and are bound to one workspace. Send it as a Bearer token:

curl https://voice.toolscase.com/api/v1/usage \
  -H "Authorization: Bearer vs_live_xxxxxxxxxxxxxxxx"

Keep keys server-side. Revoke a leaked key immediately from the same settings page.

Responses and errors

A single resource is wrapped as { "data": { … } }. Lists are { "data": [ … ], "meta": { "page", "per_page", "total", "last_page" } }. Errors always look like:

{ "error": { "code": "quota_exceeded", "message": "You've used your 200,000 characters this month.",
               "meter": "tts_chars", "used": 200000, "limit": 200000,
               "upgrade_url": "https://voice.toolscase.com/pricing", "topup_available": false } }
HTTPcodeMeaning
401unauthenticatedMissing or invalid API key.
403forbiddenThe key's workspace can't access this resource, or the plan doesn't include the API.
402plan_requiredFeature needs a higher plan. Extra: required_plan, feature, upgrade_url.
402quota_exceededMonthly allowance used up. Extra: meter, used, limit, upgrade_url, topup_available.
409job_runningToo many jobs running for your plan's concurrency limit.
422validation_failedInvalid input. Extra: fields {name: [messages]}.
429rate_limitedSlow down. Extra: retry_after (seconds); also sent as a Retry-After header.

Limits

  • Concurrency: Pro runs 3 jobs at once, Business 5. Extra jobs queue; exceeding hard limits returns 409 job_running.
  • Per-job size: 200,000 characters (Pro) or 500,000 (Business) per text-to-speech job.
  • Rate limits: requests are rate-limited per key and IP. On 429, wait retry_after seconds before retrying. Use webhooks instead of tight polling loops.
  • Quotas: API usage counts against the same monthly allowances as the web app.

Voices

GET /voices

List voices. Filters: language, accent, gender, age, style, tier, favorites=1, q. Filter values with no voices are omitted from meta.filters.

curl "https://voice.toolscase.com/api/v1/voices?language=en-GB" \
  -H "Authorization: Bearer $VS_KEY"
{
  "data": [{
    "id": "bf_emma", "name": "Emma", "engine": "kokoro",
    "language": "en-GB", "language_label": "English (UK)",
    "accent": "british", "gender": "female", "age_group": null, "styles": [],
    "tier": "free", "min_plan": null, "locked": false,
    "preview_url": "/previews/bf_emma.mp3", "is_favorite": false, "is_cloned": false,
    "description": null, "credit": null
  }],
  "meta": { "filters": { "language": [{ "value": "en-GB", "label": "English (UK)", "count": 3 }], "...": [] } }
}

POST /voices/{id}/favorite

Add a voice to favourites. DELETE the same path to remove.

POST /voices/clonePro+

Create a cloned voice (multipart): name, sample (file, 20–120 s), consent (file — the speaker reading the consent phrase), speaker_name, consent_text, confirm=true. Public figures are blocked.

DELETE /voices/{id}

Delete a cloned voice.

Text to speech

Jobs are asynchronous: create one, then poll it or receive a webhook. Identical requests (same normalised text, voice, settings and engine) return the cached result immediately with status completed and cached: true.

POST /tts

Create a speech job. Use `text` for one voice, or `script` for multi-speaker (Starter+ when more than one voice).

{
  "text": "Hello! <break time=\"500ms\"/> Welcome to Voice Studio.",
  "voice_id": "af_heart",
  "title": "Welcome clip",
  "settings": { "speed": 1.0, "pitch": 0, "volume": 0, "format": "mp3", "bitrate": 128 }
}
curl -X POST https://voice.toolscase.com/api/v1/tts \
  -H "Authorization: Bearer $VS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello world","voice_id":"af_heart","settings":{"format":"mp3","bitrate":128}}'
201 {
  "data": {
    "id": 123, "title": "Welcome clip", "status": "queued", "progress": 0, "queue_position": 2,
    "char_count": 39, "premium": false, "voice": { "id": "af_heart", "name": "Heart" }, "engine": "kokoro",
    "settings": { "speed": 1, "pitch": 0, "volume": 0, "format": "mp3", "bitrate": 128 },
    "format": "mp3", "duration_sec": null, "audio_url": null, "download_url": null,
    "chapters": [], "error": null, "cached": false, "project_id": null,
    "created_at": "2026-10-09T12:00:00Z", "completed_at": null
  }
}

GET /tts/{id}

Get a job. When status is completed, audio_url (inline) and download_url (attachment) are short-lived signed links.

GET /tts

List jobs (without text). Query: project_id, q, status, page.

PATCH /tts/{id}

Update title or project_id.

DELETE /tts/{id}

Delete a job and its audio.

POST /tts/{id}/retry

Retry a failed job.

POST /tts/importStarter+

Extract narration text from an upload (PDF, DOCX, EPUB) or a URL. Returns {title, text, char_count, chapters[]} — review it, then POST /tts.

{ "upload_id": 456 }   // or { "url": "https://example.com/article" }

POST /tts/bulkPro+

Multipart: csv (columns text[, filename][, voice_id]), voice_id, settings (JSON string). Returns a BulkBatch; GET /tts/bulk/{id} for progress and zip_url.

curl -X POST https://voice.toolscase.com/api/v1/tts/bulk \
  -H "Authorization: Bearer $VS_KEY" \
  -F [email protected] -F voice_id=af_heart -F 'settings={"format":"mp3","bitrate":192}'

Uploads

POST /uploads

Multipart upload. purpose: stt | music | clone_sample | consent | import. Returns {id, filename, size, mime, duration_sec}.

curl -X POST https://voice.toolscase.com/api/v1/uploads \
  -H "Authorization: Bearer $VS_KEY" \
  -F purpose=stt -F [email protected]

Speech to text

POST /stt

Create a transcription from an upload_id or a media_url (direct http(s) link to an audio/video file — no YouTube). language: "auto" or a code like "en". speaker_labels and num_speakers need Starter+.

{ "upload_id": 789, "language": "auto", "speaker_labels": true, "num_speakers": 2, "title": "Interview" }
curl -X POST https://voice.toolscase.com/api/v1/stt \
  -H "Authorization: Bearer $VS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"upload_id":789,"language":"auto"}'
201 {
  "data": {
    "id": 42, "title": "Interview", "status": "queued", "progress": 0, "duration_sec": null, "language": null,
    "text": null, "segments": [], "speakers": [], "audio_url": null,
    "summary": null, "translations": {}, "error": null, "project_id": null, "created_at": "2026-10-09T12:00:00Z"
  }
}

GET /stt/{id}

Get a transcript. segments: [{id, start, end, text, speaker, words:[{w, s, e}]}], speakers: [{id:"S1", name}].

GET /stt

List transcripts. Query: project_id, q, page.

PATCH /stt/{id}

Update title, edited segments, or speaker names.

DELETE /stt/{id}

Delete a transcript and its source audio.

POST /stt/{id}/translatePro+

{target_language} → 202; the result lands in translations[lang].

POST /stt/{id}/summarisePro+

→ 202; the result lands in summary {status, text, chapters}.

GET /stt/{id}/export?format=txt|srt|vtt|docx|pdf&translation=es

Download an export as a file. Free plans: txt and srt.

curl -L "https://voice.toolscase.com/api/v1/stt/42/export?format=srt" \
  -H "Authorization: Bearer $VS_KEY" -o interview.srt

Usage, projects and library

GET /usage

Current period usage: tts_chars, premium_chars (with credits), stt_minutes, cloned_voices — each {used, limit}.

GET /plans

Public plan list (no auth needed).

GET /projects

List projects. POST {name} to create; PATCH/DELETE /projects/{id}.

GET /library

Combined list of TTS jobs and transcripts. Query: type=tts|stt, project_id, q, page.

GET /dictionary

Pronunciation dictionary (Starter+). POST {term, spoken_as}; PATCH/DELETE /dictionary/{id}.

POST /shares

Create a public share link {type, id} → {token, url, embed_url, embed_html} (Starter+). DELETE /shares/{token} to revoke.

GET /status

Public service status: {api, engine, queue:{tts_waiting, stt_waiting, est_wait_sec}}.

Webhooks

Register endpoints in Settings → Webhooks or via POST /webhooks {url, events}. Events: tts.completed, tts.failed, stt.completed, stt.failed, bulk.completed. The signing secret is returned once when you create the webhook. Send a test event with POST /webhooks/{id}/test.

Each delivery is a POST with a JSON body:

{ "event": "tts.completed", "data": { /* the TtsJob, Transcript or BulkBatch */ }, "created_at": "2026-10-09T12:00:05Z" }

Respond with any 2xx within a few seconds. Failed deliveries are retried 3 times with backoff, so make your handler idempotent (use data.id + event).

Verifying signatures

Every request has an X-Voice-Signature header: t=<unix time>,v1=<hex HMAC-SHA256>, where the HMAC is computed over `${t}.${rawBody}` with your webhook secret. Compute it over the raw body (before JSON parsing), compare in constant time, and reject old timestamps.

Node.js

import crypto from "node:crypto";

// rawBody: the exact request body string; header: req.headers["x-voice-signature"]
export function verifyVoiceStudio(rawBody, header, secret, toleranceSec = 300) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  const given = Buffer.from(parts.v1 ?? "", "hex");
  const want = Buffer.from(expected, "hex");
  return given.length === want.length && crypto.timingSafeEqual(given, want);
}

PHP

<?php
function verify_voice_studio(string $rawBody, string $header, string $secret, int $tolerance = 300): bool
{
    parse_str(str_replace(',', '&', $header), $parts);
    $t = (int) ($parts['t'] ?? 0);
    if (! $t || abs(time() - $t) > $tolerance) {
        return false;
    }
    $expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
    return hash_equals($expected, (string) ($parts['v1'] ?? ''));
}

// Usage: verify_voice_studio(file_get_contents('php://input'), $_SERVER['HTTP_X_VOICE_SIGNATURE'], $secret);

Python

import hashlib, hmac, time

def verify_voice_studio(raw_body: bytes, header: str, secret: str, tolerance: int = 300) -> bool:
    parts = dict(p.split("=", 1) for p in header.split(","))
    t = int(parts.get("t", 0))
    if not t or abs(time.time() - t) > tolerance:
        return False
    expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts.get("v1", ""))

Text to speech API guide: jobs, webhooks, batching and errors

Updated

Quick answer: Every Voice Studio API job is asynchronous. You POST /tts or POST /stt, get a job back with status: "queued", then either poll GET /tts/{id} or receive a signed webhook when it finishes. Identical speech requests return instantly with cached: true. Use /tts/bulk for many lines, and handle 402, 409 and 429 explicitly.

Is there a synchronous endpoint?

No. Text to speech and transcription both run as queued jobs, because a long script is split by sentence, generated chunk by chunk and joined, and a long recording takes time to recognise. A request that held a connection open for that long would time out.

There's one shortcut. If you send exactly the same normalised text, voice, settings and engine as an earlier job, the response comes back already completed with cached: true and a download_url. Always check status on the create response before you start waiting. For short, repeated phrases such as app prompts, you'll often never wait at all.

Polling or webhooks: which should you use?

Polling GET /tts/{id}Webhooks
SetupNoneRegister a URL and store the signing secret
Best forScripts, CLI tools, one-off jobsServers, queues, anything in production
LatencyDepends on your intervalPushed when the job ends
Rate limitsEach poll is a requestNo requests from you while waiting
Needs a public URLNoYes

Poll for quick experiments, and use webhooks for anything that runs unattended. If you must poll, start at a few seconds and back off. Read queue_position on the job and est_wait_sec from GET /status to choose a sensible interval rather than hammering the API.

Webhook events are tts.completed, tts.failed, stt.completed, stt.failed and bulk.completed. Deliveries that don't get a 2xx are retried 3 times with backoff, so the same event can arrive twice. Key your handler on data.id plus event and ignore repeats.

Batching many lines

For dozens or hundreds of short clips, don't loop over POST /tts. On Pro and Business, POST /tts/bulk takes one CSV with a text column, plus optional filename and voice_id. It returns a batch you can follow with GET /tts/bulk/{id} until its zip_url is ready, or you can wait for bulk.completed. Each row becomes its own job and counts toward your characters, and the batch stops if you run out. See the bulk CSV format for column rules.

For one long text, such as a chapter or a whole book, send a single POST /tts. It's split and joined for you, up to 200,000 characters per job on Pro and 500,000 on Business, with headings turned into chapter markers. Long text and chapters explains how the splitting works.

Error handling patterns

Errors always arrive as { "error": { "code": …, "message": … } }, so switch on code, not on the message text.

CodeWhat to do
401 unauthenticatedCheck the key and the Bearer header. Don't retry.
402 plan_requiredShow required_plan and upgrade_url. Don't retry.
402 quota_exceededStop sending. Read meter, used and limit. Surface topup_available.
409 job_runningYou're at your concurrency limit (3 on Pro, 5 on Business). Wait for a job to finish, then retry.
422 validation_failedFix the fields it lists. Retrying unchanged won't help.
429 rate_limitedWait retry_after seconds (also in Retry-After), then retry.

A job that ends as failed isn't an HTTP error. Read its error field, then call POST /tts/{id}/retry rather than creating a duplicate. Before a large run, call GET /usage to check tts_chars and stt_minutes against their limits, so you don't fail halfway.

How to build a script-to-audio integration

This walkthrough turns a CMS article into an MP3 every time it's published.

  1. Create a key in Settings → API and keep it on the server only. Keys start with vs_live_ and belong to one workspace.
  2. Register a webhook for tts.completed and tts.failed, and save the secret it returns once.
  3. When an article publishes, send its text:
curl -X POST https://voice.toolscase.com/api/v1/tts \
  -H "Authorization: Bearer $VS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Spring opening hours start on Monday.","voice_id":"bf_emma","title":"post-1182","settings":{"format":"mp3","bitrate":128}}'
  1. Store the returned id against the article. If status is already completed, skip to step 6.
  2. In your webhook handler, verify X-Voice-Signature over the raw body, reject old timestamps, then look up the article by data.id.
  3. Fetch the file from download_url straight away and store it yourself. Signed links are short-lived, so call GET /tts/{id} again if you need a fresh one later.

Using title for your own reference, here post-1182, makes jobs easy to find with GET /tts?q=. To fix pronunciation of brand names across every job, add entries once through /dictionary (see the pronunciation dictionary) rather than rewriting the text you send. The API quickstart has a transcription walkthrough too, and plan limits are on pricing.

Frequently asked questions

Does the text to speech API return audio directly?

No. It returns a job, and the audio comes from the job's download_url once status is completed. The exception is a cached request, which already includes the link in the create response. Download the file and keep your own copy, because signed links expire.

How do I avoid duplicate jobs when my webhook fires twice?

Treat the pair of data.id and event as a unique key. Record it when you first process a delivery and return 2xx without doing anything if you see it again. Failed deliveries are retried 3 times with backoff, so repeats are normal.

Can I generate several voices in one API call?

Yes. Send a script instead of text to POST /tts, with a different voice per block, and you get one joined file back. Using more than one voice needs Starter or above, and multi-speaker scripts explains how blocks are joined. For many separate files, use /tts/bulk with a voice_id column instead.

How do I check how many characters I have left before a big batch?

Call GET /usage. It returns your current period's tts_chars, premium_chars, stt_minutes and cloned_voices, each as used and limit. API usage shares the same monthly allowance as the web app, so subtract both from what you plan to send.

Can I transcribe a file from a URL instead of uploading it?

Yes, if it's a direct http(s) link to an audio or video file. Pass it as media_url to POST /stt. Page links such as YouTube aren't supported. Otherwise, upload the file to /uploads with purpose=stt and pass the returned upload_id.

How do I test my webhook endpoint?

Call POST /webhooks/{id}/test to send a test event to the URL you registered. Use it to confirm your signature check passes on the raw request body and that your handler replies with a 2xx within a few seconds.