{"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 inference cost, and 100% private.","contact":{"name":"Crematic Audio Technologies","url":"http://localhost:3000/api-docs"}},"servers":[{"url":"http://localhost:3000/api/v1","description":"Local In-Browser API Server"}],"paths":{"/audio/speech":{"post":{"summary":"Generate Speech from Text","description":"Synthesizes 24,000 Hz studio audio from an input text prompt using the specified neural persona. OpenAI-compatible request and response format.","operationId":"generateSpeech","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechRequest"}}}},"responses":{"200":{"description":"Lossless 24kHz 16-bit PCM RIFF WAV audio binary","headers":{"Content-Type":{"schema":{"type":"string","example":"audio/wav"}},"X-Crematic-Voice":{"schema":{"type":"string","example":"sarah"}},"X-Crematic-Latency-MS":{"schema":{"type":"string","example":"382ms"}}},"content":{"audio/wav":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request (Missing or invalid input parameters)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Service Unavailable (Browser server disabled or no connected browser tab)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"504":{"description":"Gateway Timeout (Inference took longer than 45 seconds)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/voices":{"get":{"summary":"List All Available Neural Voices","description":"Retrieves metadata for all 54 neural voices across 9 language families with IDs, accents, styles, and sample previews.","operationId":"listVoices","responses":{"200":{"description":"List of 54 neural voice profiles","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceListResponse"}}}}}}},"/models":{"get":{"summary":"List Models (OpenAI Compatible)","description":"Returns the available speech model identifiers.","operationId":"listModels","responses":{"200":{"description":"List of available models","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelListResponse"}}}}}}},"/bridge/status":{"get":{"summary":"Check In-Browser Bridge Status","description":"Returns whether the in-browser server is enabled, number of connected browser tabs, and queued requests.","operationId":"getBridgeStatus","responses":{"200":{"description":"Current bridge server status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeStatusResponse"}}}}}},"post":{"summary":"Toggle In-Browser Server State","description":"Programmatically enable or disable the in-browser speech server.","operationId":"toggleBridgeStatus","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Desired server state"}},"required":["enabled"]}}}},"responses":{"200":{"description":"Updated server status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeStatusResponse"}}}}}}}},"components":{"schemas":{"SpeechRequest":{"type":"object","required":["input","voice"],"properties":{"model":{"type":"string","description":"Model alias","default":"crematic","enum":["crematic","crematic-tts-1","crematic-tts-1-hd"]},"input":{"type":"string","description":"The text script to synthesize into speech","maxLength":4096,"example":"Experience on-device neural voice synthesis through the Crematic In-Browser API."},"voice":{"type":"string","description":"Unique voice identifier (any of the 54 available voices)","enum":["aria","alloy","aoede","sana","jessica","kore","nicole","nova","river","sarah","sky","atlas","echo","eric","fenrir","liam","michael","onyx","puck","santa","mira","isabella","alice","lily","george","lewis","daniel","fable","dora-es","alex-es","santa-es","siwis","alpha-hi","beta-hi","omega-hi","psi-hi","sara-it","nicola","alpha-ja","gongitsune","nezumi","tebukuro","kumo","dora-pt","alex-pt","santa-pt","xiaobei","xiaoni","xiaoxiao","xiaoyi","yunjian","yunxi","yunxia","yunyang"],"example":"sarah"},"speed":{"type":"number","description":"Playback speed multiplier","minimum":0.7,"maximum":1.35,"default":1,"example":1},"response_format":{"type":"string","description":"Desired output audio format","default":"wav","enum":["wav","pcm"]}}},"Voice":{"type":"object","properties":{"id":{"type":"string","example":"sarah"},"name":{"type":"string","example":"Sarah"},"style":{"type":"string","example":"Conversational & expressive"},"accent":{"type":"string","example":"English (US)"},"description":{"type":"string"},"engineVoiceId":{"type":"string","example":"af_sarah"},"previewUrl":{"type":"string","example":"/previews/sarah.m4a"}}},"VoiceListResponse":{"type":"object","properties":{"object":{"type":"string","example":"list"},"total":{"type":"integer","example":54},"voices":{"type":"array","items":{"$ref":"#/components/schemas/Voice"}}}},"Model":{"type":"object","properties":{"id":{"type":"string","example":"crematic"},"object":{"type":"string","example":"model"},"owned_by":{"type":"string","example":"crematic"}}},"ModelListResponse":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}}},"BridgeStatusResponse":{"type":"object","properties":{"enabled":{"type":"boolean"},"connectedBrowserTabs":{"type":"integer"},"pendingJobs":{"type":"integer"},"supportedVoicesCount":{"type":"integer"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":"string"}}}}}}}}