Back to Studio
CREMATIC API & DEVELOPER DOCUMENTATION
OpenAPI 3.1
Server Offline
ON-DEVICE ARCHITECTURE · OPENAI COMPATIBLE · 0MS CLOUD LAG

The Browser Is Your Server.

Crematic transforms your local browser window into a zero-latency, private neural Text-to-Speech API server. Any local script, terminal CLI, or external application can synthesize 54 studio voices at zero cloud inference cost.

In-Browser API Server Control

Stopped — Manual enablement required to process local API requests

For security, battery conservation, and background CPU control, this server is disabled by default. When enabled, it accepts OpenAI-compatible TTS requests on port 3000 and synthesizes audio on-device via your processor's WebGPU or WASM pipeline.

POSThttp://localhost:3000/api/v1/audio/speech
Server Stopped
Click switch to activate
Requests Served0
Avg Latency--
Voices Available54
Engine TargetWebGPU / WASM
INTERACTIVE CONSOLE

Live API Playground

Dispatch an actual HTTP request against your browser server and inspect the response payload, headers, and audio output.

80 / 4096 chars
1.00×
Server is disabled. Enable above to test.
HTTP RESPONSE
Click "Execute API Call" to test your on-device speech server.
Real-Time Code Generator (Synchronized with Playground)
curl -X POST http://localhost:3000/api/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{
    "model": "crematic",
    "input": "Experience on-device neural voice synthesis through the Crematic In-Browser API.",
    "voice": "sarah",
    "speed": 1.00,
    "response_format": "wav"
  }' \
  --output speech.wav
COMPLETE SPECIFICATION

API Endpoints Reference

Exhaustive schema specification, request parameters, response headers, and payloads for all 6 endpoints.

POST/api/v1/audio/speechOpenAI Compatible

Synthesizes lossless 24,000 Hz studio audio from an input string using the specified neural persona. OpenAI SDK clients can call this endpoint directly by overriding base_url.

ParameterTypeRequiredDescription
modelstringNoModel alias. Defaults to "crematic". Accepts crematic-tts-1 and crematic-tts-1-hd.
inputstringYesThe text script to synthesize (supports up to 4,096 characters per request).
voicestringYesAny of Crematic's 54 voice IDs (e.g. sarah, atlas, dora-es, xiaobei).
speednumberNoPlayback speed multiplier between 0.70 and 1.35 (default: 1.0).
response_formatstringNoAudio format. Returns "wav" (lossless 16-bit PCM at 24kHz) or "pcm".
REQUEST HEADERS
Content-Type: application/json
Authorization: Bearer <any-string> (optional)
RESPONSE HEADERS & PAYLOAD
content-type: audio/wav
x-crematic-voice: <voice_id>
x-crematic-latency-ms: <elapsed_ms>
content-length: <bytes_count>
GET/api/v1/voicesCatalog Endpoint

Retrieves the complete catalog of all 54 neural voice profiles across all 9 language families with their IDs, accents, styles, and preview URLs.

{
  "object": "list",
  "total": 54,
  "voices": [
    {
      "id": "sarah",
      "name": "Sarah",
      "style": "Conversational & expressive",
      "accent": "English (US)",
      "description": "Articulate, expressive female delivery for modern audio content.",
      "engineVoiceId": "af_sarah",
      "previewUrl": "/previews/sarah.m4a"
    },
    ... 53 more voices across US, UK, Spanish, French, Hindi, Italian, Japanese, Portuguese, and Chinese
  ]
}
GET/api/v1/modelsOpenAI Compatible

Returns the OpenAI-compatible model catalog so existing LLM clients and tools (e.g. LangChain, LlamaIndex, LiteLLM) can inspect available model aliases.

{
  "object": "list",
  "data": [
    { "id": "crematic", "object": "model", "owned_by": "crematic" },
    { "id": "crematic-tts-1", "object": "model", "owned_by": "crematic" },
    { "id": "crematic-tts-1-hd", "object": "model", "owned_by": "crematic" }
  ]
}
GETPOST/api/v1/bridge/statusManagement Control

Programmatic management endpoint to inspect whether the in-browser server is running, check connected browser tabs, and remotely enable or disable the listener.

GET /api/v1/bridge/status
{
  "enabled": true,
  "connectedBrowserTabs": 1,
  "pendingJobs": 0,
  "supportedVoicesCount": 54
}
POST /api/v1/bridge/status
// Body:
{ "enabled": true }

// Returns updated status object
GET/api/v1/bridge/eventsServer-Sent Events

High-throughput persistent Server-Sent Events channel connecting your active browser tab to the Node.js relay. Dispatches speech synthesis jobs directly into browser memory.

Event speech_job: { id: "job_123", input: "...", voice: "sarah", speed: 1.0 }
Fulfillment: Browser sends binary WAV buffer to POST /api/v1/bridge/fulfill with header x-job-id: job_123
POST/v1/audio/speechZero Network (Service Worker)

Direct in-browser fetch interception. When called inside client web applications or PWAs on this origin, the local Service Worker (public/sw-api-server.js) captures the request via BroadcastChannel("crematic-api-channel") and returns an audio Blob with ZERO network egress.

COMPLETE VOICE ROSTER

All 54 Voices Catalog Reference

Exhaustive reference of all 54 neural voices across 9 language families. Filter by dialect, gender, or keyword, and copy voice IDs directly into your API scripts.

A
AriaUS♀ Female
ariaaf_heart
Warm & conversational
Grounded, warm cadence — great for narration and everyday content.
A
AlloyUS♀ Female
alloyaf_alloy
Balanced & neutral
Even, balanced tone suitable for tech explainers and guides.
A
AoedeUS♀ Female
aoedeaf_aoede
Lyrical & smooth
Lyrical, smooth delivery with poetic rhythm.
S
SanaUS♀ Female
sanaaf_bella
Bright & expressive
Bright & expressive energy for friendly, informative scripts.
J
JessicaUS♀ Female
jessicaaf_jessica
Approachable & natural
Approachable and natural voice for dialogue and podcasts.
K
KoreUS♀ Female
koreaf_kore
Tranquil & meditative
Tranquil, meditative delivery for relaxations and audiobooks.
N
NicoleUS♀ Female
nicoleaf_nicole
Upbeat & focused
Upbeat, focused tone great for advertising and tutorials.
N
NovaUS♀ Female
novaaf_nova
Clear & professional
Focused, confident delivery for demos, explainers, and presentations.
R
RiverUS♀ Female
riveraf_river
Mellow & easy-going
Mellow, easy-going tone with natural pacing.
S
SarahUS♀ Female
sarahaf_sarah
Friendly & comforting
Friendly, comforting tone suited for personal stories and advice.
S
SkyUS♀ Female
skyaf_sky
Fresh & cheerful
Fresh, cheerful delivery for lifestyle and modern apps.
A
AtlasUS♂ Male
atlasam_adam
Deep & authoritative
Low, steady male voice for bold announcements and authority.
E
EchoUS♂ Male
echoam_echo
Rich & reflective
Rich, reflective tone for documentary narration and essays.
E
EricUS♂ Male
ericam_eric
Clear & conversational
Clear, conversational delivery for practical guides and commentary.
F
FenrirUS♂ Male
fenriram_fenrir
Rugged & dramatic
Rugged, dramatic voice suited for trailers, games, and drama.
L
LiamUS♂ Male
liamam_liam
Natural & casual
Natural, warm young adult voice for casual narration.
M
MichaelUS♂ Male
michaelam_michael
Corporate & polished
Polished corporate and broadcast cadence.
O
OnyxUS♂ Male
onyxam_onyx
Dark & resonant
Dark, resonant baritone with dramatic gravity.
P
PuckUS♂ Male
puckam_puck
Lively & animated
Lively, animated delivery for gaming and storytelling.
S
SantaUS♂ Male
santaam_santa
Hearty & booming
Hearty, booming character voice full of warmth.
M
MiraUK♀ Female
mirabf_emma
Soft & friendly
Gentle British cadence for stories and thoughtful reading.
I
IsabellaUK♀ Female
isabellabf_isabella
Melodic & poised
Classic British poise with elegant, melodic phrasing.
A
AliceUK♀ Female
alicebf_alice
Articulate & classic
Articulate RP British accent for educational content and instruction.
L
LilyUK♀ Female
lilybf_lily
Quiet & empathetic
Quiet, empathetic voice for poetry and audio dramas.
G
GeorgeUK♂ Male
georgebm_george
Refined & gentlemanly
Refined British gentleman cadence for history and documentaries.
L
LewisUK♂ Male
lewisbm_lewis
Academic & thoughtful
Thoughtful, academic British tone for lectures and discussions.
D
DanielUK♂ Male
danielbm_daniel
Modern & conversational
Contemporary British voice for tech reviews, vlogs, and media.
F
FableUK♂ Male
fablebm_fable
Expressive & narrative
Expressive British narrator voice built for fantasy and epics.
D
DoraES♀ Female
dora-esef_dora
Warm & expressive
Warm and expressive Spanish delivery for narrative and conversational audio.
A
AlexES♂ Male
alex-esem_alex
Energetic & friendly
Engaging, natural male Spanish cadence for dialogue and presentations.
S
SantaES♂ Male
santa-esem_santa
Hearty & booming
Resonant, celebratory male Spanish voice full of character.
S
SiwisFR♀ Female
siwisff_siwis
Articulate & gentle
Elegant and clear French female cadence for educational and storytelling prose.
A
AlphaHI♀ Female
alpha-hihf_alpha
Bright & melodious
Melodious, expressive female Hindi delivery for narration and media.
B
BetaHI♀ Female
beta-hihf_beta
Calm & natural
Poised and natural female Hindi voice for dialogue and guides.
O
OmegaHI♂ Male
omega-hihm_omega
Deep & authoritative
Strong, grounded male Hindi cadence for announcements and essays.
P
PsiHI♂ Male
psi-hihm_psi
Conversational & crisp
Crisp, dynamic male Hindi cadence for modern explainer scripts.
S
SaraIT♀ Female
sara-itif_sara
Lyrical & animated
Lively, expressive female Italian voice with musical phrasing.
N
NicolaIT♂ Male
nicolaim_nicola
Polished & resonant
Refined male Italian tone for corporate, cinematic, and cultural narration.
A
AlphaJA♀ Female
alpha-jajf_alpha
Clear & polite
Gentle and polished female Japanese voice for dialogue and tutorials.
G
GongitsuneJA♀ Female
gongitsunejf_gongitsune
Narrative & expressive
Evocative, classic female Japanese storyteller delivery.
N
NezumiJA♀ Female
nezumijf_nezumi
Playful & light
Lighthearted, youthful female Japanese timbre for animations.
T
TebukuroJA♀ Female
tebukurojf_tebukuro
Gentle & calming
Soothing female Japanese voice with tranquil pacing.
K
KumoJA♂ Male
kumojm_kumo
Steady & atmospheric
Quiet, steady male Japanese cadence for atmospheric stories and essays.
D
DoraPT♀ Female
dora-ptpf_dora
Warm & friendly
Inviting female Brazilian Portuguese cadence for podcasts and ads.
A
AlexPT♂ Male
alex-ptpm_alex
Dynamic & upbeat
Energetic male Brazilian Portuguese voice for tech and media.
S
SantaPT♂ Male
santa-ptpm_santa
Rich & jovial
Warm, hearty male Brazilian Portuguese delivery with deep resonance.
X
XiaobeiZH♀ Female
xiaobeizf_xiaobei
Crisp & clear
Clear female Mandarin voice with refined broadcast diction.
X
XiaoniZH♀ Female
xiaonizf_xiaoni
Friendly & engaging
Youthful and energetic female Mandarin voice for modern content.
X
XiaoxiaoZH♀ Female
xiaoxiaozf_xiaoxiao
Warm & professional
Polished female Mandarin delivery for presentations and audiobooks.
X
XiaoyiZH♀ Female
xiaoyizf_xiaoyi
Gentle & melodious
Soft, graceful female Mandarin timbre with subtle phrasing.
Y
YunjianZH♂ Male
yunjianzm_yunjian
Steady & poised
Balanced male Mandarin voice with clean articulation for explainers.
Y
YunxiZH♂ Male
yunxizm_yunxi
Bright & casual
Natural young male Mandarin tone for conversational vlogs.
Y
YunxiaZH♂ Male
yunxiazm_yunxia
Deep & resonant
Authoritative, rich male Mandarin delivery for documentary scripts.
Y
YunyangZH♂ Male
yunyangzm_yunyang
Confident & dynamic
Dynamic male Mandarin cadence for commercial and tech announcements.
AUDIO ENGINEERING SPECIFICATIONS

Acoustic & DSP Specifications

Technical signal parameters, dynamic range, container formats, and real-time generation metrics.

Sampling Frequency24,000 HzHigh-fidelity 24kHz sample rate capturing crisp high-frequency sibilance and subtle vocal breath textures.
Bit Depth & Encoding16-bit PCM LinearSigned little-endian linear PCM in standard Microsoft RIFF container. Compatible with all major media frameworks.
Channel Layout1 Channel (Mono)Optimized mono vocal track with 384 kbps raw uncompressed bitrate, ready for studio panning or spatial audio binauralizers.
Real-Time Factor (RTF)0.12× – 0.40×On WebGPU hardware, 10 seconds of studio audio synthesizes in approximately 1.2 to 4.0 seconds (3x - 8x faster than real-time).
Neural Weight Size~82 MB ONNXCompact 82M parameter neural architecture cached permanently in browser Origin Private File System (OPFS) / CacheStorage.
Phonemizer EngineG2P + Neural ConditioningGrapheme-to-phoneme transcription pipeline supporting International Phonetic Alphabet (IPA) tokens across all 9 languages.
BENCHMARK DATA

Hardware Acceleration Benchmarks

Expected synthesis latencies and Real-Time Factor (RTF) across client operating systems and hardware configurations.

Client Hardware / SystemExecution BackendRTF (Lower is Better)First-Chunk LatencyInference Rate
Apple Silicon M3/M4 Max (macOS)
WebGPU (Metal)0.08×~180ms~12.5× faster than real-time
Apple Silicon M1/M2 Air (macOS)
WebGPU (Metal)0.14×~340ms~7.1× faster than real-time
NVIDIA RTX 4080 / 4090 (Windows / Linux)
WebGPU (DirectX 12 / Vulkan)0.06×~150ms~16.6× faster than real-time
Intel Core i7 13th Gen / AMD Ryzen 9
WASM SIMD (AVX2 CPU)0.42×~1,100ms~2.4× faster than real-time
Apple iPhone 15 / 16 Pro (iOS Safari)
WebGPU (Metal)0.22×~560ms~4.5× faster than real-time
Google Pixel 8 / 9 (Android Chrome)
WebGPU (Mali/Adreno)0.32×~780ms~3.1× faster than real-time
INTEGRATION RECIPES

Developer Integration Recipes

Production-ready code examples in Python, Node.js, Shell, Go, Rust, Swift, and Obsidian.

Swap your cloud OpenAI TTS provider with Crematic in three lines of code. No account, API key, or cloud billing required.
from openai import OpenAI

# 1. Point the OpenAI SDK to your local Crematic browser server
client = OpenAI(
    base_url="http://localhost:3000/api/v1",
    api_key="crematic-local"  # Dummy key accepted by local server
)

# 2. Synthesize audio with any of Crematic's 54 voices
response = client.audio.speech.create(
    model="crematic",
    voice="sarah",  # or 'atlas', 'dora-es', 'xiaobei', 'siwis'
    speed=1.0,
    input="The browser executes this neural model on-device via WebGPU."
)

# 3. Stream lossless 24kHz WAV audio directly to disk
response.stream_to_file("output.wav")
print("Audio generated successfully!")
HOW IT WORKS

In-Browser Neural Inference Architecture

How Crematic routes external HTTP calls to your browser hardware with zero cloud latency.

┌────────────────────────────────────────────────────────────────────────┐
│ External Clients                                                       │
│ (cURL / Python OpenAI SDK / Node.js / Obsidian / Terminal scripts)     │
└─────────────────────────────────┬──────────────────────────────────────┘
                                  │ POST http://localhost:3000/api/v1/audio/speech
                                  ▼
┌────────────────────────────────────────────────────────────────────────┐
│ Next.js Local Bridge Relay (src/app/api/v1/)                           │
│   ├── bridge-store.ts (Thread-safe singleton in Node runtime)          │
│   ├── /api/v1/bridge/status (Manual enable/disable control)            │
│   ├── /api/v1/bridge/events (Server-Sent Events connection)            │
│   ├── /api/v1/bridge/fulfill (Binary WAV receiver)                     │
│   ├── /api/v1/voices (54 voices catalog)                               │
│   ├── /api/v1/models (OpenAI model catalog)                            │
│   └── /api/v1/openapi.json (Official OpenAPI 3.1 schema)               │
└─────────────────────────────────┬──────────────────────────────────────┘
                                  │ SSE Job Dispatch (job_123)
                                  ▼
┌────────────────────────────────────────────────────────────────────────┐
│ Crematic Active Browser Tab ("The Server")                             │
│   ├── browser-server.ts (Manual toggle, job listener, fulfillment)     │
│   ├── KokoroEngine (WebGPU / WASM SIMD neural inference on-device)     │
│   ├── encodeWavBuffer (24kHz 16-bit PCM lossless WAV encoder)          │
│   └── Live Telemetry Ring Buffer (Latency, logs, audio blobs)          │
└─────────────────────────────────┬──────────────────────────────────────┘
                                  │ BroadcastChannel("crematic-api-channel")
                                  ▼
┌────────────────────────────────────────────────────────────────────────┐
│ In-Browser Service Worker (public/sw-api-server.js)                    │
│   Intercepts standard 'fetch("/v1/audio/speech")' directly in browser  │
│   with ZERO network traffic!                                           │
└────────────────────────────────────────────────────────────────────────┘
OPENAPI 3.1 / SWAGGER

OpenAPI 3.1 Specification

Download or inspect the official machine-readable OpenAPI schema to import Crematic directly into Postman, Insomnia, or Swagger UI.

openapi.json (OpenAPI 3.1.0)Valid 3.1.0
{
  "openapi": "3.1.0",
  "info": {
    "title": "Crematic In-Browser Neural Speech API",
    "version": "1.0.0",
    "description": "OpenAI-compatible Text-to-Speech API powered by in-browser WebGPU and WASM neural inference. Zero cloud latency, zero cloud cost, 100% private."
  },
  "servers": [
    { "url": "http://localhost:3000/api/v1", "description": "Local In-Browser API Server" }
  ],
  "paths": {
    "/audio/speech": {
      "post": {
        "summary": "Generate Speech from Text",
        "operationId": "generateSpeech",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["input", "voice"],
                "properties": {
                  "model": { "type": "string", "default": "crematic" },
                  "input": { "type": "string", "maxLength": 4096 },
                  "voice": { "type": "string", "enum": ["sarah", "atlas", "dora-es", "...54 voices"] },
                  "speed": { "type": "number", "minimum": 0.7, "maximum": 1.35, "default": 1.0 },
                  "response_format": { "type": "string", "enum": ["wav", "pcm"], "default": "wav" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "24kHz 16-bit PCM RIFF WAV audio binary", "content": { "audio/wav": {} } },
          "400": { "description": "Bad Request" },
          "503": { "description": "Server Offline / No Browser Tab" }
        }
      }
    },
    "/voices": { "get": { "summary": "List All 54 Voices" } },
    "/models": { "get": { "summary": "List Models (OpenAI compatible)" } },
    "/bridge/status": { "get": { "summary": "Check Status" }, "post": { "summary": "Toggle State" } }
  }
}
NETWORKING & SECURITY

Network Permissions, CORS & LAN Reverse Proxy

How to integrate Crematic across your local network (LAN) and configure reverse proxies.

CORS & Private Network Access (PNA)

Crematic includes open CORS headers (Access-Control-Allow-Origin: *) and preflight OPTIONS support so scripts running on any local port (e.g. localhost:8080, localhost:5173) can invoke TTS without browser blocks.

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization

Expose to Local Network (LAN)

To allow other computers, tablets, or smart speakers on your Wi-Fi to synthesize speech, use a simple Nginx or Caddy reverse proxy:

# Caddyfile (Single line LAN proxy):
:8080 {
    reverse_proxy localhost:3000
}
ERROR CODES & RESPONSES

HTTP Status & Error Responses

Exhaustive error codes returned by the bridge relay and in-browser inference engine.

StatusError CodeDescriptionTroubleshooting Action
200 OKSynthesis successful. Body contains raw 24kHz WAV binary.Audio ready for playback or streaming to disk.
400 Bad Requestmissing_inputThe input text field was omitted or empty.Include a non-empty string in your request JSON body.
400 Bad Requestbad_jsonThe request body could not be parsed as valid JSON.Verify headers include Content-Type: application/json and valid JSON.
503 Service Unavailablebrowser_server_disabledThe In-Browser API server is currently toggled OFF.Open the Crematic browser tab and toggle "Enable In-Browser API Server" to ON.
503 Service Unavailablebrowser_worker_offlineNo active Crematic browser tab is open.Open Crematic in any browser window to provide on-device neural compute.
504 Gateway Timeoutbrowser_generation_failedNeural inference exceeded the 45-second timeout window.Shorten the text or ensure device is not under extreme memory exhaustion.
SERVER TELEMETRY

Live Request Stream Log

Real-time feed of API requests processed by your active browser tab in this session.

No API requests served yet in this session. Send a request using the playground or terminal to see live telemetry.
FREQUENTLY ASKED QUESTIONS

Developer FAQ & Troubleshooting

Why do I need to keep the browser tab open?

Traditional cloud voice APIs run on remote GPU clusters costing thousands of dollars per month. Crematic runs 100% on your local machine using WebGPU and WebAssembly SIMD. Your active browser tab holds the neural weights in local memory and executes the tensor math. Keeping the tab open allows it to act as your personal, zero-cost inference server.

How do I prevent the browser from throttling background tabs?

Modern browsers throttle timer events in inactive tabs. Crematic mitigates this by maintaining an active Web AudioContext clock and using dedicated Web Workers for model computation. For uninterrupted 24/7 background operation, keep Crematic in a separate pinned tab or independent desktop window.

Why does my cURL command return 503 Service Unavailable?

For user privacy and CPU preservation, the API server is disabled by default. To start accepting requests, click the "Enable Server" switch at the top of this page. Once enabled, the status will turn green and requests will be processed immediately.

Can I use this offline without an internet connection?

Yes! Once the model weights (~82 MB) are loaded on your machine, both the Crematic studio and the in-browser API server work completely offline. No telemetry, audio data, or text is ever transmitted to external servers.

Is authentication or an API key required?

No API key is required for local calls. You can pass any arbitrary string (such as Authorization: Bearer crematic-local) to satisfy client libraries like the OpenAI Python or Node SDKs.

What is the character limit per request?

The API accepts up to 4,096 characters per request. For longer audiobooks or scripts, we recommend chunking text by paragraphs and making consecutive requests using the Python Async HTTPX or Node.js batch recipes above.