OpenRouter Image Generation for Openclaw

A versatile skill for generating and editing images using OpenRouter-compatible multimodal models through a unified API.

bawerlacher
v1.0.0
Feb 26, 2026
0
1.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install openrouter-image-generation

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install openrouter-image-generation using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is OpenRouter Image Generation?

This Openclaw Skills integration provides a robust interface for interacting with OpenRouter's multimodal image generation capabilities. By utilizing the chat completions endpoint, developers can programmatically generate new visual assets from text descriptions or perform sophisticated image-to-image edits on existing files. This skill is particularly useful for users who need to leverage specific models like Gemini or FLUX via a single API key and standardized configuration.

The skill simplifies the complexities of multimodal requests by handling base64 encoding, directory management, and specific image configurations such as aspect ratios and resolution scaling. It serves as a bridge between creative prompts and high-fidelity output, ensuring that all generated media is stored in a structured format compatible with other Openclaw Skills in an automated pipeline.

OpenRouter Image Generation Use Cases

  • Creating high-resolution marketing assets or product photography from cinematic text prompts.
  • Modifying existing images using precise instructions while maintaining original style and composition.
  • Prototyping visual concepts with fast, lower-resolution models before committing to 4K final renders.
  • Building automated content generation workflows that utilize Openclaw Skills for end-to-end media production.

How OpenRouter Image Generation Works

  1. The user executes the script with a prompt, target filename, and a specified OpenRouter model ID.
  2. The system verifies the presence of the OPENROUTER_API_KEY and ensures the outbound media directory is available.
  3. A multimodal payload is constructed, including the text prompt and any provided input images as base64 strings.
  4. The request is sent to OpenRouter's API with specific image_config parameters like aspect ratio and size.
  5. The script parses the returned JSON response, extracts the generated image data, and saves it to the local file system.
  6. The final file path is outputted, allowing other Openclaw Skills to reference the new asset.

OpenRouter Image Generation Setup

To get started, ensure you have your OpenRouter API key and the uv package manager installed. Use the following commands to configure your environment and run your first generation:

# Set your OpenRouter API key
export OPENROUTER_API_KEY='your_api_key_here'

# Create the standard outbound directory
mkdir -p ~/.openclaw/media/outbound

# Generate a new image using a supported model
uv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \
  --prompt "A sleek, futuristic workspace with neon lighting" \
  --filename "~/.openclaw/media/outbound/workspace-concept.png" \
  --model google/gemini-2.5-flash-image \
  --aspect-ratio 16:9 \
  --image-size 2K

OpenRouter Image Generation Data Schema & Taxonomy

The skill adheres to a structured data management approach to ensure compatibility across the Openclaw Skills ecosystem.

Component Location / Format Purpose
Output Directory ~/.openclaw/media/outbound/ Centralized storage for all generated visual assets.
Filename Convention yyyy-mm-dd-hh-mm-ss-name.png Ensures unique, searchable, and chronologically ordered files.
Image Config aspect_ratio, image_size Standardized parameters for controlling output dimensions and quality.
Advanced Config image-config-json Allows for provider-specific metadata and extended model features.

OpenRouter Image Generation Advanced Features

  • Support for image-to-image editing using specific instruction templates to preserve composition and lighting.
  • Capability to override default provider settings with custom JSON configurations for specialized model features.
  • Integration with OpenRouter's attribution headers for site-specific usage tracking.
  • Automated directory creation and preflight checks to prevent execution errors in complex Openclaw Skills workflows.
  • Flexible model selection enabling users to switch between cost-effective draft models and high-performance production models.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*