الانتقال إلى المحتوى الرئيسي
POST
/
audio
/
queue
/api/v1/audio/queue
curl --request POST \
  --url https://api.venice.ai/api/v1/audio/queue \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "elevenlabs-music",
  "prompt": "A warm spoken narration introducing a product launch.",
  "lyrics_prompt": "Verse 1: Walking through the city lights...",
  "duration_seconds": 60,
  "force_instrumental": false,
  "lyrics_optimizer": false,
  "voice": "Aria",
  "language_code": "en",
  "speed": 1
}
'
import requests

url = "https://api.venice.ai/api/v1/audio/queue"

payload = {
"model": "elevenlabs-music",
"prompt": "A warm spoken narration introducing a product launch.",
"lyrics_prompt": "Verse 1: Walking through the city lights...",
"duration_seconds": 60,
"force_instrumental": False,
"lyrics_optimizer": False,
"voice": "Aria",
"language_code": "en",
"speed": 1
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'elevenlabs-music',
prompt: 'A warm spoken narration introducing a product launch.',
lyrics_prompt: 'Verse 1: Walking through the city lights...',
duration_seconds: 60,
force_instrumental: false,
lyrics_optimizer: false,
voice: 'Aria',
language_code: 'en',
speed: 1
})
};

fetch('https://api.venice.ai/api/v1/audio/queue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.venice.ai/api/v1/audio/queue",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'elevenlabs-music',
'prompt' => 'A warm spoken narration introducing a product launch.',
'lyrics_prompt' => 'Verse 1: Walking through the city lights...',
'duration_seconds' => 60,
'force_instrumental' => false,
'lyrics_optimizer' => false,
'voice' => 'Aria',
'language_code' => 'en',
'speed' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.venice.ai/api/v1/audio/queue"

payload := strings.NewReader("{\n \"model\": \"elevenlabs-music\",\n \"prompt\": \"A warm spoken narration introducing a product launch.\",\n \"lyrics_prompt\": \"Verse 1: Walking through the city lights...\",\n \"duration_seconds\": 60,\n \"force_instrumental\": false,\n \"lyrics_optimizer\": false,\n \"voice\": \"Aria\",\n \"language_code\": \"en\",\n \"speed\": 1\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.venice.ai/api/v1/audio/queue")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"elevenlabs-music\",\n \"prompt\": \"A warm spoken narration introducing a product launch.\",\n \"lyrics_prompt\": \"Verse 1: Walking through the city lights...\",\n \"duration_seconds\": 60,\n \"force_instrumental\": false,\n \"lyrics_optimizer\": false,\n \"voice\": \"Aria\",\n \"language_code\": \"en\",\n \"speed\": 1\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.venice.ai/api/v1/audio/queue")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"elevenlabs-music\",\n \"prompt\": \"A warm spoken narration introducing a product launch.\",\n \"lyrics_prompt\": \"Verse 1: Walking through the city lights...\",\n \"duration_seconds\": 60,\n \"force_instrumental\": false,\n \"lyrics_optimizer\": false,\n \"voice\": \"Aria\",\n \"language_code\": \"en\",\n \"speed\": 1\n}"

response = http.request(request)
puts response.read_body
{
  "model": "elevenlabs-music",
  "queue_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "QUEUED"
}
{
"error": "<string>",
"details": {
"_errors": [],
"field": {
"_errors": [
"Field is required"
]
}
}
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>",
"suggested_prompt": "A cinematic instrumental track inspired by stormy weather and dramatic tension."
}
{
"error": "<string>"
}
{
"error": "<string>"
}
{
"error": "<string>"
}
استدعِ /audio/quote لتقدير التكلفة، ثم استعلِم /audio/retrieve باستخدام الـ queue_id المُعاد حتى ينتهي التوليد. إذا كنت تحتفظ بالوسائط المُولَّدة بعد الاسترجاع، فاستدعِ /audio/complete بعد تنزيلها.

مجموعة Postman

للمزيد من الأمثلة، يرجى مراجعة مجموعة Postman هذه.

التفويضات

Authorization
string
header
مطلوب

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

الجسم

application/json
model
string
مطلوب

The model to use for audio generation.

مثال:

"elevenlabs-music"

prompt
string
مطلوب

The prompt describing the audio to generate. Minimum and maximum prompt lengths vary by model; inspect /models for min_prompt_length and prompt_character_limit.

Minimum string length: 1
مثال:

"A warm spoken narration introducing a product launch."

lyrics_prompt
string

Optional lyrics/text for lyric-capable models. Required when /models reports lyrics_required=true; unsupported when /models reports supports_lyrics=false.

مثال:

"Verse 1: Walking through the city lights..."

duration_seconds

Optional duration hint in seconds. Only supported for models that expose duration metadata via /models. Accepts either an integer or a numeric string. If omitted, the model default duration is used when available.

النطاق المطلوب: x > 0
مثال:

60

force_instrumental
boolean

Optional instrumental toggle. Only supported when /models reports supports_force_instrumental=true.

مثال:

false

lyrics_optimizer
boolean

When enabled, auto-generates lyrics from the prompt. Only supported when /models reports supports_lyrics_optimizer=true. lyrics_prompt must be empty when this is true.

مثال:

false

voice
string

Optional voice selection for voice-enabled models. See /models?type=music for the model's supported voices and default_voice.

مثال:

"Aria"

language_code
string

Optional ISO 639-1 language code. Only supported when /models reports supports_language_code=true.

مثال:

"en"

speed
number

Optional audio speed multiplier. Only supported when /models reports supports_speed=true; use the model-specific min_speed and max_speed values.

النطاق المطلوب: 0.25 <= x <= 4
مثال:

1

الاستجابة

Audio generation request queued successfully

model
string
مطلوب

The ID of the model used for audio generation.

مثال:

"elevenlabs-music"

queue_id
string
مطلوب

The ID of the audio generation request. Use this to poll for status and retrieve the result.

مثال:

"123e4567-e89b-12d3-a456-426614174000"

status
enum<string>
مطلوب

The status of the audio generation request.

الخيارات المتاحة:
QUEUED
مثال:

"QUEUED"