Generate an image
curl --request POST \
--url https://api.agipower.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/gemini-2.5-flash-image",
"prompt": "A clean product shot of a futuristic API dashboard",
"size": "1024x1024",
"n": 1
}
'import requests
url = "https://api.agipower.ai/v1/images/generations"
payload = {
"model": "google/gemini-2.5-flash-image",
"prompt": "A clean product shot of a futuristic API dashboard",
"size": "1024x1024",
"n": 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: 'google/gemini-2.5-flash-image',
prompt: 'A clean product shot of a futuristic API dashboard',
size: '1024x1024',
n: 1
})
};
fetch('https://api.agipower.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}Images API
Generate an image
POST
/
v1
/
images
/
generations
Generate an image
curl --request POST \
--url https://api.agipower.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/gemini-2.5-flash-image",
"prompt": "A clean product shot of a futuristic API dashboard",
"size": "1024x1024",
"n": 1
}
'import requests
url = "https://api.agipower.ai/v1/images/generations"
payload = {
"model": "google/gemini-2.5-flash-image",
"prompt": "A clean product shot of a futuristic API dashboard",
"size": "1024x1024",
"n": 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: 'google/gemini-2.5-flash-image',
prompt: 'A clean product shot of a futuristic API dashboard',
size: '1024x1024',
n: 1
})
};
fetch('https://api.agipower.ai/v1/images/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
200 - application/json
Generated image response
The response is of type object.