Guides

Give Your Coding Agent Access to Better AI Models with OpenRouter

In this guide, you will learn how to give your AI agent more models to work with using OpenRouter.

intermediate 4 steps

Introduction

In this guide, you will learn how to give your AI agent more models to work with using OpenRouter. We'll set up an API key, compare models, and test cheaper options for making ad mockups.

Step-by-step 4 steps

Instructions

  1. Step 1 of 4

    Browse the Model Catalog

    OpenRouter lets your agent use models from different providers through one API key. Start with a job you want it to do better: making product images, reviewing code, or handling a routine task more cheaply.

    Browse the model catalog and filter for that task. Sort by price from low to high, then open a model's page to check its capabilities, price, and usage limits. Copy the model name when you find one you want to try.

    Pro tip: Check that an image model can generate images. We accidentally selected a vision model, which reads images instead. That sent us back to the catalog.
  2. Step 2 of 4

    Create an API Key and Set a Budget

    Go to API Keys and choose New key. Name it after the project or agent you'll use it with so you can recognize its charges later.

    Set a spending limit and an expiration date before creating the key. We set ours to expire after one day because it was just for the test. Choose a budget you're comfortable spending and check whether it resets daily, weekly, or monthly.

    This is worth doing before you start experimenting. When we checked our earlier image usage, we'd spent more than we realized. A spending limit gives you a place to stop.

  3. Step 3 of 4

    Give Your Agent a Small Test

    Ask your agent to help you set up OpenRouter and tell you where to store the key privately. Follow its setup instructions; keep the key out of shared chats and project files that might be published.

    Once it's connected, give the agent the model name and a small task. We asked our GrokBot to make more ad mockups with a cheaper image model. Here's a version you can adapt:

    Prompt
    Use [model name] through OpenRouter to make three ad mockups for [your product]. Use the attached product photo as a reference. Keep the product recognizable and try a different layout for each ad.

    Our demo uses GrokBot. If you're using Codex or Claude Code, ask it to check its OpenRouter setup before running the same test.

  4. Step 4 of 4

    Compare the Images and Check the Cost

    Compare the images with your original product photo. Does the product still look right? Is the text readable? Is there a layout you'd want to develop?

    Our cheaper mockup gave us an idea to work with, but the hat didn't look as close to the real product as it did in the GPT Image 2.5 version. It was useful for choosing a direction, not ready to publish as a product ad.

    Check the key's usage in OpenRouter after the test. Ours showed $0 at that point. Check the price and limits of the model you choose rather than assuming your run will also be free.

You're done

That's the whole workflow

Mark it complete to save your progress. Background and answers to common questions follow below.

Keep going

Keep learning with Rundown Pro

A guide shows you one workflow. Pro opens the full course library, so you can learn the whole system behind it.

  • Every on-demand course
  • Certifications on completion
  • Group office hours and member perks

$29/mo, cancel anytime

Overview Back to the steps

Background and context

Who This Is Useful For

  • Marketers who want their agent to make better product images and ad mockups.
  • Developers who want to try cheaper models for routine coding tasks.
  • Anyone who likes their current AI agent but wants it to use another model for a particular job.

What You Will Build

OpenRouter model directory
OpenRouter model directory

You'll set up an OpenRouter key and use it with your agent to try another model. We tested this with our GrokBot, making ad mockups for a dad hat. The goal was to find cheaper ways to try ideas before paying for a finished image.

What You Need To Get Started

  • An OpenRouter account
  • An AI agent that can make API requests, plus a private place to store its API key
  • A small task to test; for product mockups, have a photo of your product ready

Going Further

In Part 2, turn this into a skill your agent can reuse: make cheap mockups, let you choose a favorite, then use a better image model for the final version. You can try several directions before spending more on the one you want to keep.