|
138 | 138 | "x-codeSamples": [ |
139 | 139 | { |
140 | 140 | "lang": "JavaScript", |
141 | | - "source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"elevenlabs/eleven_music\",\n \"prompt\": \"lo-fi pop hip-hop ambient music, slow intro: 10 s, then faster and with loud bass: 10 s\",\n \"music_length_ms\": 20000\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();" |
| 141 | + "source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/generate/audio', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"elevenlabs/eleven_music\",\n \"prompt\": \"lo-fi pop hip-hop ambient music, slow intro: 10 s, then faster and with loud bass: 10 s\",\n \"music_length_ms\": 20000\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();" |
142 | 142 | }, |
143 | 143 | { |
144 | 144 | "lang": "Python", |
145 | | - "source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/images/generations\",\n headers={\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n \"model\": \"elevenlabs/eleven_music\",\n \"prompt\": \"lo-fi pop hip-hop ambient music, slow intro: 10 s, then faster and with loud bass: 10 s\",\n \"music_length_ms\": 20000\n }\n)\n\ndata = response.json()\nprint(data)" |
| 145 | + "source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/generate/audio\",\n headers={\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n \"model\": \"elevenlabs/eleven_music\",\n \"prompt\": \"lo-fi pop hip-hop ambient music, slow intro: 10 s, then faster and with loud bass: 10 s\",\n \"music_length_ms\": 20000\n }\n)\n\ndata = response.json()\nprint(data)" |
146 | 146 | }, |
147 | 147 | { |
148 | 148 | "lang": "cURL", |
149 | | - "source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"model\": \"elevenlabs/eleven_music\",\n \"prompt\": \"lo-fi pop hip-hop ambient music, slow intro: 10 s, then faster and with loud bass: 10 s\",\n \"music_length_ms\": 20000\n }'" |
| 149 | + "source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/generate/audio' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"model\": \"elevenlabs/eleven_music\",\n \"prompt\": \"lo-fi pop hip-hop ambient music, slow intro: 10 s, then faster and with loud bass: 10 s\",\n \"music_length_ms\": 20000\n }'" |
150 | 150 | }, |
151 | 151 | { |
152 | 152 | "lang": "HTTP", |
153 | | - "source": "POST /v1/images/generations HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nContent-Type: application/json\nAccept: */*\n\n{\n \"model\": \"elevenlabs/eleven_music\",\n \"prompt\": \"lo-fi pop hip-hop ambient music, slow intro: 10 s, then faster and with loud bass: 10 s\",\n \"music_length_ms\": 20000\n}" |
| 153 | + "source": "POST /v1/generate/audio HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nContent-Type: application/json\nAccept: */*\n\n{\n \"model\": \"elevenlabs/eleven_music\",\n \"prompt\": \"lo-fi pop hip-hop ambient music, slow intro: 10 s, then faster and with loud bass: 10 s\",\n \"music_length_ms\": 20000\n}" |
154 | 154 | } |
155 | 155 | ] |
156 | 156 | } |
|
0 commit comments