Generate Hosted Images from Saved References | Inliner.ai

AI assistant image workflow

Generate hosted images from saved references

Save product photos or style references in an Inliner project. Use them in Studio, or ask Claude Code, Cursor, or Codex to generate through the Inliner API. Paste the finished image URL into HTML, Markdown, or email.

  • Up to 5 saved references per project
  • Studio works without an API key
  • Public image URLs ready to embed

Save a reference once and reuse it for new images

Step 01 · Configure once

Save references to a project

In Projects, upload product photos, packaging shots, or artwork that shows the look you want.

app.inliner.ai/projects → acme-launch
Step 02 · Generate

Use the saved images

Ask your assistant to look up the project’s reference images and send their IDs to the API. In Studio, choose the references visually.

POST /content/generate with refIds
Step 03 · Ship the URL

Embed the finished image

Copy its public img.inliner.ai URL into your page, doc, or email without downloading or uploading the file.

<img src="https://img.inliner.ai/...">
Try Studio first. Add a reference in Projects, open Studio, and choose that project. Select the reference, enter your prompt, and generate. Copy the URL from the finished image.

Example: images for a product launch

A shoe brand saves product and packaging photos in acme-launch. For its launch page and email, it can reuse those references and ask for warm studio lighting, matte textures, and cream and charcoal tones.

Project: acme-launch · saved refs + brand instructions Illustrative assets and URL paths
White sneaker studio product shot hosted on Inliner
01 · Product Hero Clean studio PDP shot /acme-launch/studio-product_800x600.png
Top-down product packaging flat-lay hosted on Inliner
02 · Launch Email Packaging flat-lay /acme-launch/packaging-flatlay_800x600.png
Golden hour street lifestyle photo hosted on Inliner
03 · Campaign Banner Lifestyle scene /acme-launch/lifestyle-street_800x600.png
Warm minimal empty-state illustration of a desk with a plant hosted on Inliner
04 · App & Docs UI Empty-state illustration /acme-launch/empty-state_800x450.png

Product & e-commerce visuals

Keep clean studio shots, packaging angles, and seasonal campaign scenes under one brand project so your assistant can build landing sections and product cards with real hosted URLs.

Brand & editorial illustrations

Upload an illustration style reference for empty states, feature callouts, and blog headers so new illustrations follow a cohesive palette and line weight across your site.

Docs, changelogs & newsletters

Generate the exact pixel dimensions needed for README banners, release notes, or 600px email headers—and append .webp when you want a smaller web payload at zero extra credit cost.

How saved project references work across each connection method

In Dashboard → Projects, every project namespace stores two reusable creative settings: up to 5 saved reference images (kept in that project's dedicated reference group) and Custom Prompt Instructions (plus an optional auto-contrast watermark). Because different surfaces hit different endpoints, here is the exact behavior today so you can pick the right path:

Surface / Method How saved references & instructions apply Best used when
Inliner Studio
app.inliner.ai/studio-new
Open the project in Studio and select reference images from the reference bar. Include any brand instructions in the prompt, generate, and copy the finished image URL. Testing saved project references right away without writing scripts, or dialing in hero product shots visually.
Assistant-led REST API
GET /account/projects
GET /content/images?collectionIds=…
POST /content/generate
Look up the project and pass the saved image IDs as refIds. Include any saved brand instructions in prompt, as the example below does. Nano Banana 2.1 is the default for reference images. Auto routing can choose another model based on the prompt. Local coding assistants with shell/HTTP access, CI jobs, or custom apps that need saved project references applied programmatically while keeping your INLINER_API_KEY local.
Standalone MCP Server
@inliner/mcp-server
Runs locally over stdio for Claude Code, Cursor, Codex, Copilot, Gemini CLI, and Windsurf. Provides generate_image, edit_image (anchors on an existing sourceUrl or local sourcePath), list_images (pass project namespace), and get_project_details—for generation results, existing image URLs, and project details. Generate, find, and edit hosted images during a coding session. Current MCP and CLI generation commands omit saved reference IDs. Use Studio or the REST example for saved references, or call edit_image with a source image URL to edit that image.
Authenticated project URL
img.inliner.ai/{project}/...
An authenticated first render can use the project’s saved reference group and custom prompt. The selected model’s input limit still applies. Previewing assistant-written HTML/Markdown in a signed-in browser session so first load materializes reference-guided URLs.

Reference consistency is guidance, not guaranteed identity

Saved reference images steer lighting, palette, materials, and visual resemblance—they do not lock pixel-identical geometry, fine logos, or small packaging text across every generation. Review hero assets before publishing, and use edit_image or the Studio Editor when you need targeted local adjustments.

Reuse a hosted image URL

Use the URL for the finished image. Reusing it consumes no generation credits. Your plan limits how many images you can host, and deleting an image can take its URL offline. You can append .webp to a hosted PNG or JPEG URL for a WebP variant.

Which AI assistants connect natively (and how browser chats work)

Inliner's MCP server runs locally over stdio (npx -y @inliner/mcp-server). Coding assistants that support local MCP servers can call Inliner tools directly. Browser-only chat apps without local MCP support use a lighter instruction-based workflow instead.

Assistant Connection What it can do today
Claude Code Native MCP + Skill Add @inliner/mcp-server and install skills/inliner-ai. Inspects projects, calls generate_image / edit_image, and inserts verified hosted URLs.
OpenAI Codex CLI Native Plugin / MCP Install the official Codex plugin (inliner-ai@inliner-ai) or add MCP directly. Bundled skill + 12 live tools. Codex guide →
Cursor & VS Code (Copilot) Native MCP + Plugin Configure .cursor/mcp.json or VS Code MCP settings (plus the Cursor plugin). Cursor guide →
Gemini CLI & Windsurf Native MCP / Extension Install the Gemini CLI extension or add the stdio MCP block to settings. Gemini CLI guide →
Custom agents, CI & apps CLI / REST / SDKs Use @inliner/cli, raw REST (POST /content/generate with refIds), or official JS (@inliner/js), Python, Go, and PHP SDKs. API docs →
ChatGPT (web) & Claude.ai (web) Instructions only No native local stdio MCP connection. Paste your project's LLM Instructions from Dashboard → Projects into Custom Instructions or Project Settings so the chat writes clean project URLs and prompts, then materialize via signed-in browser load, Studio, CLI, or API. ChatGPT guide →

Set up saved-reference generation through the API

1 Create a project and upload your reference images

  1. Sign in or create a free account (includes 120 monthly image credits, 1 custom project, and 25 hosted images).
  2. Open Dashboard → Projects, create or edit a project (for example, acme-launch), and add concise Custom Prompt Instructions describing your brand palette, lighting, and tone.
  3. In the same modal, upload up to 5 reference images (PNG, JPG, WebP, or GIF) representing your product, packaging, or illustration style.

2 Create an API key for local tools

  1. If you’re using Studio, follow the Studio quickstart. For the API or MCP, go to Account → API Keys and click Create API Key.
  2. Copy the inl_... key and store it as INLINER_API_KEY in your local MCP config or shell environment (never commit API keys to git).

3 Connect your assistant or automation path

Pick the tool you actually use below:

Run in a terminal with curl and jq. Set your project namespace and export an INLINER_API_KEY for that account. The script sends up to four saved references to fit Nano Banana 2.1’s input limit and adds any saved brand instructions to the prompt.

(
  set -eu
  project="YOUR_PROJECT_NAMESPACE"
  inliner_api="https://api.inliner.ai"
  : "${INLINER_API_KEY:?Set INLINER_API_KEY in your local shell}"

  project_settings=$(curl -fsS "$inliner_api/account/projects" \
    -H "Authorization: Bearer $INLINER_API_KEY" |
    jq -ce --arg project "$project" \
      '[(.projects // [])[] | select(.project == $project)][0] // error("Project not found in this account")')

  group_id=$(printf '%s\n' "$project_settings" |
    jq -er '.referenceImageContentGroupId // error("No saved reference group for this project")')

  ref_ids=$(curl -fsSG "$inliner_api/content/images" \
    -H "Authorization: Bearer $INLINER_API_KEY" \
    --data-urlencode "collectionIds=$group_id" |
    jq -ce '[.items[:4][].contentId] | if length == 0 then error("No saved reference images") else . end')

  generation=$(jq -n --argjson settings "$project_settings" --argjson refs "$ref_ids" '
    ($settings.customPrompt // "") as $brand |
    {
      project: $settings.project,
      slug: "launch-packaging",
      prompt: ("Top-down product packaging on warm linen, with soft studio lighting."
        + (if $brand == "" then "" else "\n\nBrand instructions: " + $brand end)),
      width: 1200,
      height: 600,
      extension: "png",
      refIds: $refs
    }' |
    curl --fail-with-body -sS "$inliner_api/content/generate" \
      -H "Authorization: Bearer $INLINER_API_KEY" \
      -H "Content-Type: application/json" --data-binary @-) || {
    printf '%s\n' "$generation" >&2
    exit 1
  }

  printf '%s\n' "$generation" |
    jq -er '.prompt | strings | "https://img.inliner.ai/" + ltrimstr("/")'
)

Add the local MCP server to Claude Code. Set INLINER_API_KEY in the shell first.

claude mcp add --transport stdio inliner \
  --env INLINER_API_KEY="$INLINER_API_KEY" \
  --env INLINER_DEFAULT_PROJECT=acme-launch \
  -- npx -y @inliner/mcp-server

Install Inliner’s Codex plugin to add the inliner-ai skill and MCP configuration, or configure MCP directly.

codex plugin marketplace add inliner-ai/agent-skill --ref v1.3.0
codex plugin add inliner-ai@inliner-ai

# Or MCP-only setup:
codex mcp add inliner --env INLINER_API_KEY="$INLINER_API_KEY" -- npx -y @inliner/mcp-server

Add to Cursor’s user-level MCP settings and keep keys out of version control:

{
  "mcpServers": {
    "inliner": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@inliner/mcp-server"],
      "env": {
        "INLINER_API_KEY": "inl_your_api_key_here",
        "INLINER_DEFAULT_PROJECT": "acme-launch"
      }
    }
  }
}

For ChatGPT web or Claude.ai web (no local MCP): copy LLM Instructions from Dashboard → Projects, paste into Custom Instructions, and render generated URLs while signed in or via Studio/CLI.

# Example prompt to paste into ChatGPT / Claude.ai after adding project instructions:
"Build a launch announcement email section using our Inliner project 'acme-launch'.
Use a 600x200 header URL and an 800x600 product flat-lay URL with descriptive alt text."

# Tip: Materialize account-owned URLs via Studio, CLI, API, or a signed-in browser preview
# before sending the email or publishing publicly.

4 Generate and use the hosted URL

Here’s an example prompt for a coding assistant with terminal access. Once you have a hosted URL, you can also use local MCP to edit that image.

"Use my local INLINER_API_KEY to look up the acme-launch project. Generate a 1200x600 launch hero with the saved reference IDs and include the project’s brand instructions in the prompt. Insert the hosted URL in src/pages/launch.html."

I loaded the project’s reference IDs and added its brand instructions to the prompt. I generated the image through the API and inserted the hosted URL:

<img src="https://img.inliner.ai/acme-launch/product-launch-hero_1200x600.png" alt="Matte black launch product on stone pedestal under warm studio light" width="1200" height="600" />

"Now use MCP edit_image to make a 600x200 newsletter crop of that exact hosted image with clean space on the right for a headline."

Called edit_image with sourceUrl set to the hosted hero above, resized to 600x200, and returned the new hosted URL for your email template.

Keep keys local and generate before publishing. Keep INLINER_API_KEY in your local shell or MCP config—never paste it into browser chats or commit it to git. When using MCP, call generate_image for new assets (or edit_image for variations of an existing URL); recommend_image_url only suggests a slug and does not generate an image.

Documentation & related guides