di ElevenLabs

Voce ElevenLabs v4 più veloce, con le stesse 21 voci e oltre 90 lingue

elevenlabs/v4-turbo/text-to-speech
ElevenLabs v4 Turbo: generatore di voce IA online
  • 21 voci
  • 91 lingue
  • Sintesi vocale

Lo chiami con il nome di modello elevenlabs/v4-turbo/text-to-speech su POST /jobs/createTask, da 0,048 USD.

Nome del modelloelevenlabs/v4-turbo/text-to-speech
EndpointPOST https://api.popnow.ai/api/v1/jobs/createTask
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "elevenlabs/v4-turbo/text-to-speech",
  "input": {
    "text": "Welcome back. Your files finished rendering a minute ago and are ready to download.",
    "voice_id": "Roger",
    "language": "auto"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

L’input è costruito dallo schema qui sotto, quindi supera la verifica così com’è. Sostituisci prompt e link con i tuoi.

Prezzo

OpzioneUSD ogni 1.000 caratteri
Standard0,048 USD

Addebiti in USD · Tutte le opzioni e i prezzi: GET /models/elevenlabs/v4-turbo/text-to-speech

Limiti

Lunghezza del testo (caratteri)
10,000
Voci
21
Lingue
91

Parametri

Questi campi vengono dallo stesso schema con cui verifichiamo ogni richiesta. I campi non elencati vengono rifiutati.

  • textstringObbligatorio

    Le parole da pronunciare, esattamente come sono scritte.

    Intervallo
    Numero di caratteri: 1 – 10000
  • voice_idstringFacoltativo

    Scegli tra le voci disponibili.

    Predefinito
    "Roger"
    Valori ammessi
    "Adam""Alice""Bella""Bill""Brian""Callum""Charlie""Chris""Daniel""Eric""George""Harry""Jessica""Laura""Liam""Lily""Matilda""River""Roger""Sarah""Will"
  • languagestringFacoltativo

    La lingua del parlato.

    Predefinito
    "auto"
    Valori ammessi
    "auto""af""am""ar""hy""as""ast""az""be""bn""bs""bg""my""yue""ca""ceb""hr""cs""da""nl""en""et""fil""fi""fr""ff""gl""ka""de""el""gu""ha""he""hi""hu""is""id""it""ja""jv"+52
  • stabilitynumberFacoltativo

    Quanto è stabile la lettura. Più basso è più espressivo e variabile.

    Predefinito
    0.5
    Intervallo
    0 – 1
  • similarity_boostnumberFacoltativo

    Quanto il parlato resta fedele alla voce scelta.

    Predefinito
    0.75
    Intervallo
    0 – 1
  • output_formatstringFacoltativo

    Tipo di file del risultato.

    Predefinito
    "mp3_44100_128"
    Valori ammessi
    "mp3_44100_128""mp3_44100_64""mp3_22050_32""opus_48000_128""pcm_24000""pcm_16000""wav_44100""ulaw_8000""alaw_8000"
  • text_normalization_modestringFacoltativo

    Se numeri, date e abbreviazioni vengono scritti per esteso prima della lettura.

    Predefinito
    "auto"
    Valori ammessi
    "auto""on""off"
  • clone_strengthnumberFacoltativo

    Quanto viene applicato un clone vocale professionale. Nessun effetto sulle voci predefinite.

    Intervallo
    0 – 1
  • seedintegerFacoltativo

    Usa lo stesso seed e le stesse impostazioni per confrontare le varianti in modo più controllato.

    Intervallo
    0 – 4294967295
JSON Schema completo
{
  "type": "object",
  "required": [
    "text"
  ],
  "properties": {
    "seed": {
      "type": "integer",
      "maximum": 4294967295,
      "minimum": 0,
      "description": "Random seed for controlled comparisons."
    },
    "text": {
      "type": "string",
      "maxLength": 10000,
      "minLength": 1,
      "description": "The words to speak. Audio tags such as [whispers] or [sighs] are performed, not read. Billed per 1,000 characters. Up to 10,000 characters; about 5,000 or fewer keeps a long read from being cut off."
    },
    "language": {
      "enum": [
        "auto",
        "af",
        "am",
        "ar",
        "hy",
        "as",
        "ast",
        "az",
        "be",
        "bn",
        "bs",
        "bg",
        "my",
        "yue",
        "ca",
        "ceb",
        "hr",
        "cs",
        "da",
        "nl",
        "en",
        "et",
        "fil",
        "fi",
        "fr",
        "ff",
        "gl",
        "ka",
        "de",
        "el",
        "gu",
        "ha",
        "he",
        "hi",
        "hu",
        "is",
        "id",
        "it",
        "ja",
        "jv",
        "kam",
        "kn",
        "kk",
        "ko",
        "ky",
        "lo",
        "lv",
        "ln",
        "lt",
        "lg",
        "lb",
        "mk",
        "ms",
        "ml",
        "mt",
        "zh",
        "mi",
        "mr",
        "mn",
        "ne",
        "no",
        "oc",
        "or",
        "ps",
        "fa",
        "pl",
        "pt",
        "pa",
        "ro",
        "ru",
        "sr",
        "sn",
        "sd",
        "sk",
        "sl",
        "so",
        "ckb",
        "es",
        "sw",
        "sv",
        "tg",
        "ta",
        "te",
        "th",
        "tr",
        "uk",
        "ur",
        "uz",
        "vi",
        "cy",
        "wo",
        "zu"
      ],
      "type": "string",
      "default": "auto",
      "description": "Language to enforce, as an ISO code, or auto to detect it from the text."
    },
    "voice_id": {
      "enum": [
        "Adam",
        "Alice",
        "Bella",
        "Bill",
        "Brian",
        "Callum",
        "Charlie",
        "Chris",
        "Daniel",
        "Eric",
        "George",
        "Harry",
        "Jessica",
        "Laura",
        "Liam",
        "Lily",
        "Matilda",
        "River",
        "Roger",
        "Sarah",
        "Will"
      ],
      "type": "string",
      "default": "Roger",
      "description": "Preset voice."
    },
    "stability": {
      "type": "number",
      "default": 0.5,
      "maximum": 1,
      "minimum": 0,
      "description": "How steady the delivery is, 0 to 1. Lower is more expressive and more variable."
    },
    "output_format": {
      "enum": [
        "mp3_44100_128",
        "mp3_44100_64",
        "mp3_22050_32",
        "opus_48000_128",
        "pcm_24000",
        "pcm_16000",
        "wav_44100",
        "ulaw_8000",
        "alaw_8000"
      ],
      "type": "string",
      "default": "mp3_44100_128",
      "description": "Audio container, sample rate and bitrate. pcm is raw audio without a file header."
    },
    "clone_strength": {
      "type": "number",
      "maximum": 1,
      "minimum": 0,
      "description": "Strength of a professional voice clone, 0 to 1. Has no effect on preset voices."
    },
    "similarity_boost": {
      "type": "number",
      "default": 0.75,
      "maximum": 1,
      "minimum": 0,
      "description": "How closely the speech follows the selected voice, 0 to 1."
    },
    "text_normalization_mode": {
      "enum": [
        "auto",
        "on",
        "off"
      ],
      "type": "string",
      "default": "auto",
      "description": "Whether numbers, dates and abbreviations are spelled out before reading."
    }
  },
  "additionalProperties": false
}

Un risultato reale di ElevenLabs v4 Turbo

PromptWelcome to Fieldnote. Tap the microphone and just start talking. We'll turn what you say into a tidy note, with your to-dos pulled out at the top. Nothing is final, so ramble as much as you like.
La stessa richiesta tramite API
{
  "model": "elevenlabs/v4-turbo/text-to-speech",
  "input": {
    "text": "Welcome to Fieldnote. Tap the microphone and just start talking. We'll turn what you say into a tidy note, with your to-dos pulled out at the top. Nothing is final, so ramble as much as you like.",
    "voice_id": "Sarah",
    "language": "auto",
    "stability": 0.6
  }
}

Risposte, polling e callback

Tutti i modelli funzionano allo stesso modo: crei un task, poi lo interroghi o aspetti la callback.

Prima il prezzo

cURL
curl -X POST https://api.popnow.ai/api/v1/jobs/quote \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "elevenlabs/v4-turbo/text-to-speech",
  "input": {
    "text": "Welcome back. Your files finished rendering a minute ago and are ready to download.",
    "voice_id": "Roger",
    "language": "auto"
  }
}'

Prima di eseguire, invia lo stesso corpo della richiesta a POST /jobs/quote per vedere il costo stimato e quello massimo in USD. Il preventivo non esegue alcuna richiesta né addebita il saldo.

Accettata

HTTP
HTTP/1.1 202 Accepted

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "state": "queued"
  },
  "request_id": "req_example_create"
}

HTTP 202 indica che la richiesta è stata accettata: il massimo in USD resta riservato fino al conteggio finale. Quando una richiesta viene accettata, riserviamo l’importo massimo del preventivo sul tuo saldo PopNow. Al termine addebitiamo l’uso effettivo, senza superare la riserva, e liberiamo il resto. Se la richiesta fallisce, l’importo riservato viene sbloccato.

Controlla lo stato

cURL
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Controlla ogni pochi secondi allungando via via l’intervallo e fermati quando state è succeeded, failed, canceled o expired.

Task completato

JSON
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "model": "elevenlabs/v4-turbo/text-to-speech",
    "state": "succeeded",
    "output": {
      "assets": [
        {
          "url": "https://cdn.popnow.ai/tasks/task_01k3m8x9q2z4v7n5p6r8s0t1w3/output.mp3?signature=FROM_RESPONSE",
          "expiresAt": "2026-10-17T12:20:00Z",
          "mime": "audio/mpeg",
          "durationSeconds": 30
        }
      ]
    },
    "settled": true
  },
  "request_id": "req_example_record"
}

Scarica dall’url prima di expiresAt. Ti serve un link nuovo più tardi? Chiedilo con POST /common/download-url.

Verifica una callback

Node.js
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const app = express();
// express.raw keeps the exact bytes that were signed; express.json would not match.
app.post("/hooks/popnow", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.header("X-Webhook-Timestamp");
  const signature = req.header("X-Webhook-Signature") ?? "";
  const body = JSON.parse(req.body.toString("utf8"));
  const taskId = body.data?.taskId ?? body.task_id;
  const digest = createHash("sha256").update(req.body).digest("hex");
  const expected = createHmac("sha256", process.env.POPNOW_WEBHOOK_SECRET)
    .update(`${taskId}.${timestamp}.${digest}`)
    .digest("base64");
  const ok = expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
  // Check the signature first, then reject anything older than five minutes.
  if (!ok || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.status(401).end();
  res.status(200).end(); // answer fast, then fetch the task and store its files
});

Con callBackUrl impostata ti inviamo il task completato. Verifica la firma sul corpo originale della richiesta prima di elaborarlo.

Invia un file locale

cURL
curl -X POST https://api.popnow.ai/api/v1/common/upload-url \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType": "image/png", "bytes": 482113}'

# PUT the file bytes to data.uploadUrl with every header in data.headers, then commit it:
curl -X POST https://api.popnow.ai/api/v1/files/$FILE_ID/commit \
  -H "Authorization: Bearer $POPNOW_API_KEY"
# The commit returns a popnow://f/... reference. Put it in any image, video or
# audio field of the task input instead of a public https URL.

I link https pubblici funzionano così come sono. I file locali passano prima da upload-url e commit.