ShopAIKey provides custom TTS endpoints supporting multiple providers: OpenAI, Google Gemini, and MiniMax.
Base URL
https://api.shopaikey.com
Authentication
All endpoints require the header:
Authorization: Bearer <your-api-key>
1. OpenAI TTS
Generate speech in OpenAI-compatible format. The server uploads the audio file to S3 and returns a URL.
Endpoint: POST /tts/openai/speech
Request Body
cURL Example
curl -X POST 'https://api.shopaikey.com/tts/openai/speech' \
-H 'Authorization: Bearer <your-api-key>' \
-H 'Content-Type: application/json' \
-d '{
"input": "Hello, this is a demo voice",
"model": "tts-1",
"voice": "alloy",
"response_format": "mp3",
"speed": 1.0
}'
JavaScript Example
const response = await fetch('https://api.shopaikey.com/tts/openai/speech', {
method: 'POST',
headers: {
'Authorization': 'Bearer <your-api-key>',
'Content-Type': 'application/json',
},
body: JSON.stringify({
input: 'Hello, this is a demo voice',
model: 'tts-1',
voice: 'alloy',
}),
});
const data = await response.json();
console.log(data.url);
Response
{
"url": "https://s3.example.com/audio/abc123.mp3",
"key": "audio/abc123.mp3",
"model": "tts-1",
"voice": "alloy",
"format": "mp3",
"mimeType": "audio/mpeg"
}
2. Google Gemini TTS
Generate speech using Gemini TTS. The server converts PCM to WAV, uploads to S3, and returns a URL.
Endpoint: POST /tts/google/generations
Request Body
cURL Example
curl -X POST 'https://api.shopaikey.com/tts/google/generations' \
-H 'Authorization: Bearer <your-api-key>' \
-H 'Content-Type: application/json' \
-d '{
"text": "Hello, this is a Gemini voice",
"model": "gemini-2.5-flash-preview-tts",
"voice": "Kore"
}'
Response
{
"url": "https://s3.example.com/audio/abc123.wav",
"key": "audio/abc123.wav",
"model": "gemini-2.5-flash-preview-tts",
"voice": "Kore",
"sampleRate": 24000,
"mimeType": "audio/wav"
}
3. MiniMax TTS
3a. Text-to-Audio v2 (Synchronous)
Supports streaming via Server-Sent Events when stream: true.
Endpoint: POST /tts/minimax/t2a_v2
Request Body
cURL Example
curl -X POST 'https://api.shopaikey.com/tts/minimax/t2a_v2' \
-H 'Authorization: Bearer <your-api-key>' \
-H 'Content-Type: application/json' \
-d '{
"model": "speech-02-hd",
"text": "Hello, I am MiniMax TTS",
"voice_setting": {
"voice_id": "male-qn-qingse",
"speed": 1,
"vol": 1,
"pitch": 0
},
"audio_setting": {
"sample_rate": 32000,
"bitrate": 128000,
"format": "mp3"
}
}'
Response (Synchronous)
{
"data": {
"audio": "<hex-encoded-audio>",
"status": 1
},
"extra_info": {},
"trace_id": "abc123",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}
3b. Text-to-Audio v2 (Asynchronous)
Returns a task_id for later querying.
Endpoint: POST /tts/minimax/t2a_async_v2
The request body is the same as the synchronous endpoint.
Response
{
"task_id": "abc123",
"task_token": "token123",
"file_id": "file123",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}
3c. Query T2A Async Task
Endpoint: GET /tts/minimax/query/t2a_async_query_v2?task_id={task_id}
Response
{
"task_id": "abc123",
"status": "Success",
"file_id": "file123",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}
Possible statuses: Processing, Success, Failed, Expired.
3d. Retrieve Audio File
Endpoint: GET /tts/minimax/files/retrieve?file_id={file_id}
Response
{
"file": {
"file_id": "file123",
"bytes": 102400,
"created_at": 1700000000,
"filename": "audio.mp3",
"purpose": "t2a",
"download_url": "https://example.com/download/file123"
},
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}
4. System Voice List (MiniMax)
Returns the system_voice list from MiniMax. Results are cached for 1 hour on the server. No API key required.
Endpoint: GET /tts/minimax/voices
cURL Example
curl -X GET 'https://api.shopaikey.com/tts/minimax/voices'
Response
[
{
"voice_id": "male-qn-qingse",
"voice_name": "青涩青年音色",
"description": ["male", "young"],
"created_time": "2024-01-01T00:00:00Z"
}
]