MyShell Text To Speech
MyShell's Voice Cloning and Text to Speech - Transform your audio content with realistic, personalized voices. Experience high-quality, efficient, and cost-effective audio synthesis.
~6.97s
~$0.006
1import requests
2import json
3
4url = "https://api.segmind.com/v1/myshell-tts"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "voice": "michael",
12 "language": "EN_NEWEST",
13 "text": "Did you ever hear a folk tale about a giant turtle?",
14 "speed": 1
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20 result = response.json()
21 print(json.dumps(result, indent=2))
22else:
23 print(f"Error: {response.status_code}")
24 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/myshell-tts"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "voice": "michael",
12 "language": "EN_NEWEST",
13 "text": "Did you ever hear a folk tale about a giant turtle?",
14 "speed": 1
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20 result = response.json()
21 print(json.dumps(result, indent=2))
22else:
23 print(f"Error: {response.status_code}")
24 print(response.text)API Endpoint
POST
https://api.segmind.com/v1/myshell-ttsParameters
speedrequirednumberSpeed at which the text or audio is processed
Default:
1Range: 0.5 - 2textrequiredstringText to be spoken or processed
Default:
"Did you ever hear a folk tale about a giant turtle?"voicerequiredstringSelect the name of the voice to generate output audio.
Default:
"michael"Allowed values :
"ava""daniel""david""emma""isabella""james""john""michael""olivia""sophia"languageoptionalstringLanguage of the text or audio
Default:
"EN_NEWEST"Allowed values :
"EN_NEWEST""EN""ES""FR""ZH""JP""KR"Response Type
Returns: Audio
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
400
Bad Request
Invalid parameters or request format
401
Unauthorized
Missing or invalid API key
403
Forbidden
Insufficient permissions
404
Not Found
Model or endpoint not found
406
Insufficient Credits
Not enough credits to process request
429
Rate Limited
Too many requests
500
Server Error
Internal server error
502
Bad Gateway
Service temporarily unavailable
504
Timeout
Request timed out