You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "The base64-encoded JSON of the generated image.",
173
+
"example": null
174
+
}
175
+
}
176
+
},
177
+
"description": "The list of generated images."
178
+
},
179
+
"meta": {
180
+
"type": "object",
181
+
"nullable": true,
182
+
"properties": {
183
+
"usage": {
184
+
"type": "object",
185
+
"nullable": true,
186
+
"properties": {
187
+
"tokens_used": {
188
+
"type": "number",
189
+
"description": "The number of tokens consumed during generation.",
190
+
"example": 120000
191
+
}
192
+
},
193
+
"required": [
194
+
"tokens_used"
195
+
]
196
+
}
197
+
},
198
+
"description": "Additional details about the generation."
199
+
}
200
+
}
201
+
}
202
+
}
203
+
}
204
+
}
205
+
},
206
+
"x-hideTryItPanel": true,
207
+
"x-codeSamples": [
208
+
{
209
+
"lang": "JavaScript",
210
+
"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: 'alibaba/z-image-turbo-lora',\n prompt: 'A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.',\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
211
+
},
212
+
{
213
+
"lang": "Python",
214
+
"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\":\"alibaba/z-image-turbo-lora\",\n\"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n }\n)\n\ndata = response.json()\nprint(data)"
215
+
},
216
+
{
217
+
"lang": "cURL",
218
+
"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\": \"alibaba/z-image-turbo-lora\",\n\"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n }'"
219
+
},
220
+
{
221
+
"lang": "HTTP",
222
+
"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\": \"alibaba/z-image-turbo-lora\",\n\"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n}"
0 commit comments