Skip to content
Navigation

Generate speech from text

Generate audio from text.

Drop-in replacement for OpenAI /v1/audio/speech. Routes to Gemini when the model is a Gemini TTS variant (e.g. google/gemini-2.5-flash-tts); any other model goes through the OpenAI proxy.

Accepts tri-mode auth (user token / service+on-behalf-of / service-only) — the service-key path is required for backend callers like BlinkLife that proxy TTS previews to TIE on a user's behalf.

POST
https://truememory-api.mvstg.com/v1/audio/speech
View as Markdown

Authorization

  • HTTPBearerHTTPrequired

Header parameters

  • X-On-Behalf-Ofoptional

    One of the following:

    • string
    • null
  • X-External-User-Idoptional

    One of the following:

    • string
    • null
  • X-App-Idoptional

    One of the following:

    • string
    • null

Request bodyJSONrequired

  • inputstringrequired

    Text to convert to speech

    maxLength: 4000 · minLength: 1
  • modeloptionalstring

    TTS model to use

    maxLength: 100 · minLength: 1 · default: "gpt-4o-mini-tts"
  • voiceoptionalstring

    Voice to use

    maxLength: 100 · minLength: 1 · default: "alloy"
  • response_formatoptionalmp3oropusoraacorflacorwavorpcm
    default: "mp3"
  • speedoptionalnumber
    maximum: 4 · minimum: 0.25 · default: 1
  • languageoptional

    Language code (Gemini only, e.g. 'en', 'ms', 'en-US')

    One of the following:

    • string
    • null

Returns

200

The generated audio as raw bytes — this response is a binary audio stream, not JSON. The Content-Type reflects the format the provider returned.

422

Validation Error
JSON
  • detailoptionalarray ofobject
    • locarray ofrequired

      One of the following:

      • string
      • integer
    • msgstringrequired
    • typestringrequired
    • inputoptionalunknown
    • ctxoptionalobject

Type to search…

↑↓ navigate↵ selectEsc close