Skip to content
Toolscase Voice Studio

Developers

API quickstart

Create an API key, generate speech, transcribe audio, export subtitles and verify webhooks, with curl and JSON examples. Pro and Business.

Updated

The REST API uses the same endpoints as the web app. It's available on Pro and Business. Full reference: API docs.

This page takes you from no key to a working integration: a voiceover, a transcript, a subtitle file and a verified webhook. Every example uses curl so you can paste it into a terminal, then port it to your language.

Steps

  1. Create a key in Settings → API keys. Copy it — it's shown only once.
  2. Send a text-to-speech request with the key as a Bearer token.
  3. Poll the job, or register a webhook to be notified when it completes.
  4. Download the audio from the job's download URL.

Before you start

  • Plan: the workspace must be on Pro or Business. Keys stop working if the workspace moves to a lower plan.
  • Role: only the workspace owner or an admin can create keys and webhooks, and you need a verified email address.
  • Base URL: https://voice.toolscase.com/api/v1. Everything is JSON, apart from file uploads.
  • Store the key in an environment variable so the examples work as written:
export VOICE_STUDIO_KEY="vs_live_your_key_here"

1. Create a key

Keys start with vs_live_ and act on one workspace. Store them as secrets, never in front-end code.

Create keys under Settings → API keys and give each a name that says what uses it, such as "CMS publishing". The list shows each key's first characters and when it was last used, so you can spot keys that are no longer in use. Revoking a key takes effect immediately.

A key acts with the role of the person who created it, in the workspace it was created in. If that person leaves the workspace, the key stops working, so create production keys from an account that will stay. A few account-level endpoints, such as billing and key management itself, aren't available with API keys and return 403.

2. Generate speech

curl -X POST https://voice.toolscase.com/api/v1/tts \
  -H "Authorization: Bearer $VOICE_STUDIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello from the API.","voice_id":"af_heart","settings":{"format":"mp3","bitrate":128}}'

The response contains a job with status: "queued". If identical audio already exists, you get it back immediately with cached: true.

A new job returns HTTP 201; a cached result returns 200 with the status already completed. Cached results still count against your character allowance.

Choosing a voice and settings

List voices, with filters, to find a voice_id:

curl "https://voice.toolscase.com/api/v1/voices?language=en-GB&gender=female" \
  -H "Authorization: Bearer $VOICE_STUDIO_KEY"

Voice ids look like af_heart (American English, female), bm_george (British English, male) or ff_siwis (French, female). Browse them all with previews on the voices page.

SettingValuesDefault
speed0.5 to 21.0
pitch−6 to 6 semitones0
volume−10 to 10 dB0
formatmp3, wav, oggmp3
bitrate128, 192, 256, 320128

text can include the supported SSML tags for pauses and emphasis, for example <break time="500ms"/>. Tags aren't counted as characters. See SSML pauses and emphasis.

Several voices in one file

Send script instead of text, with one block per speaker or paragraph. A title on a block becomes a chapter marker:

{
  "voice_id": "af_heart",
  "title": "Episode 12 intro",
  "script": [
    {"voice_id": "af_heart", "title": "Welcome", "text": "Welcome to the show."},
    {"voice_id": "bm_george", "text": "Thanks. Let's get started."}
  ],
  "settings": {"format": "mp3", "bitrate": 192}
}

More in multi-speaker scripts.

3. Wait for the result

curl https://voice.toolscase.com/api/v1/tts/JOB_ID \
  -H "Authorization: Bearer $VOICE_STUDIO_KEY"

When status is completed, download_url is a signed link to the file. Prefer webhooks for anything beyond a quick script.

A finished job looks like this (trimmed):

{
  "data": {
    "id": "JOB_ID",
    "status": "completed",
    "progress": 100,
    "char_count": 19,
    "voice": {"id": "af_heart", "name": "Heart"},
    "format": "mp3",
    "duration_sec": 1.6,
    "download_url": "https://voice.toolscase.com/api/v1/media?...",
    "cached": false,
    "error": null
  }
}

The status moves from queued to processing to completed or failed. While queued, queue_position and est_wait_sec tell you roughly how long to wait. If you poll, wait a few seconds between requests. Signed links last about two hours, so download the file promptly or fetch the job again for a fresh link.

4. Download the audio

curl -L -o hello.mp3 "DOWNLOAD_URL"

The download link is signed, so it doesn't need the Authorization header.

Transcribe audio

Upload the file first, then start the transcription:

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

curl -X POST https://voice.toolscase.com/api/v1/stt \
  -H "Authorization: Bearer $VOICE_STUDIO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"upload_id":"UPLOAD_ID","language":"auto","speaker_labels":true}'

The upload response gives you the file's id (a string) and its duration_sec. Uploads can be up to 1 GB on Pro and 2 GB on Business. If the file is already online, skip the upload and pass "media_url" with a direct link to the audio or video file instead.

FieldMeaning
upload_id or media_urlThe file to transcribe
languageauto, or a code such as en, es, ko
speaker_labelstrue to label who said what
num_speakers1 to 20, optional; improves speaker labels
titleName shown in the library

Fetch GET /stt/{id} until status is completed. The transcript has text, timed segments with word timings, and speakers. Then download it in any format:

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

format is txt, srt, vtt, docx or pdf. You can also start a translation with POST /stt/{id}/translate and {"target_language":"es"}, then export with &translation=es. See exporting transcripts.

Webhooks

Register a URL in Settings → Webhooks for tts.completed, tts.failed, stt.completed, stt.failed or bulk.completed. Each delivery is signed with X-Voice-Signature — verify it before trusting the payload. Code samples are in the API docs.

When you create a webhook, its signing secret (starting whsec_) is shown once. Copy it into your server's configuration. A workspace can have up to 10 webhooks, and each one has a Test button that sends a signed webhook.test event and shows you the response.

Each delivery is a POST with a JSON body:

{
  "event": "tts.completed",
  "data": {"id": "JOB_ID", "status": "completed", "download_url": "https://..."},
  "created_at": "2026-10-27T10:15:02+00:00"
}

data is the same object you'd get from fetching the job or transcript. The signature header looks like t=1792750502,v1=5f2c…: a Unix timestamp and a hex HMAC-SHA256 of the timestamp, a full stop and the raw body, keyed with your secret.

How to check a signature by hand

When you're debugging, you can reproduce the signature in a terminal. Save the exact raw body to a file, then:

T=1792750502
SECRET="whsec_your_secret"
printf '%s.%s' "$T" "$(cat body.json)" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $NF}'

The output should equal the v1 value. In production, compare in constant time and reject timestamps more than a few minutes old.

Delivery rules

  • Respond with any 2xx status within 10 seconds. Do slow work after responding.
  • Redirects aren't followed, so register the final URL.
  • Failed deliveries are retried after about 60 seconds, 5 minutes and 30 minutes, then given up.
  • Retries can mean the same event arrives twice. Use the job id to ignore duplicates.

Limits

LimitProBusiness
Characters per job200,000500,000
Jobs running at once35
Requests per minute per key300300
New jobs per minute3030
Upload size1 GB2 GB

Monthly allowances are the same as in the app and are shared with it: see billing, quotas and top-ups. Check them at any time with GET /usage.

Errors

Errors always have the same shape:

{"error": {"code": "quota_exceeded", "message": "Human sentence.", "meter": "tts_chars", "used": 998000, "limit": 1000000}}
HTTPCodeWhat to do
401unauthenticatedCheck the key; it may be revoked or its creator removed
402plan_requiredThe feature needs a higher plan (required_plan says which)
402quota_exceededWait for the reset or upgrade; meter says which allowance
403forbiddenThe key's role can't do this, or the endpoint isn't for API keys
409job_runningToo many jobs at once; retry when one finishes
422validation_failedFix the fields listed in fields, such as text over the per-job limit
429rate_limitedWait retry_after seconds

Troubleshooting

  • Every request returns 401. Make sure the header is exactly Authorization: Bearer vs_live_…, with no quotes or line breaks inside the key.
  • 402 with feature: "api". The workspace isn't on Pro or Business.
  • The job stays queued. Busy periods add a short wait; queue_position shows where you are. Fetch it again after est_wait_sec.
  • 422 on upload_id. The upload is from a different workspace, was uploaded for another purpose, or has passed its 30-day retention.
  • My webhook never fires. Check the URL is public HTTPS, returns 2xx quickly, and that you subscribed to the right events. Use Test to see the response.

Frequently asked questions

Is the API included in every plan?

No. API keys and webhooks are part of Pro and Business. On Free and Starter, the API settings page shows a lock. The API uses the same monthly allowances as the web app, so characters and minutes used through the API come out of the workspace's normal pool.

Can I call the API from a browser or mobile app?

Don't put your key in front-end or mobile code, where anyone can read it. Call the API from your own server, then pass the finished audio or text to your app. If a key is ever exposed, revoke it in Settings and create a new one.

Do I have to poll, or can I wait for a callback?

Either works. Polling the job every few seconds is fine for scripts and tests. For anything in production, register a webhook for the completed and failed events, so your server is told as soon as the job finishes and doesn't make unnecessary requests.

Why did my request return immediately with cached: true?

Exactly the same text with the same voice and settings had been generated before, so the existing audio is returned at once instead of being made again. The response has status completed and a download link straight away. The characters still count towards your monthly allowance.

Signed download links last about two hours. The audio itself stays in your library until you delete it, so fetch the job again to get a fresh link whenever you need one. Webhook payloads include a link too, so download soon after the event arrives.

Can one key work across several workspaces?

No. Each key is tied to the workspace it was created in and acts with the role of the person who created it. If you run several workspaces, create a separate key in each and store them separately.

Is there a sandbox or test mode?

There's no separate sandbox. Use short texts and short audio files while you build, since they use very little of your allowance, and use the webhook Test button to check your endpoint without generating anything.