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
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.
http://localhost:3000/api/v1/audio/speechLive API Playground
Dispatch an actual HTTP request against your browser server and inspect the response payload, headers, and audio output.
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.wavAPI Endpoints Reference
Exhaustive schema specification, request parameters, response headers, and payloads for all 6 endpoints.
/api/v1/audio/speechOpenAI CompatibleSynthesizes 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | No | Model alias. Defaults to "crematic". Accepts crematic-tts-1 and crematic-tts-1-hd. |
input | string | Yes | The text script to synthesize (supports up to 4,096 characters per request). |
voice | string | Yes | Any of Crematic's 54 voice IDs (e.g. sarah, atlas, dora-es, xiaobei). |
speed | number | No | Playback speed multiplier between 0.70 and 1.35 (default: 1.0). |
response_format | string | No | Audio format. Returns "wav" (lossless 16-bit PCM at 24kHz) or "pcm". |
/api/v1/voicesCatalog EndpointRetrieves 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
]
}/api/v1/modelsOpenAI CompatibleReturns 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" }
]
}/api/v1/bridge/statusManagement ControlProgrammatic management endpoint to inspect whether the in-browser server is running, check connected browser tabs, and remotely enable or disable the listener.
{
"enabled": true,
"connectedBrowserTabs": 1,
"pendingJobs": 0,
"supportedVoicesCount": 54
}// Body:
{ "enabled": true }
// Returns updated status object/api/v1/bridge/eventsServer-Sent EventsHigh-throughput persistent Server-Sent Events channel connecting your active browser tab to the Node.js relay. Dispatches speech synthesis jobs directly into browser memory.
speech_job: { id: "job_123", input: "...", voice: "sarah", speed: 1.0 }POST /api/v1/bridge/fulfill with header x-job-id: job_123/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.
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.
ariaaf_heartalloyaf_alloyaoedeaf_aoedesanaaf_bellajessicaaf_jessicakoreaf_korenicoleaf_nicolenovaaf_novariveraf_riversarahaf_sarahskyaf_skyatlasam_adamechoam_echoericam_ericfenriram_fenrirliamam_liammichaelam_michaelonyxam_onyxpuckam_pucksantaam_santamirabf_emmaisabellabf_isabellaalicebf_alicelilybf_lilygeorgebm_georgelewisbm_lewisdanielbm_danielfablebm_fabledora-esef_doraalex-esem_alexsanta-esem_santasiwisff_siwisalpha-hihf_alphabeta-hihf_betaomega-hihm_omegapsi-hihm_psisara-itif_saranicolaim_nicolaalpha-jajf_alphagongitsunejf_gongitsunenezumijf_nezumitebukurojf_tebukurokumojm_kumodora-ptpf_doraalex-ptpm_alexsanta-ptpm_santaxiaobeizf_xiaobeixiaonizf_xiaonixiaoxiaozf_xiaoxiaoxiaoyizf_xiaoyiyunjianzm_yunjianyunxizm_yunxiyunxiazm_yunxiayunyangzm_yunyangAcoustic & DSP Specifications
Technical signal parameters, dynamic range, container formats, and real-time generation metrics.
Hardware Acceleration Benchmarks
Expected synthesis latencies and Real-Time Factor (RTF) across client operating systems and hardware configurations.
| Client Hardware / System | Execution Backend | RTF (Lower is Better) | First-Chunk Latency | Inference 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 |
Developer Integration Recipes
Production-ready code examples in Python, Node.js, Shell, Go, Rust, Swift, and Obsidian.
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!")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 Specification
Download or inspect the official machine-readable OpenAPI schema to import Crematic directly into Postman, Insomnia, or Swagger UI.
{
"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" } }
}
}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.
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
}HTTP Status & Error Responses
Exhaustive error codes returned by the bridge relay and in-browser inference engine.
| Status | Error Code | Description | Troubleshooting Action |
|---|---|---|---|
200 OK | — | Synthesis successful. Body contains raw 24kHz WAV binary. | Audio ready for playback or streaming to disk. |
400 Bad Request | missing_input | The input text field was omitted or empty. | Include a non-empty string in your request JSON body. |
400 Bad Request | bad_json | The request body could not be parsed as valid JSON. | Verify headers include Content-Type: application/json and valid JSON. |
503 Service Unavailable | browser_server_disabled | The In-Browser API server is currently toggled OFF. | Open the Crematic browser tab and toggle "Enable In-Browser API Server" to ON. |
503 Service Unavailable | browser_worker_offline | No active Crematic browser tab is open. | Open Crematic in any browser window to provide on-device neural compute. |
504 Gateway Timeout | browser_generation_failed | Neural inference exceeded the 45-second timeout window. | Shorten the text or ensure device is not under extreme memory exhaustion. |
Live Request Stream Log
Real-time feed of API requests processed by your active browser tab in this session.
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.