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/generateAuthentication
Requires OAuth2 Token.
Required Permissions
voice
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Text to convert, max 10000 characters |
| emotion | string | No | Emotion: 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"
}
}| Field | Type | Description |
|---|---|---|
| url | string | Audio file URL (public read, permanently valid) |
| durationMs | number | Audio duration in milliseconds |
| sampleRate | number | Sample rate (Hz) |
| format | string | Audio format |
Error Codes
| Error Code | Description |
|---|---|
| apikey.permission.denied | Missing voice permission |
| tts.text.too_long | Text exceeds 10000 character limit |
| tts.voice_id.not_set | User has not set up voice |