import requests
resp = requests.post(
"https://api.heyaskr.ai/v1/images/generations",
headers={"Authorization": "Bearer ASKR_API_KEY"},
json={
"model": "flux-1.1-pro",
"prompt": "an isometric city at golden hour, tiny cars, soft shadows",
"size": "1024x1024",
},
).json()
url = resp["data"][0]["url"]
img = requests.get(url).content
open("city.png", "wb").write(img)
print("Saved city.png · cost $", resp.get("cost"))
Image URLs expire after 24 hours, so download anything you want to keep, as shown
above.
Try different models by changing
model to nano-banana, ideogram-3, or any
image model from the catalogue.