Last updated 14 days ago
Was this helpful?
const main = async () => { const params = new URLSearchParams({ generation_id: "<YOUR_GENERATION_ID>" }); const response = await fetch(`https://api.aimlapi.com/v2/generate/audio?${params.toString()}`, { method: 'GET', headers: { Authorization: 'Bearer <YOUR_API_KEY>', 'Content-Type': 'application/json', }, }).then((res) => res.json()); console.log('Generation:', response); }; main()
import requests def main(): url = "https://api.aimlapi.com/v2/generate/audio" params = { "generation_id": "<YOUR_GENERATION_ID>", } headers = {"Authorization": "Bearer <YOUR_API_KEY>", "Content-Type": "application/json"} response = requests.get(url, params=params, headers=headers) print("Generation:", response.json()) if __name__ == "__main__": main()
/v2/generate/audio
curl -L \ --url 'https://api.aimlapi.com/v2/generate/audio?Audio.v2.PollGenerationPayloadDTO=%5Bobject+Object%5D' \ --header 'Authorization: Bearer JWT'
{ "id": "text", "error": null, "status": "queued", "audio_file": { "url": "https://example.com" } }