Documentation

PlotWeaver API

Text to speech, voice cloning, speech to text and translation for African languages. Base URL https://api.plotweaver.app/v1

Text to speech, speech to text, translation and voice cloning for African languages.

This is the full guide. Signed in, the dashboard shows only the products enabled for your organisation.

  • Base URL: https://api.plotweaver.app/v1
  • Interactive reference: https://api.plotweaver.app/docs
  • This document as Markdown: GET /v1/docs.md

Authentication

Create an API key in the dashboard (API Keys → Create key) and send it on every request:

X-API-Key: pw_live_xxxxxxxxxxxxxxxxxxxxxxxx

Keep keys on your server. Do not ship them in a mobile app or browser bundle; call Plotweaver from your backend instead.

Status Meaning
401 Missing, invalid, revoked or expired key
403 detail.code says why: password_change_required (set a new password in the dashboard), service_not_enabled (this product isn't enabled for your account), access_expired (your access period has ended) or account_suspended

Services at a glance

Service Endpoint Languages
Text to speech POST /v1/speech 73 (see GET /v1/languages)
Streaming text to speech POST /v1/speech/stream yo, ha, ig, pcm, en
Voice cloning POST /v1/voices, POST /v1/speech/clone 73
Speech to text POST /v1/transcriptions yo, ha, ig, pcm, en
Real-time speech to text WSS /v1/transcriptions/stream yo, ha, ig, pcm, en
Translation POST /v1/translations any pair of yo, ha, ig, pcm, en

Languages are addressed by code (yo) or name (Yoruba), case-insensitively.

TTS models

You normally do not choose a model; the API picks the right one. You can pin one with "model".

Model Used for Default when
storm-v1 Nigerian languages with Plotweaver's built-in voices. Highest quality, supports streaming. Language is yo, ha, ig, pcm or en and no cloned voice is given
storm-v2 Voice cloning in Nigerian languages You use a cloned voice created in a Nigerian language
storm-v3 73 African languages, preset voice or cloning. Also available for Nigerian languages if you prefer its sound. Any other language

Languages

GET /v1/languages

No authentication required. Optional ?service=tts|tts_clone|asr|translation.

[
  {
    "code": "yo",
    "name": "Yoruba",
    "services": ["tts", "tts_clone", "asr", "translation"],
    "tts_models": ["storm-v1", "storm-v2", "storm-v3"],
    "default_tts_model": "storm-v1",
    "default_voice_id": "morenike"
  },
  {
    "code": "sw",
    "name": "Swahili",
    "services": ["tts", "tts_clone"],
    "tts_models": ["storm-v3"],
    "default_tts_model": "storm-v3",
    "default_voice_id": null
  }
]

GET /v1/languages/{code} returns one entry.

Voices

GET /v1/voices

Built-in voices plus the voices you have cloned. Each built-in voice has a samples list with one playable clip per language it supports (and sample_url for the most relevant one), so you can listen before generating. Sample links are signed and expire after an hour; fetch the list again for fresh links.

Query: language (every voice that can speak it: native speakers first, then cross-lingual voices), type=builtin|cloned.

Cross-lingual voices. Every built-in voice can speak all five Nigerian languages (yo, ha, ig, pcm, en), and so can voices cloned with storm-v2. A voice speaking a language it was not recorded in is cross-lingual: the list marks it cross_lingual: true, and POST /v1/speech returns X-Cross-Lingual: true. Quality is best in a voice's native language; recommended: true marks the pairings we have checked by ear. STORM v3 has no built-in voices: use its default voice for the language, or a voice cloned with it.

Code-switching. Text that mixes languages ("Ẹ kú àárọ̀ everyone, the meeting starts at ten") is read in one voice. Set language to the main language of the text. The same applies to speech to text: set language to the language mostly spoken in the audio.

curl https://api.plotweaver.app/v1/voices?language=ig \
  -H "X-API-Key: $PLOTWEAVER_API_KEY"
[
  {
    "voice_id": "adaeze",
    "name": "Adaeze",
    "type": "builtin",
    "model": "storm-v1",
    "gender": "female",
    "native_languages": ["ig"],
    "languages": ["ig", "pcm", "en"],
    "is_native": true,
    "sample_url": "https://…/samples/adaeze/ig.wav?X-Amz-Signature=…",
    "samples": [
      { "language": "ig", "url": "https://…/samples/adaeze/ig.wav?…" },
      { "language": "pcm", "url": "https://…/samples/adaeze/pcm.wav?…" },
      { "language": "en", "url": "https://…/samples/adaeze/en.wav?…" }
    ]
  }
]

Built-in voices

voice_id Gender Native Also approved for
morenike female Yoruba :
adewale male Yoruba Igbo
amina female Hausa :
adaeze female Igbo Nigerian Pidgin, Nigerian English
yemi male Nigerian English, Nigerian Pidgin :
john male Nigerian English, Nigerian Pidgin :

POST /v1/voices: create a cloned voice

multipart/form-data

Field Required Notes
name yes Your label
language yes Language spoken in the clip
file yes 4 to 8 s of clean speech, one speaker, no music (wav, mp3, flac, ogg, m4a; max 10 MB)
reference_text for non-Nigerian languages Exact transcript of the clip
description no
curl -X POST https://api.plotweaver.app/v1/voices \
  -H "X-API-Key: $PLOTWEAVER_API_KEY" \
  -F name="Narrator" -F language=yo -F file=@my_voice.wav

Returns 201 with id: use it as voice_id in POST /v1/speech. Voices in Nigerian languages are cloned with storm-v2 and can speak any of yo, ha, ig, pcm, en; others use storm-v3.

GET /v1/voices/{voice_id}, PATCH /v1/voices/{voice_id} (name, description), DELETE /v1/voices/{voice_id}.

GET /v1/voices/{voice_id}/audio returns {"url": "...", "expires_in": 3600}, a signed link to the clip you uploaded for a cloned voice.

Creating a voice is not charged; speech generated with it is billed as voice cloning.

Text to speech

POST /v1/speech

{
  "text": "Ẹ kú àárọ̀, ẹ káàbọ̀ sí Plotweaver.",
  "language": "yo",
  "voice_id": "morenike",
  "model": null,
  "fast": false,
  "normalize": true
}
Field Required Notes
text yes Up to 1,000 characters after normalisation. Split longer text into sentences.
language yes Code or name
voice_id no Built-in id or your cloned voice id. Omitted: the language's default voice.
model no storm-v1, storm-v2, storm-v3 to pin an engine
fast no Skip quality retries for lower latency
normalize no Default true. Rewrites currencies, numbers, units, times and symbols into words before synthesis (e.g. ₦5.75 million → five point seven five million naira).

Response: audio/wav bytes.

Header Meaning
X-Request-ID Quote this when contacting support
X-Model Engine used
X-Voice Voice used
X-Language Language code
X-Characters Billable characters (after normalisation)
curl -X POST https://api.plotweaver.app/v1/speech \
  -H "X-API-Key: $PLOTWEAVER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Sannu, yaya kake?", "language": "ha"}' \
  --output hello.wav
import requests

r = requests.post(
    "https://api.plotweaver.app/v1/speech",
    headers={"X-API-Key": API_KEY},
    json={"text": "How far, wetin dey happen?", "language": "pcm", "voice_id": "yemi"},
    timeout=120,
)
r.raise_for_status()
open("out.wav", "wb").write(r.content)
const res = await fetch("https://api.plotweaver.app/v1/speech", {
  method: "POST",
  headers: { "X-API-Key": process.env.PLOTWEAVER_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ text: "Habari yako?", language: "sw" }),
});
const audio = Buffer.from(await res.arrayBuffer());

Generation takes a few seconds to ~20 s depending on length. Use a client timeout of at least 120 s.

POST /v1/speech/stream

Same JSON body. storm-v1 and built-in voices only. Returns raw PCM as it is generated: signed 16-bit little-endian, mono, 24 kHz (X-Audio-Format: pcm_s16le, X-Sample-Rate: 24000). A streamed take cannot be retried mid-stream, so prefer POST /v1/speech when quality matters more than latency.

Leading silence is trimmed, so the first bytes you receive are speech.

Capacity: each account can hold up to 12 streams (and POST /v1/speech calls on storm-v1) at once. Past that, new requests get 429 with a Retry-After header straight away instead of waiting in a queue.

Billing: once audio has started, the whole text is billed, including when you close the stream early (for example when the caller interrupts). A stream that fails before any audio, or because of an error on our side, is not billed. For live calls, send one sentence per request so an interruption costs only that sentence.

curl -sN -X POST https://api.plotweaver.app/v1/speech/stream \
  -H "X-API-Key: $PLOTWEAVER_API_KEY" -H "Content-Type: application/json" \
  -d '{"text": "Bawo ni", "language": "yo"}' \
  | ffplay -autoexit -nodisp -f s16le -ar 24000 -ac 1 -i pipe:0

POST /v1/speech/clone: one-off cloning

Clone from a clip for a single request without saving the voice. multipart/form-data: text, language, reference_audio (file), reference_text (required for non-Nigerian languages), optional model, fast, normalize. Returns audio/wav.

Speech to text

POST /v1/transcriptions

multipart/form-data: file (wav, mp3, m4a, ogg, flac…; max 25 MB), language (yo, ha, ig, pcm, en), and optionally timestamps (segment) and response_format (json, srt, vtt).

curl -X POST https://api.plotweaver.app/v1/transcriptions \
  -H "X-API-Key: $PLOTWEAVER_API_KEY" \
  -F file=@speech.wav -F language=yo
{
  "request_id": "b0c7…",
  "language": "yo",
  "text": "Ẹ kú àárọ̀",
  "audio_duration_s": 3.2,
  "model": "storm-asr"
}

Audio longer than 15 seconds is split at natural pauses and each piece is transcribed separately, so long recordings come back complete. Billed by the minute of audio, measured to the second.

Timestamps and subtitles. Add timestamps=segment to get the transcript in timed pieces. The audio is split at pauses with voice activity detection, each piece is transcribed, and each comes back with its start and end in seconds. Pieces follow natural pauses and run up to 15 seconds, the right size for subtitles and for cutting silence in an edit. Video files work too (mp4, mov, webm…). The price is the same.

curl -X POST https://api.plotweaver.app/v1/transcriptions \
  -H "X-API-Key: $PLOTWEAVER_API_KEY" \
  -F file=@interview.mp4 -F language=yo -F timestamps=segment
{
  "request_id": "b0c7…",
  "language": "yo",
  "text": "Ẹ kú àárọ̀. Ẹ káàbọ̀ sí ètò wa.",
  "audio_duration_s": 9.4,
  "model": "storm-asr",
  "segments": [
    { "start": 0.0, "end": 1.9, "text": "Ẹ kú àárọ̀." },
    { "start": 3.1, "end": 9.4, "text": "Ẹ káàbọ̀ sí ètò wa." }
  ]
}

For a subtitle file instead of JSON, send response_format=srt or response_format=vtt. Timed transcripts take up to 2 hours of audio.

WSS /v1/transcriptions/stream: real-time speech to text

For live calls: stream the caller's audio as they speak and get the transcript the moment they stop.

Connect to wss://api.plotweaver.app/v1/transcriptions/stream with your key in the X-API-Key header (or as api_key= in the query string, for clients that cannot set headers, such as browsers). The language is English unless you add ?language= with yo, ha, ig or pcm, for example wss://api.plotweaver.app/v1/transcriptions/stream?language=yo.

Direction Message Meaning
You send binary frames raw audio: PCM signed 16-bit little-endian, mono, 16 kHz (32,000 bytes a second). Send small frames (20 to 100 ms) as they are captured.
You send {"event": "end"} the speaker has stopped: finish the transcript
We send {"event": "partial", "text": "..."} the transcript so far, while audio arrives
We send {"event": "final", "text": "..."} the finished transcript
We send {"event": "heartbeat"} the connection is alive
We send {"event": "error", "status": 401, "detail": "..."} the request was refused (then the socket closes)

Send only speech: detect the end of speech on your side (a voice activity detector) and send {"event": "end"} straight away rather than streaming silence.

import asyncio, json, os
from websockets.asyncio.client import connect

async def transcribe(pcm: bytes) -> str:
    url = "wss://api.plotweaver.app/v1/transcriptions/stream"  # English; add ?language=yo for Yoruba
    async with connect(url, additional_headers={"X-API-Key": os.environ["PLOTWEAVER_API_KEY"]}) as ws:
        for i in range(0, len(pcm), 3200):  # 100 ms frames
            await ws.send(pcm[i:i + 3200])
        await ws.send(json.dumps({"event": "end"}))
        async for message in ws:
            event = json.loads(message)
            if event["event"] == "final":
                return event["text"]
            if event["event"] == "error":
                raise RuntimeError(event["detail"])

Billed per second of audio you send, however the connection ends. One connection carries up to 30 minutes of audio and closes after 30 seconds without any message from you. Refusals use the same status codes as the HTTP endpoints (401, 402, 403, 429), sent as an error event; the close code is 4000 plus the status. Up to 4 real-time connections are served at once; when the service is at capacity the connection is refused at once with {"event": "error", "status": 429, "retry_after_s": 5} and close code 4429. Retry after that many seconds.

Translation

POST /v1/translations

{ "text": "How are you doing today?", "source_language": "en", "target_language": "ha" }
{
  "request_id": "4e7d…",
  "source_language": "en",
  "target_language": "ha",
  "translated_text": "Yaya kake yau?",
  "pivoted": false,
  "pivot_intermediate_text": null,
  "model": "storm-mt"
}

Up to 2,000 characters. Pairs without English (e.g. yo → ig) are translated through English; the response has pivoted: true and the intermediate English text. Spot-check pivoted pairs before production use.

Usage and billing

Every call is recorded against the API key that made it. You pay through Stripe by card, chosen in the dashboard under Billing. New accounts can start a free trial; after that the API works on a Pay as you go balance or a monthly plan.

Free trial

100 minutes over 7 days, whichever ends first. You save a card on Stripe to start it and nothing is charged. One free trial per company. When it ends, calls return 402 with trial_ended until you top up or choose a plan; you are never moved onto a paid plan without choosing it. Unused trial minutes don't carry over.

Minutes

Every plan counts usage in minutes, from one pool for every service. Each request is rounded up to the next second.

Service What we measure Weight Example Billed
Speech to text Length of audio you send 1× A 10-minute call transcribed 10 min
Text to speech Length of audio we return 1× A 30-second clip 0.5 min
Cloned-voice speech Length of audio we return 1× A 2-minute message 2 min
Translation Each 1,000 characters counts as 1 minute 1.5× 2,000 characters 3 min

Creating a cloned voice costs $2, once, when it's saved.

Plans

Pay as you go Starter Growth Business Enterprise
Monthly fee $0 (prepaid top-ups) $49 $149 $495 from $1,500, 12-month contract
Minutes included each month 1,000 5,000 20,000 agreed
Price per minute $0.06 $0.055 per extra minute $0.045 per extra minute $0.035 per extra minute agreed
Requests per minute 60 300 1,000 2,000 3,000 or more
Support Email Email, within 2 business days Shared WhatsApp or Slack channel Named engineer Contractual SLA

Pay as you go is prepaid: top up from $10 to $1,000 and each request is taken from your balance. When it runs out, calls return 402 until you top up.

On a plan, the included minutes are used first and don't roll over. Extra minutes are billed at your plan's rate. You can set a monthly spending cap under Billing: we email you at 75% and 100% of your included minutes, and calls return 402 with spend_cap_reached once extra usage reaches the cap, until you raise it or your next billing month starts.

The request limit counts every call to speech, transcription and translation across all of your keys. Over it, calls return 429 with detail.code rate_limit_exceeded and a Retry-After header.

A plan starts the day you subscribe, at the full monthly fee, and renews on that day every month: subscribe on the 9th and it renews on the 9th. On your renewal day, Stripe charges the next month's fee together with the last month's extra minutes. If unbilled usage reaches $50 during a billing month, it is charged straight away and taken off the renewal bill.

Starter, Growth and Business can also be paid once a year at 10% off: $529.20, $1,609.20 and $5,346. Annual plans include the same minutes every month, and they reset each month. Extra minutes are charged monthly, on the day the plan started. An annual plan runs for the full year: cancelling stops the renewal. A monthly plan can switch to annual under Billing: nothing is charged that day, and the annual plan starts on your next renewal day.

Upgrades take effect immediately, with the fee prorated. Downgrades and cancellation take effect at the end of your billing period. Change plan, update your card or download receipts from Billing > Manage billing. For a paid pilot, contact us.

If a payment fails, the API keeps working for 7 days while Stripe retries the card. After that, calls are refused with 402 until the invoice is paid.

detail.code Meaning
billing_setup_required No trial, balance or plan yet: start the free trial, top up or choose a plan
trial_ended Your free trial has ended (its minutes are used or its 7 days are over): top up or choose a plan
insufficient_balance Your prepaid Pay as you go balance can't cover this request: top up under Billing. detail.balance and detail.estimated_cost say by how much
spend_cap_reached Extra usage this billing month has reached your spending cap: raise or remove it under Billing. detail.resets_at is when the next billing month starts
payment_overdue A payment failed and the grace period has ended: update your card

GET /v1/billing/account

Your plan, payment status, free trial and this month's bill: usage by product, minutes used and left, amounts already charged and what is still due. Sign in with your dashboard account (bearer token). GET /v1/billing/payments lists the invoices Stripe has charged, with links to each receipt.

Allowances and rates

Each product can have a monthly allowance and a rate:

Product Unit Counted as
Text to speech characters characters after normalisation (X-Characters)
Voice cloning characters characters spoken in a cloned voice
Speech to text minutes audio length, measured to the second (real time: audio sent)
Translation characters characters of source text

Allowances reset on the first day of each month (UTC). When a request would go past the allowance it is refused with 429 and detail.code: "usage_limit_reached"; the body says how much is used, the limit and when it resets. Contact PlotWeaver to raise the limit or add to this month's allowance. A trial with an end date stops with 403 and detail.code: "access_expired".

{
  "detail": {
    "code": "usage_limit_reached",
    "product": "tts",
    "unit": "characters",
    "limit": 500000,
    "used": 499650,
    "requested": 900,
    "resets_at": "2026-11-01T00:00:00+00:00"
  }
}

GET /v1/billing

This month so far: for each product its allowance, usage, remaining, rate and running cost, plus the total. Sign in with your dashboard account (bearer token).

GET /v1/billing/invoices

Your invoices, newest first. The current month is a draft that updates as you use the API; past months are issued, then paid once PlotWeaver records your payment.

GET /v1/billing/invoices/{period} returns one month (period is YYYY-MM) and GET /v1/billing/invoices/{period}/pdf downloads it.

GET /v1/usage/summary

Query: start, end (dates, UTC, inclusive; default the last 30 days, maximum 366 days).

Returns totals (requests, failed requests, characters, audio seconds, voices cloned, cost, languages used) and breakdowns by_product, by_service, by_model, by_language, language_models (which model served each language), by_day and by_key (requests, usage and cost for each of your API keys, plus calls made from the dashboard).

GET /v1/usage/report.pdf (same query) downloads it as a PDF with your current rates.

Errors

Errors are JSON: {"detail": "...", "path": "...", "timestamp": "..."}.

Status Meaning What to do
400 Invalid input: unsupported language, voice not available for the language, text too long Fix the request
401 Bad API key Check the key
402 billing_setup_required, insufficient_balance or payment_overdue (see detail.code) Top up, choose a plan or update your card under Billing
403 access_expired, service_not_enabled or account_suspended (see detail.code) Contact PlotWeaver
404 Voice not found Check voice_id
413 Upload too large Shorten the audio
422 Body failed validation See detail
429 rate_limit_exceeded: your plan's requests per minute are used up (see Retry-After). usage_limit_reached: this month's allowance is used up. A plain 429 with Retry-After on speech or real-time transcription means the engine is at capacity right now. Wait for Retry-After and retry, or upgrade for a higher limit
502 The model engine failed Retry once; contact support with X-Request-ID if it persists
503 Engine busy or unreachable Retry with backoff