AI Workers
Aura 2 EN (TTS) (Text to Speech)
Convert text to natural-sounding speech via the Linconwaves AI Workers API.
Aura 2 EN (TTS) is a text-to-speech model (slug: aura-2-en). It turns input text into naturally spoken audio.
Use it for voice agents, audio responses, and accessibility.
Endpoint
- URL:
POST /:modelSlugwithmodelSlug = aura-2-en - Auth:
Authorization: Bearer <api_key> - Content-Type:
application/json - Base URL:
https://aiworker.linconwaves.com
Request
Send JSON with the text to synthesize.
{
"text": "Welcome to Linconwaves AI Workers."
}Notes:
- Keep payload small (couple paragraphs) for the fastest response.
- Use UTF-8 text only; SSML is not supported in this model variant.
Response
There are two common success formats depending on environment:
- Binary audio stream (recommended):
Content-Type: audio/mpeg(or other audio/*). Save bytes directly (e.g.,curl --output file.mp3). - Base64 audio string: a long base64 blob like
/+NoxAAAAA.... Decode it into bytes to play or save.
Example binary headers:
Content-Type: audio/mpegX-Attachment-Url(when the backend uploaded the generated audio)X-Attachment-Type: audio
Curl example
curl -X POST https://aiworker.linconwaves.com/aura-2-en \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
--data '{"text": "Welcome to Linconwaves AI Workers."}' \
--output aura-2-en.mp3JavaScript (fetch)
const resp = await fetch('https://aiworker.linconwaves.com/aura-2-en', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${process.env.API_KEY}`,
},
body: JSON.stringify({
"text": "Welcome to Linconwaves AI Workers."
}),
});
if (!resp.ok) {
const err = await resp.json().catch(() => ({}));
throw new Error(err.error || `Request failed (${resp.status})`);
}
// Save audio
const buf = await resp.arrayBuffer();Decoding a base64 response (if returned as text)
// Suppose `base64Audio` is the long string like "/+NoxAAAAA..."
const base64Audio = '...';
const binary = atob(base64Audio);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
const blob = new Blob([bytes], { type: 'audio/mpeg' });
const url = URL.createObjectURL(blob);
// use `url` in an <audio> tag or downloadError codes
401 Unauthorized— Missing/invalid API key.400 Bad Request— Invalid payload (e.g., notextfield).499 Client Closed Request— Request aborted by client.500— Upstream model error or unexpected failure.
Backend snippets
const BASE = 'https://aiworker.linconwaves.com';
const API_KEY = process.env.AIWORKER_API_KEY!;
const payload = {
"text": "Welcome to Linconwaves AI Workers."
};
const res = await fetch(`${BASE}/aura-2-en`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${API_KEY}` ,
},
body: JSON.stringify(payload),
});
const data = await res.json();
console.log(data);Frontend snippets
// app/api/aiworker/route.ts
const BASE = 'https://aiworker.linconwaves.com';
const API_KEY = process.env.AIWORKER_API_KEY!;
export async function POST(req: Request) {
const payload = await req.json();
const res = await fetch(`${BASE}/aura-2-en`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${API_KEY}` ,
},
body: JSON.stringify(payload),
});
return new Response(await res.text(), { status: res.status, headers: res.headers });
}Related
- Playground usage: Dashboard → Playground → select “Aura 2 EN (TTS)”, enter text, and download the audio.