MikeVoice API

Text-to-speech, transcription, and voice cloning for the MikeOS ecosystem. 646 languages, on MikeOS hardware. Base URL https://voice-api.osmike.com.

AuthenticationTTSVoice tags & speed Language auto-detectJobsTranscription VoicesCloningAudio filesErrors

Authentication

Every /v1/* endpoint requires a caller identity. Two schemes are accepted:

SchemeHeaderNotes
OAuth Bearer (preferred)Authorization: Bearer <JWT>RS256 JWT from account.osmike.com, validated locally via JWKS.
Legacy API keyX-API-KEY: <key>Resolved to a user via account.osmike.com (cached ~5 min).

Missing/invalid credentials → 401. The public audio endpoint (below) needs no auth.

Text-to-Speech

POST /v1/tts
FieldTypeDescription
textstring (required)The text to speak. May contain voice tags.
voicestringA voice id from /v1/voices, one of your cloned ids, or "random" (default → a Quick English voice).
languagestringOptional ISO 639-1 hint. Omit to auto-detect.
speednumber0.5–2.0 (default 1.0).

Short/cached requests render synchronously and return 200; slow ones return 202 with a job_id to poll. Either way the audio is a content-addressed MP3 at url.

curl -X POST https://voice-api.osmike.com/v1/tts \
  -H "X-API-KEY: $KEY" -H 'Content-Type: application/json' \
  -d '{"text":"Welcome to MikeOS.","voice":"expr-voice-2-f","speed":1.0}'

# → {"status":"done","url":"/audio/<md5>.mp3","voice":"expr-voice-2-f",
#    "duration_ms":1840,"cached":0,"new":1}
# or, for a slow render:
# → 202 {"status":"queued","job_id":"…","voice":"…","poll":"/v1/tts/<job_id>"}

Voice tags & speed

Assign voices (and per-span speed) inside one text for dialogue/multi-voice. Text outside a tag uses the request voice. A Designer/cloned span renders as one call for a consistent speaker.

<osmike_voice id="atlas">Hi, I'm Atlas.</osmike_voice>
<osmike_voice id="ivy" speed="1.1">And I'm Ivy!</osmike_voice>
Back to the default narrator here.

Language auto-detection

When you omit language, the input language is detected automatically (all languages). Non-English text is routed to a multilingual voice; an English-only "Quick" voice is upgraded automatically. An explicit language always wins.

Job status

GET /v1/tts/{job_id}
curl https://voice-api.osmike.com/v1/tts/$JOB -H "X-API-KEY: $KEY"
# → {"job_id":"…","status":"queued|processing|done|error",
#    "url":"/audio/<md5>.mp3","duration_ms":154008,"cached":2,"new":24}

Transcription (Speech-to-Text)

POST /v1/stt

multipart/form-data. English-first; the engine handles other languages too.

FieldTypeDescription
audiofile (required)Audio clip (wav/mp3/m4a/webm/ogg…).
languagestringISO 639-1 (default en); auto to detect.
response_formatstringjson (default) · text · srt · vtt · verbose_json.
curl -X POST https://voice-api.osmike.com/v1/stt \
  -H "X-API-KEY: $KEY" -F audio=@clip.wav -F language=en
# → {"text":"…transcribed text…","language":"en"}

Voices

GET /v1/voices

Returns the catalog: Quick (English, fast) + Designer (voice-design) voices, each with {id,name,group,engine,requires_login}. Use an id as the voice in TTS.

Voice cloning

Create a private voice from a reference sample. Only clone your own voice, or a voice you have explicit permission to use — consent is required and recorded.

POST /v1/voices/clone
FieldTypeDescription
namestring (required)A label for the voice.
samplefile (required)~10–30 s reference recording of the voice.
consentfileA short recording of the speaker giving consent.
consent_textstring (required)The spoken consent statement, as text.
attestbool (required)Must be true — you own the voice or have permission.
curl -X POST https://voice-api.osmike.com/v1/voices/clone \
  -H "X-API-KEY: $KEY" \
  -F name="My narration" -F sample=@me.wav \
  -F consent=@consent.wav -F consent_text="I consent to cloning my voice." -F attest=true
# → 201 {"id":"<profile_id>","name":"My narration","kind":"clone"}

# then synthesize with it:
curl -X POST https://voice-api.osmike.com/v1/tts \
  -H "X-API-KEY: $KEY" -H 'Content-Type: application/json' \
  -d '{"text":"Spoken in my cloned voice.","voice":"<profile_id>"}'
GET /v1/voices/mine
DELETE /v1/voices/mine/{profile_id}

List or delete your cloned voices. Deleting also revokes the stored consent. A cloned voice is usable only by the caller who created it (others get 400 unknown voice).

Audio files

GET /audio/{md5}.mp3

Public, no auth — an opaque, content-addressed MP3 (the id is unguessable). This is the url returned by TTS/jobs.

Errors

CodeMeaning
400Bad request (e.g. unknown voice id).
401Missing/invalid auth.
413Text/audio too large (see per-endpoint caps).
422Validation error (missing required field / consent).
429Rate limited — back off and retry.
502 / 503 / 504Engine error / feature unavailable / timeout.

Errors return JSON {"detail":"…"} (or {"error":…,"message":…} for gated flows).