API Reference
tuen API Documentation
Generate images, convert text to speech, and transcribe audio using simple REST endpoints. Perfect for n8n, Zapier, Make.com, or any custom integration.
Quick Start
Every user gets an API key automatically. You can find it in your Dashboard → API Keys.
Get your API key
Sign in and go to API Keys. Copy your key — it starts with tuen_sk_.
Make your first request
Send a POST request with your key in the Authorization header.
curl -X POST https://your-domain.com/api/services/image_gen \
-H "Authorization: Bearer tuen_sk_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "a futuristic city at sunset"}'Use the response
The API returns a JSON object with the result URL. For images: image_url. For audio: audio_url.
Authentication
All API requests require an Authorization header with your API key.
Authorization: Bearer tuen_sk_xxxxxxxxxxxxxxxx
Security tip: Never expose your API key in client-side code or public repositories. Use environment variables.
/api/services/image_gen1 requestGenerate stunning images from text prompts using FLUX and Stable Diffusion models.
Request body
prompt *stringWhat to generate. Be descriptive for best results.aspect_ratiostring"1:1", "16:9", "9:16", "4:3", "3:4". Default: "1:1"stylestring"none" or "anime". Default: "none"modelstring"black-forest-labs/FLUX.1-schnell", "black-forest-labs/FLUX.1-dev", "fal-ai/flux-pro"Example request
curl -X POST https://your-domain.com/api/services/image_gen \
-H "Authorization: Bearer tuen_sk_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a futuristic cyberpunk city at sunset, neon lights, 8k detail",
"aspect_ratio": "16:9",
"style": "none",
"model": "black-forest-labs/FLUX.1-schnell"
}'Response
{
"image_url": "https://cdn.example.com/output/image.webp",
"success": true
}Tip: Use aspect_ratio: "1:1" for profile pictures,"9:16" for mobile wallpapers, and "16:9" for desktop backgrounds.
/api/services/tts1 requestConvert any text into natural-sounding speech with multiple voice options.
Request body
text *stringText to convert to speech. Max 500 characters per request.voicestring"en-Carter_man", "en-Emily_woman", "en-James_man", "en-Sarah_woman". Default: "en-Carter_man"modelstring"vibevoice", "parler-tts/parler-tts-mini-v1". Default: "vibevoice"Example request
curl -X POST https://your-domain.com/api/services/tts \
-H "Authorization: Bearer tuen_sk_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"text": "Welcome to the future of AI. Everything you need is just one API call away.",
"voice": "en-Emily_woman"
}'Response
{
"audio_url": "https://cdn.example.com/output/audio.mp3",
"success": true
}Voice reference: Carter & James are male voices. Emily & Sarah are female voices. Carter and Emily have a neutral American accent. James is deeper, Sarah is softer.
/api/services/transcribe1 requestConvert audio files to text using Whisper-class models. Supports mp3, wav, and m4a formats.
Request body
audio_url *stringDirect public URL to the audio file (mp3, wav, m4a).languagestring"en", "es", "fr", "de", "it", "ja", "zh". Default: "en"modelstring"distil-whisper/distil-large-v3", "openai/whisper-large-v3", "meta-llama/seamless-m4t-v2-large"Example request
curl -X POST https://your-domain.com/api/services/transcribe \
-H "Authorization: Bearer tuen_sk_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"audio_url": "https://example.com/podcast-episode.mp3",
"language": "en",
"model": "distil-whisper/distil-large-v3"
}'Response
{
"text": "Welcome to today's episode. We're going to talk about artificial intelligence and its impact on society.",
"success": true
}Note: The audio file must be publicly accessible via a direct URL. If your file is private, upload it to a temporary hosting service first (like tmp.link or catbox.moe).
n8n Integration Guide
Connect tuen to your n8n workflows to automate image generation, voice synthesis, and transcription.
Add an HTTP Request node
In n8n, drag an HTTP Request node into your workflow.
Configure the request
Set these fields:
POSThttps://your-domain.com/api/services/image_genGeneric Credential Type → Header AuthAuthorizationBearer tuen_sk_xxxxxxxxxxxxxxxxSet the JSON body
Switch the body type to JSON and paste:
{
"prompt": "{{ $json.prompt }}",
"aspect_ratio": "1:1"
}Use the output
The node returns image_url (or audio_url / text). Access it with {{ $json.image_url }} in the next node.
Pro tip: Create a Credential in n8n with your tuen API key so you can reuse it across multiple workflows without copying the key each time.
Errors & Rate Limits
All errors return a JSON body with an error field. Failed requests are not counted against your limits — you never pay for errors.
Error codes
401Unauthorized — missing or invalid API key402Limit reached — wait for reset or upgrade your plan429Rate limit exceeded — slow down or upgrade for higher limits500Generation failed — not counted against your limitsUsage limits
{
"error": "Daily limit reached (200/200). Resets in ~3h.",
"code": 429
}