Cloudinary's New Image Generation API: One API, Multiple AI…
    Neura MarketNeura Market/Stable Diffusion
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityStable DiffusionStable Diffusion
    DeepSeekDeepSeekCoPilotCoPilotMidjourneyMidjourney
    View All Directories
    OverviewPromptsBlogVideosGuidesCoursesCommunityModelsLoRAsComfyUI WorkflowsTrending
    Stable DiffusionBlogCloudinary'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
    Context bankruptcy: The case for strategic forgetting for AI Agentsai

    Context bankruptcy: The case for strategic forgetting for AI Agents

    Most of us have seen a coding agent fail to complete a task we know it can do. We just don't...

    J
    James O'Reilly
    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestrationgooglecloud

    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestration

    When building Generative AI applications, developers often encounter a massive bottleneck: sequential...

    A
    Aryan Irani
    Is It Ethical to Post and Ask About Circuits on Dev.to?discuss

    Is It Ethical to Post and Ask About Circuits on Dev.to?

    I’ve been thinking about sharing some electronic circuit posts on Dev.to — small circuits, DIY...

    C
    codebunny20
    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limitsagents

    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limits

    What nobody tells you about exporting your multi-agent prototype to a local workspace. Every...

    L
    leslysandra
    Guarding the till while autonomous data agents do the diggingagenticarchitect

    Guarding the till while autonomous data agents do the digging

    Autonomous agents are genuinely good at answering messy business questions. Give one an LLM and a set...

    S
    Sireesha Pulipati
    Return on Attention: Why AI Code Reviews Are Wearing Us Outai

    Return on Attention: Why AI Code Reviews Are Wearing Us Out

    PR volume went up, ticket quality didn't, and the gap got filled with LLMs on both sides of the review: bots reviewing, bots replying, bots occasionally arguing with bots about priorities that only existed in a teammate's head. Our CEO named the actual problem, and it's bigger than code review.

    C
    christine

    Stay up to date

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

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Stable Diffusion 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.

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Stable Diffusion resource

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