{"slug": "cloudinary-s-new-image-generation-api-one-api-multiple-ai-models-and-built-in", "title": "Cloudinary's New Image Generation API: One API, Multiple AI Models, and Built-in Asset Management", "summary": "Cloudinary launched an Image Generation API that allows developers to generate images from text prompts using multiple AI model families, including Flux, Recraft, GPT-Image, Ideogram, and Nano-banana. The generated images are automatically stored as managed Cloudinary assets, enabling immediate delivery, optimization, resizing, and transformation through Cloudinary's CDN. The API supports a single integration path for testing different visual styles and is demonstrated with a Python script.", "body_md": "At conference booths, developers often ask whether we support image generation at Cloudinary, given our emphasis on media management. As of now, I can say \"YES! yes, we do\" - here's how!\n\nCloudinary's Image Generation API lets developers generate images from text prompts using multiple AI model families, then store the result as a managed Cloudinary asset for delivery, optimization, resizing, and transformation.\n\nOriginal image copyright © REUTERS/ABC Affiliate WABC\n\nIn this tutorial, we'll use Python to call the API, generate an image, and save the final result to Cloudinary.\n\nA Python script that can:\n\n`flux`\n\n, `recraft`\n\n, `gpt-image`\n\n, `ideogram`\n\n, or `nano-banana`\n\nFirst, follow [the instructions on Cloudinary docs](https://cloudinary.com/documentation/image_generation_addon) to install the image generation add-on to your account. While you're in the Cloudinary console, make note of your API key, secret and the cloud name where you want assets to be stored.\n\nInstall the Python dependency:\n\n```\npip install requests\n```\n\nExport your Cloudinary credentials:\n\n```\nexport CLOUDINARY_API_KEY=\"your-api-key\"\nexport CLOUDINARY_API_SECRET=\"your-api-secret\"\nexport CLOUDINARY_CLOUD_NAME=\"your-cloud-name\"\n```\n\nHere's your [script](https://gist.github.com/jlooper/4ef0ac33a6bd6e943d953f523d606412). Save it as 'generate.py'.\n\nRun the script with a prompt:\n\n```\npython3 generate.py \"A medieval monk\"\n```\n\nThis image was generated with the default Flux model\n\nThe script sends a request to Cloudinary's Image Generation API:\n\n```\npayload = {\n    \"prompt\": prompt,\n    \"model\": {\n        \"family\": model_family,\n        \"tier\": tier\n    },\n    \"target\": {\n        \"target_type\": \"managed_asset\",\n        \"public_id\": public_id\n    }\n}\n```\n\nThen it calls the API using HTTP Basic Auth:\n\n```\nresp = requests.post(\n    f\"{IMAGE_GEN_BASE}/generate/{cloud_name}/text_to_image\",\n    auth=(\n        os.environ[\"CLOUDINARY_API_KEY\"],\n        os.environ[\"CLOUDINARY_API_SECRET\"]\n    ),\n    json=payload,\n    timeout=90,\n)\n```\n\nThis is the fun part. You can pick the image generation model that best suits your use case. For example, I find that nano-banana works well with images that include text.\n\nYou can switch model families without changing the rest of your application code:\n\n```\npython3 generate.py \\\n  \"A futuristic Tokyo skyline at sunset\" \\\n  --model flux \\\n  --tier premium\n```\n\nSupported model families include:\n\n```\nflux\ngpt-image\nideogram\nrecraft\nnano-banana\n```\n\nThis was the same prompt, done with Ideogram model\n\nThat makes it easier to test different visual styles while keeping one integration path.\n\nThe important part of the request is this:\n\n```\n\"target\": {\n    \"target_type\": \"managed_asset\",\n    \"public_id\": public_id\n}\n```\n\nThis tells Cloudinary to save the generated image as a managed asset on your account, instead of returning only a temporary output.\n\nAfter generation, the script prints something like:\n\n```\nImage ready!\nPublic ID: generated/fox-hiking\nURL: https://res.cloudinary.com/...\nSize: 1024×1024 px\nFile size: 840 KB\n```\n\nOnce the image is in Cloudinary, you can resize it, optimize it, crop it, transform it, and deliver it through Cloudinary's CDN. Wicked fast and easy!\n\nGenerate a new image:\n\n```\npython3 generate.py \"Marie de France playing pool\"\n```\n\nI love this image! Marie de France was a 12th century author of some famous french literature that I particularly like. I don't think she ever played pool, though. Also this pool table is awesomely 'AI-pilled\"\n\nUse a premium model:\n\n```\npython3 generate.py \\\n  \"A cinematic product photo of a sneaker floating over water\" \\\n  --model flux \\\n  --tier premium\n```\n\nMost image generation APIs return an output.\n\nCloudinary's Image Generation API returns an output that can immediately become part of your media pipeline.\n\nThat means developers can generate an image and then use the same platform to:\n\nFor apps that already manage media with Cloudinary, AI image generation becomes part of the existing workflow instead of a separate one-off process. The pipeline just got way simplified for you!\n\nThis Python script is small, but it covers the core production workflow:\n\nIf you're building developer tools, e-commerce workflows, campaign generators, or AI-powered creative apps, this approach gives you both image generation and image delivery in the same pipeline.\n\nCloudinary ❤️ developers |\n|---|\n| Ready to level up your media workflow? Start using Cloudinary for free and build better visual experiences today. |\n| 👉\n|", "url": "https://wpnews.pro/news/cloudinary-s-new-image-generation-api-one-api-multiple-ai-models-and-built-in", "canonical_source": "https://dev.to/cloudinary/cloudinarys-new-image-generation-api-one-api-multiple-ai-models-and-built-in-asset-management-3ldl", "published_at": "2026-07-08 13:02:03+00:00", "updated_at": "2026-07-08 13:29:19.697429+00:00", "lang": "en", "topics": ["artificial-intelligence", "generative-ai", "developer-tools", "ai-products", "ai-infrastructure"], "entities": ["Cloudinary", "Flux", "Recraft", "GPT-Image", "Ideogram", "Nano-banana", "Python"], "alternates": {"html": "https://wpnews.pro/news/cloudinary-s-new-image-generation-api-one-api-multiple-ai-models-and-built-in", "markdown": "https://wpnews.pro/news/cloudinary-s-new-image-generation-api-one-api-multiple-ai-models-and-built-in.md", "text": "https://wpnews.pro/news/cloudinary-s-new-image-generation-api-one-api-multiple-ai-models-and-built-in.txt", "jsonld": "https://wpnews.pro/news/cloudinary-s-new-image-generation-api-one-api-multiple-ai-models-and-built-in.jsonld"}}