KAZIVOICE FOR DEVELOPERS

From approved text
to an audio response.

Use a versioned REST API for normalization, speech generation, and dialogue. Start with one request, then make the response part of your application.

THE INTEGRATION CONTRACT
Interface
REST / JSON
Audio delivery
Data URL or binary bytes
Voice catalog
GET /api/v1/voices
Specification
OpenAPI

Completed audio clips with explicit parameters and structured errors.

BRING YOUR EXISTING SDK

Change your connection.
Keep your speech calls.

OpenAI and ElevenLabs clients can call KaziVoice with their familiar request shapes and binary audio responses. Set our base URL and workspace API key.

OpenAI SDK

from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["KAZIVOICE_API_KEY"],
    base_url="https://kazivoice.aibuilds.nyc.boxd.sh/v1",
)
with client.audio.speech.with_streaming_response.create(
    model="gpt-4o-mini-tts", voice="alloy",
    input="Welcome to KaziVoice.",
) as audio:
    audio.stream_to_file("speech.mp3")

ElevenLabs SDK

from elevenlabs.client import ElevenLabs
import os

client = ElevenLabs(
    api_key=os.environ["KAZIVOICE_API_KEY"],
    base_url="https://kazivoice.aibuilds.nyc.boxd.sh/elevenlabs",
)
audio = client.text_to_speech.convert(
    voice_id="21m00Tcm4TlvDq8ikWAM",
    model_id="eleven_multilingual_v2",
    text="Welcome to KaziVoice.",
)
with open("speech.mp3", "wb") as file:
    file.write(b"".join(audio))

Your voices. One workspace credential.

Copy your workspace API key in the studio's API playground. It grants access to voices saved in that browser workspace. A saved clone ID works in OpenAI's voice field or ElevenLabs' voice_id field. Server deployments can also configure their own API keys and explicit voice aliases.

Provider voice names and model IDs are migration aliases to KaziVoice engines, not the original providers' voices or weights. Audio chunks are delivered after local generation completes. Free-form speaking instructions, realtime WebSockets, transcription, non-default ElevenLabs stability/similarity controls and zero-retention mode are not supported. Unsupported controls return clear errors. Clone upload requires an exact transcript and permission confirmation.

STANDARD ENGLISH

Familiar voices.
Clear regional choices.

Choose from 12 US, four UK, two Canadian and two Australian voices, with male and female options. Kenyan, Nigerian and South African English remain available.

English defaults for existing clients

OpenAI names such as alloy, nova and echo now map to distinct US/UK English presets. ElevenLabs legacy aliases default to US English. Use native KaziVoice IDs to choose a specific accent. The voice catalog includes locale and accent metadata.

START WITH AUDIO BYTES

One request.
A file you can play.

These examples call the binary endpoint and save the finished audio. The example URL uses this demo; replace it with your own deployment URL.

01

Choose your voice

Read the voice catalog and use a profile identifier. Local voices need downloaded model assets; Edge voices need network access.

02

Set the output

Pass audio_format, mastering_profile, and an optional sample_rate. Use the raw_neural profile when you want unmastered output.

03

Add authentication

When API-key authentication is enabled on your deployment, send X-API-Key or Authorization: Bearer from your server.

MAKE THE RESPONSE USEFUL

The clip.
And the context around it.

JSON synthesis output

The JSON endpoint returns the original and normalized text alongside playable audio. Keep the transcript and voice identifier with your asset when you need to reproduce the request.

  • audio_base64 — playable audio data URL
  • duration_seconds — clip duration
  • latency_ms — observed request latency
  • cached — cache-hit indicator
  • word_timestamps / vtt_subtitles — estimated caption data
BINARY RESPONSE HEADERS
Content-Type
Audio MIME type
X-Audio-Duration
Clip duration in seconds
X-Mastering-Profile
Applied mastering profile
X-Audio-Cached
Cache-hit indicator
X-Request-ID
Request correlation identifier
Response and failure handling
HTTP status Meaning Suggested handling
200 Completed request Use the documented JSON schema or audio MIME type
401 Authentication rejected Check the key and deployment configuration
422 Invalid request parameters Correct the input using the API schema
429 Client rate limit exceeded Honor Retry-After and apply bounded backoff
504 Request deadline exceeded Review request size and compute; use a bounded retry policy

BEFORE YOU CONNECT THE WORKFLOW

Build for the
actual operating conditions.

01

Call from a trusted backend

Keep private API keys on your server. Restrict CORS and supply an authenticated gateway when exposing the studio to a team.

02

Handle completed rendering

The binary endpoint responds after rendering completes. Set client timeouts that match the deployment deadline and play or save the resulting file.

03

Keep retries bounded

Inspect the status and structured error. Apply backoff to retryable conditions and retain request IDs for investigation. A timeout can occur while model work is still finishing.

04

Validate language settings

For English scripts, disable Swahili clock conversion, Sheng smoothing, and phonetic shifts. Review mixed-language scripts with the normalization inspector.

Review deployment controls

TAKE THE NEXT STEP

Test the request.
Then test the workflow.

Use representative scripts and your deployment environment before making capacity assumptions.

Open the API reference