SecondMeSecondMe API
SecondMe API

Text-to-Speech (TTS)

Convert text to speech audio

Text-to-Speech endpoints.

Base URL: https://api.mindverse.com/gate/lab


Text-to-Speech (TTS)

Convert text to speech audio and return a public URL for the audio file.

POST /api/secondme/tts/generate

Authentication

Requires OAuth2 Token.

Required Permissions

voice

Request Parameters

ParameterTypeRequiredDescription
textstringYesText to convert, max 10000 characters
emotionstringNoEmotion: happy/sad/angry/fearful/disgusted/surprised/calm/fluent (default)

Note: Voice ID is automatically retrieved from user info. Users must set up their voice in SecondMe before using the TTS feature.

Request Example

curl -X POST "https://api.mindverse.com/gate/lab/api/secondme/tts/generate" \
  -H "Authorization: Bearer lba_at_your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello, this is a test speech",
    "emotion": "fluent"
  }'

Response

Success (200)

{
  "code": 0,
  "data": {
    "url": "https://cdn.example.com/tts/audio_12345.mp3",
    "durationMs": 2500,
    "sampleRate": 24000,
    "format": "mp3"
  }
}
FieldTypeDescription
urlstringAudio file URL (public read, permanently valid)
durationMsnumberAudio duration in milliseconds
sampleRatenumberSample rate (Hz)
formatstringAudio format

Error Codes

Error CodeDescription
apikey.permission.deniedMissing voice permission
tts.text.too_longText exceeds 10000 character limit
tts.voice_id.not_setUser has not set up voice