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()
Last updated 14 days ago
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()
Retrieves information about audio generated.
const response = await fetch('https://api.aimlapi.com/v2/generate/audio?generation_id=text', { method: 'GET', headers: {}, }); const data = await response.json();
{ "id": "text", "status": "generating", "audio_file": { "url": "https://example.com", "content_type": "text", "file_name": "text", "file_size": 0 } }