Cloudinary's New Image Generation API: One API, Multiple AI…
    Neura MarketNeura Market/CoPilot
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityCoPilotCoPilot
    DeepSeekDeepSeekStable DiffusionStable DiffusionMidjourneyMidjourney
    View All Directories
    OverviewRulesPromptsMCPsAgentsGamesBlogVideosGuidesCoursesCommunityPluginsTrending
    CoPilotBlogCloudinary's New Image Generation API: One API, Multiple AI Models, and Built-in Asset Management
    Back to Blog
    Cloudinary's New Image Generation API: One API, Multiple AI Models, and Built-in Asset Management
    ai

    Cloudinary's New Image Generation API: One API, Multiple AI Models, and Built-in Asset Management

    Jen Looper July 8, 2026
    0 views

    At conference booths, developers often ask whether we support image generation at Cloudinary, given...

    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!

    Cloudinary'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.

    Original image copyright © REUTERS/ABC Affiliate WABC

    In this tutorial, we'll use Python to call the API, generate an image, and save the final result to Cloudinary.

    What you'll build

    A Python script that can:

    • Generate an image from a text prompt
    • Choose a model family like flux, recraft, gpt-image, ideogram, or nano-banana
    • Save generated output as a managed Cloudinary asset
    • Print the final image URL, public ID, size, and file size

    Prerequisites

    First, follow the instructions on Cloudinary docs 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.

    Install the Python dependency:

    pip install requests
    

    Export your Cloudinary credentials:

    export CLOUDINARY_API_KEY="your-api-key"
    export CLOUDINARY_API_SECRET="your-api-secret"
    export CLOUDINARY_CLOUD_NAME="your-cloud-name"
    

    Here's your script. Save it as 'generate.py'.

    Generate your first AI image

    Run the script with a prompt:

    python3 generate.py "A medieval monk"
    

    Image description

    This image was generated with the default Flux model

    The script sends a request to Cloudinary's Image Generation API:

    payload = {
        "prompt": prompt,
        "model": {
            "family": model_family,
            "tier": tier
        },
        "target": {
            "target_type": "managed_asset",
            "public_id": public_id
        }
    }
    

    Then it calls the API using HTTP Basic Auth:

    resp = requests.post(
        f"{IMAGE_GEN_BASE}/generate/{cloud_name}/text_to_image",
        auth=(
            os.environ["CLOUDINARY_API_KEY"],
            os.environ["CLOUDINARY_API_SECRET"]
        ),
        json=payload,
        timeout=90,
    )
    

    Choose an AI image model

    This 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.

    You can switch model families without changing the rest of your application code:

    python3 generate.py \
      "A futuristic Tokyo skyline at sunset" \
      --model flux \
      --tier premium
    

    Supported model families include:

    flux
    gpt-image
    ideogram
    recraft
    nano-banana
    

    Another monk

    This was the same prompt, done with Ideogram model

    That makes it easier to test different visual styles while keeping one integration path.

    Save generated images as Cloudinary assets

    The important part of the request is this:

    "target": {
        "target_type": "managed_asset",
        "public_id": public_id
    }
    

    This tells Cloudinary to save the generated image as a managed asset on your account, instead of returning only a temporary output.

    After generation, the script prints something like:

    Image ready!
    Public ID: generated/fox-hiking
    URL: https://res.cloudinary.com/...
    Size: 1024×1024 px
    File size: 840 KB
    

    Once 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!

    Full usage examples

    Generate a new image:

    python3 generate.py "Marie de France playing pool"
    

    Marie de France

    I 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"

    Use a premium model:

    python3 generate.py \
      "A cinematic product photo of a sneaker floating over water" \
      --model flux \
      --tier premium
    

    Why this is useful

    Most image generation APIs return an output.

    Cloudinary's Image Generation API returns an output that can immediately become part of your media pipeline.

    That means developers can generate an image and then use the same platform to:

    • Store it
    • Transform it
    • Optimize it
    • Resize it
    • Deliver it
    • Reuse it across applications

    For 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!

    Final thoughts

    This Python script is small, but it covers the core production workflow:

    1. Authenticate with Cloudinary
    2. Send a prompt to the Image Generation API
    3. Choose a model family and tier
    4. Save the result as a managed asset
    5. Return a usable image URL

    If 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.

    Cloudinary :heart: developers
    Ready to level up your media workflow? Start using Cloudinary for free and build better visual experiences today.
    :point_right: [Create your free account] (https://link.cloudinary.com/urmty)

    Tags

    ainanobananacodenewbieimages

    Comments

    More Blog

    View all
    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught megemma

    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught me

    I ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...

    X
    xbill
    Hey DEV, I'm Tobore. Let's actually connect.community

    Hey DEV, I'm Tobore. Let's actually connect.

    Hey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...

    L
    Laurina Ayarah
    I burned through thousands of AI tokens. Then a friend did it for freeai

    I burned through thousands of AI tokens. Then a friend did it for free

    (yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...

    P
    Paulo Henrique
    Claude might be saturating your machineai

    Claude might be saturating your machine

    My laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...

    S
    Sidhant Panda
    Automated GitHub Code Reviews Using Google Geminigithubactions

    Automated GitHub Code Reviews Using Google Gemini

    I Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...

    D
    Darren "Dazbo" Lester
    What is an "agentic harness," actually?ai

    What is an "agentic harness," actually?

    I've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...

    T
    Tilde A. Thurium

    Stay up to date

    Get the latest CoPilot prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for CoPilot and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this CoPilot resource

    • End-to-End Blog Generation for WordPress with LLM Agents & Image - GP-5 Optimizedn8n · $24.99 · Related topic
    • Customer Authentication for Chat Support with OpenAI and Redis Session Managementn8n · $14.99 · Related topic
    • Generate & Publish SEO Articles with Claude AI, Webflow, & Image Generationn8n · $14.99 · Related topic
    • Text-to-Image Generation with Flux AI, Google Drive Storage & Sheets Loggingn8n · $9.99 · Related topic
    Browse all workflows