Create a secure API key to authenticate your requests to the MagmaTTS engine.
Generate API Key
API Reference
Integrate MagmaTTS directly into your applications.
MagmaTTS provides a simple, RESTful interface for synthesizing ultra-low latency audio. Our API endpoints are designed to be natively compatible with serverless functions and backend edge services.
IMPORTANT: To guarantee sub-second generation times and prevent server bottlenecking, the /v1/tts endpoint supports a strict maximum of 350 characters per request natively. Developers must implement client-side chunking (e.g., splitting texts by paragraphs or sentences) and request audio generation sequentially or concurrently. Each request consumes your rate limits individually.
GET
/v1/voices
Retrieve a complete list of supported languages and available voices. No authentication required.
curl -X GET https://magma-tts.storycraftpro.me/v1/voices
POST
/v1/tts
Generate streaming-ready audio from text. Requires API key authentication in headers. Max 350 characters.
curl -X POST https://magma-tts.storycraftpro.me/v1/tts \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "MagmaTTS guarantees extreme low latencies, delivering an audio experience that bridges the uncanny valley.",
"language": "en-US",
"voice": "Mia"
}' --output audio.wav
Generate high-quality images from text prompts using Nano Banana or Flux-1-Schnell. Requires API key authentication.
curl -X POST https://magma-tts.storycraftpro.me/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A futuristic cyberpunk city at night",
"model": "nano-banana"
}'
import requests
import base64
url = "https://magma-tts.storycraftpro.me/v1/images/generations"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"prompt": "A futuristic cyberpunk city at night",
"model": "nano-banana"
}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
b64 = data.get('b64_json')
if not b64 and'data'in data andlen(data['data']) > 0:
b64 = data['data'][0].get('b64_json')
if b64:
withopen("generated_image.png", "wb") as f:
f.write(base64.b64decode(b64))
print("✅ Image saved successfully as generated_image.png")
else:
print("❌ No image data found in the response.")
Parameters
prompt(string, required) - The text description of the image you want to generate.