API reference
Base URL, authentication, SDKs, conventions and every endpoint of the Wistfare Voice API.
The Wistfare Voice API is a REST API over HTTPS, plus one WebSocket for live transcription. Requests and responses are JSON, except audio uploads (multipart) and generated audio (bytes).
https://api.voice.wistfare.comAuthentication
Send your API key as a bearer token on every request, REST or WebSocket:
Authorization: Bearer wv_sk_…That's all. See Authentication for keys, permissions and key safety.
SDKs
pip install wistfareai # Python 3.9+
pip install "wistfareai[mic]" # + live transcription from the microphone
pip install "wistfareai[numpy]" # + numpy audio input for live streamsfrom wistfareai import WistfareAI, AsyncWistfareAI
client = WistfareAI(api_key="wv_sk_...") # or set WISTFARE_API_KEY and call WistfareAI()
# AsyncWistfareAI has the same methods with `await`.SDK preview
The wistfareai packages for Python (PyPI) and JavaScript (npm) publish soon. Every endpoint also has a cURL example, and any HTTP client works.
Both SDKs read WISTFARE_API_KEY and WISTFARE_BASE_URL from the environment, retry connection errors and 408/429/5xx responses twice with exponential backoff (a slow transcription is never sent twice), and use a 10-minute request timeout (timeout, in seconds in Python and milliseconds in JavaScript).
SDK and HTTP defaults
The SDKs and the HTTP API share the same defaults: wistfare-stt-v3-beta, language=auto, diarize off and word timestamps on. A few options are spelled differently:
| Option | SDKs | HTTP |
|---|---|---|
| Word timestamps | timestamps="word" (or None / null) | timestamps=true / false |
| Key terms | key_terms / keyTerms (a list) | boost (comma- or newline-separated) |
| Audio format (text to speech) | output_format / outputFormat | format |
SDK errors
Every SDK error is a WistfareError with status, code (the API's error.code) and request_id / requestId:
| Class | When |
|---|---|
BadRequestError | 400, 413, 422: e.g. unsupported_language, audio_too_long, file_too_large, validation_error |
AuthenticationError | 401, or a refused live handshake (bad or revoked key, unknown or used token) |
InsufficientCreditsError | 402: insufficient_credits, budget_exceeded |
PermissionDeniedError | 403: read_only_key, account_suspended |
NotFoundError / ConflictError / RateLimitError | 404 / 409 (e.g. idempotency_in_progress) / 429 (rate_limited, concurrency_limit) |
InternalServerError | 5xx, after retries |
APIConnectionError / APITimeoutError | Network failure or timeout |
RealtimeError | A live session ended with an error; transcript has what was saved |
WaitTimeoutError | jobs.wait() or batches.wait() ran out of time |
WebhookVerificationError | verify_webhook / verifyWebhook rejected a delivery |
Endpoints
| Endpoint | Description |
|---|---|
POST /v1/stt | Transcribe an audio or video file. |
GET /v1/stt/transcriptions/{id} | Retrieve a transcription. |
WS /v1/stt/stream | Live transcription over a WebSocket. |
POST /v1/stt/stream/tokens | Single-use token for client-side streaming (optional). |
POST /v1/stt/jobs | Create a batch transcription job. |
GET /v1/stt/jobs/{id} | Retrieve a job. |
GET /v1/stt/jobs | List recent jobs. |
POST /v1/stt/jobs/{id}/cancel | Cancel a job's remaining files. |
POST /v1/tts | Convert text to speech. |
POST /v1/batches | Generate up to 100 clips in one call. |
GET /v1/batches/{id} | Retrieve a batch. |
GET /v1/batches | List recent batches. |
GET /v1/batches/{id}/items/{ref}/audio | Download one batch item's audio. |
GET /v1/voices | List voices. |
GET /v1/voices/{id}/preview | Fetch a voice preview. |
GET /v1/usage | Daily usage and spend. |
Idempotency
POST /v1/stt, POST /v1/stt/jobs, POST /v1/tts and POST /v1/batches accept an Idempotency-Key header (1 to 128 printable ASCII characters, no spaces), for example a UUID you generate per logical request. If a request times out or the connection drops, retry it with the same key and the same body: you get the original response back (status, body and billing headers) and are charged once.
curl https://api.voice.wistfare.com/v1/stt \
-H "Authorization: Bearer $WISTFARE_API_KEY" \
-H "Idempotency-Key: 6f1d0c4e-9a2b-4c7e-8f3a-2b5d7e9c1a04" \
-F "file=@call.wav"| Situation | Result |
|---|---|
| Same key, same endpoint and body, first request finished | The stored response is replayed (with a new X-Request-Id). |
| Same key while the first request is still running | 409 idempotency_in_progress. Retry after a moment. |
| Same key with a different body or endpoint | 422 idempotency_mismatch. |
Keys are scoped to the API key that sent them and kept for 24 hours. For multipart uploads, the file contents are compared, not the random multipart boundary.
Request IDs
Every response, including WebSocket handshakes, carries an X-Request-Id header, and every error body includes the same value as error.request_id. Send your own X-Request-Id (1 to 128 letters, digits, _, ., : or -) to correlate with your logs; it's echoed back, otherwise one is generated. Include it when you contact support. The SDKs expose it as request_id / requestId on results and errors.
Rate and concurrency limits
Each account has default limits on API requests (120 per minute, 5,000 per day), concurrent file transcriptions (4), concurrent live sessions (2), active batch jobs (1) and stream tokens (20 per minute). Over a limit, the API returns 429 with rate_limited or concurrency_limit and a Retry-After header (in seconds); live sessions are refused with close code 4429. Back off for at least Retry-After before retrying. Limits can be raised on request; see Account limits.
Conventions
- Money is in integer US cents:
cost_cents: 15is $0.15. - Durations are float seconds; timestamps are ISO-8601 in UTC.
- Ids are prefixed by type:
tr_transcriptions,sttjob_/sttitem_transcription jobs and their files,gen_generations,batch_batches,vc_voices,key_API keys. - Booleans in multipart forms are the strings
trueorfalse. - Errors always look like
{"error": {"code": "…", "message": "…", "request_id": "…"}}. Branch oncode; see Errors.
Cost headers
Billable endpoints report what each request cost:
| Header | Example | Meaning |
|---|---|---|
X-Credits-Charged-Cents | 2 | What this request cost, in US cents. |
X-Audio-Seconds | 4.62 | Seconds of audio billed (input for speech to text, output for text to speech). |
X-Transcription-Id | tr_7c31be92a1f04d2e8b9c | POST /v1/stt: the transcription id. |
X-Generation-Id | gen_7c31be92a1f04d2e8b9c | POST /v1/tts: the generation id. |
X-Request-Id | 9b2f4c1e6a8d4e0fb3c7a5d2e1f09a64 | Every response: the request's correlation id. |
Machine-readable docs
These docs are also available as plain Markdown for LLMs and tools: /docs/llms.txt is an index, /docs/llms-full.txt is everything in one file, and adding .md to any page URL returns that page as Markdown.