# Eleven V4 API Complete API reference for ElevenLabs Eleven V4 text-to-speech models. ## Model Variants | Model | Description | | ----- | ----------- | | `elevenlabs-eleven-v4` | Generate speech with Eleven V4 | | `elevenlabs-eleven-v4-turbo` | Generate speech with Eleven V4 Turbo | ## Endpoints ```text POST /api/v1/music/task GET /api/v1/music/{task_id} ``` ## Required Parameters | Parameter | Type | Description | | --------- | ---- | ----------- | | `model_name` | string | Must be `elevenlabs-eleven-v4` or `elevenlabs-eleven-v4-turbo`. | | `prompt` | string | Text to convert to speech. Required; supports 1 to 10,000 characters. | ## Optional Parameters | Parameter | Type | Description | | --------- | ---- | ----------- | | `voice_id` | string | A preset voice name or an official ElevenLabs voice ID. Defaults to `Alicia`. Supported preset names: `Adam`, `Alice`, `Aria`, `Baxter`, `Bella`, `Bill`, `Brian`, `Caleb`, `Callum`, `Charlie`, `Charlotte`, `Chris`, `Clyde`, `Daniel`, `Darian`, `Dave`, `Dorothy`, `Drew`, `Eddie`, `Elara`, `Eldrin`, `Elowen`, `Emily`, `Eric`, `Ethan`, `Fin`, `Finley`, `Florence`, `Freya`, `George`, `Gigi`, `Giovanni`, `Glinda`, `Grace`, `Harry`, `Jade`, `James`, `Jeremy`, `Jessica`, `Jessie`, `Joseph`, `Kaelen`, `Laura`, `Lawrence`, `Liam`, `Lily`, `Maisie`, `Matilda`, `Michael`, `Mimi`, `Nicole`, `Patrick`, `Paul`, `River`, `Roger`, `Sarah`, `Sawyer`, `Serena`, `Talia`, `Thomas`, `Warren`, `Will`, `Wyatt`, and `Alicia`. | | `stability` | number | Speech stability from `0` to `1`. Defaults to `0.5`. Lower values allow more expressive variation; higher values produce more stable delivery. | | `similarity` | number | Voice similarity from `0` to `1`. Defaults to `0.75`. Higher values make the generated voice closer to the selected voice. | ## Example Request ```javascript const response = await fetch('https://api.flaq.ai/api/v1/music/task', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model_name: 'elevenlabs-eleven-v4', prompt: 'Welcome to Flaq.ai. Let us make something great together.', voice_id: 'Alicia', stability: 0.5, similarity: 0.75, }), }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Response Format ### Task Submission ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/music/{task_id}", "task_status": "submitted" } } ``` ### Query Task Status ```javascript const response = await fetch('https://api.flaq.ai/api/v1/music/{task_id}', { headers: { Authorization: 'Bearer YOUR_API_KEY' }, }); const { data } = await response.json(); console.log(data.task_status); ``` ### Completed Task ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/music/{task_id}", "task_status": "succeed", "task_status_msg": null, "task_result": { "audios": [{ "url": "https://example.com/generated-speech.mp3" }] } } } ``` ### Task Status Values - `submitted`: The task has been submitted. - `processing`: The task is being processed. - `succeed`: The task completed successfully. - `failed`: The task failed.