Kejue Inference
Generate speech and transcribe audio with Kejue speech models, over HTTP or a live WebSocket.
Kejue Inference gives you speech generation and transcription directly from your code, over HTTP, asynchronous file jobs, or a live WebSocket. Use it for narration, transcription, or your own conversation application. If you want an agent that answers calls, start with Kejue Voice.
Inference must be enabled for your workspace, with published model names and available credit. If you cannot access it, ask us to help. Your workspace’s credit and limits apply. See Access and API keys.
Make your first request
Create an Inference key
In Settings → API keys, choose Kejue Inference and grant
inference-models:read, inference-voices:read, and inference-tts:create.
Voice keys can't call Inference, and Inference keys can't call Voice.
export KEJUE_API_BASE="https://api.kejue.co/v1"
export KEJUE_INFERENCE_KEY="kejue_<prefix>_<secret>"Find a model and a voice
Start with the catalog. It lists the model names available to your workspace and the voices approved for each one:
curl --fail-with-body "$KEJUE_API_BASE/inference/models" \
-H "Authorization: Bearer $KEJUE_INFERENCE_KEY"
curl --fail-with-body "$KEJUE_API_BASE/inference/voices?model=MODEL_NAME" \
-H "Authorization: Bearer $KEJUE_INFERENCE_KEY"Pick a model whose kind is tts. Use its public name and a voice id
from its list; the voice ID is a platform UUID.
Generate speech
curl --fail-with-body -X POST "$KEJUE_API_BASE/inference/audio/speech" \
-H "Authorization: Bearer $KEJUE_INFERENCE_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 018f4d7c-1a2b-7c3d-8e4f-0a1b2c3d4e5f" \
--data '{
"model": "MODEL_NAME",
"voice": "VOICE_ID",
"input": "Welcome to Acme Bank. How can I help you today?"
}' \
--output speech.pcmThe response is raw 16 kHz, 16-bit mono PCM. Play it with
play -t raw -r 16000 -e signed -b 16 -c 1 speech.pcm (SoX), or add a WAV
header before saving it as a .wav file.
Connect a backend over WebSocket
For live speech, connect directly with your Inference API key in the
Authorization: Bearer … handshake header. Pass the model and session options
in query parameters; no token minting request is needed.
- Live text to speech: stream text in and receive audio.
- Live speech to text: stream audio in and receive transcripts.
For browser clients, keep the key on your backend and use a one-use session token.
Try it in the dashboard
Switch product to Kejue Inference at the top of the dashboard sidebar.
| Page | What you can do |
|---|---|
| Text to speech → Studio | Pick a model and voice, enter text, and listen as it generates. Replay or download WAV. |
| Text to speech → Voices | Search approved voices by name, language, or dialect. Playing a sample uses no credit. Use voice opens Studio. |
| Speech to text → Studio | Transcribe a short file, use your microphone, or submit a long file job with durable history and optional aligned word times when the model supports it. |
| Manage → Usage | Minute balances, limits, usage trends, time to first output, and recent request status. Charts use UTC days. |
Download generated speech and short-file transcripts you want to keep before leaving Studio. Submitted file transcription jobs continue in the background and retain results until their stated expiry; reopening Studio shows their durable history. The usage ledger keeps request metadata and durations separately from retained transcript content.
About model names
Names such as kejue-tts are public request handles. We can update the
compatible model behind a name without changing your integration; each
request keeps its own model selection. Only voices approved for that model
appear in its voice list.