{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openrouter-image-generation",
    "name": "Openrouter Image Generation",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/Bawerlacher/openrouter-image-generation",
    "canonicalUrl": "https://clawhub.ai/Bawerlacher/openrouter-image-generation",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/openrouter-image-generation",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openrouter-image-generation",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/generate_image.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openrouter-image-generation"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/openrouter-image-generation",
    "agentPageUrl": "https://openagent3.xyz/skills/openrouter-image-generation/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openrouter-image-generation/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openrouter-image-generation/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "OpenRouter Image Generation & Editing",
        "body": "Generate new images or edit existing ones using OpenRouter image-capable models via the Chat Completions API."
      },
      {
        "title": "Usage",
        "body": "Run the script using absolute path (do NOT cd to the skill directory first):\n\nGenerate new image:\n\n# Ensure outbound directory exists first\nmkdir -p ~/.openclaw/media/outbound\n\nuv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \\\n  --prompt \"your image description\" \\\n  --filename \"~/.openclaw/media/outbound/output-name.png\" \\\n  --model google/gemini-2.5-flash-image \\\n  [--aspect-ratio 16:9] \\\n  [--image-size 2K]\n\nEdit existing image (image-to-image):\n\n# Ensure outbound directory exists first\nmkdir -p ~/.openclaw/media/outbound\n\nuv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \\\n  --prompt \"editing instructions\" \\\n  --filename \"~/.openclaw/media/outbound/output-name.png\" \\\n  --input-image \"path/to/input.png\" \\\n  --model google/gemini-2.5-flash-image\n\nImportant: Default OpenClaw delivery path is ~/.openclaw/media/outbound/. Save generated images there so other OpenClaw flows can pick them up easily."
      },
      {
        "title": "API Key",
        "body": "The script checks for API key in this order:\n\n--api-key argument\nOPENROUTER_API_KEY environment variable\n\nOptional OpenRouter attribution headers:\n\n--site-url or OPENROUTER_SITE_URL\n--app-name or OPENROUTER_APP_NAME"
      },
      {
        "title": "Model + Image Config",
        "body": "--model <openrouter-model-id> is required (no script default)\nExample model: google/gemini-2.5-flash-image\nUse --aspect-ratio for image_config.aspect_ratio (for example 1:1, 16:9)\nUse --image-size for image_config.image_size (1K, 2K, 4K)\nUse --image-config-json '{\"key\":\"value\"}' for advanced/provider-specific extras (merged into image_config)\n\nNote: OpenRouter docs show aspect_ratio and image_size as the common image config fields for image generation. Additional keys may exist for specific providers/models (for example Sourceful features). If a request fails, remove unsupported options or switch models.\n\nNote: The script always sends modalities: [\"image\", \"text\"]. Image-only models (some FLUX variants) may reject this — if you get an unexpected error with a non-Gemini model, this may be the cause. No workaround is currently exposed via CLI args."
      },
      {
        "title": "Default Workflow (draft -> iterate -> final)",
        "body": "Goal: iterate quickly before spending time on higher-quality settings.\n\nDraft: smaller size / faster model\n\n--image-size 1K\n\n\nIterate: adjust prompt in small diffs and keep a new filename each run\nFinal: larger size or higher quality if the selected model supports it\n\nExample: --image-size 4K --aspect-ratio 16:9"
      },
      {
        "title": "Preflight + Common Failures",
        "body": "Preflight:\n\ncommand -v uv\ntest -n \"$OPENROUTER_API_KEY\" (or pass --api-key)\ntest -d ~/.openclaw/media/outbound || mkdir -p ~/.openclaw/media/outbound\nIf editing: test -f \"path/to/input.png\"\n\n\n\nCommon failures:\n\nError: No API key provided. -> set OPENROUTER_API_KEY or pass --api-key\nError loading input image: -> bad path or unreadable file\nHTTP 400 with model/image config error -> unsupported model or invalid image_config.aspect_ratio / image_config.image_size\nHTTP 401/403 -> invalid key, no model access, or quota/credits issue\nNo image found in response -> model may not support image output or request format rejected"
      },
      {
        "title": "Filename Generation",
        "body": "Generate filenames with the pattern: ~/.openclaw/media/outbound/yyyy-mm-dd-hh-mm-ss-name.png\n\nExamples:\n\n~/.openclaw/media/outbound/2026-02-26-14-23-05-product-shot.png\n~/.openclaw/media/outbound/2026-02-26-14-25-30-sky-edit.png"
      },
      {
        "title": "Prompt Handling",
        "body": "For generation: pass the user's description as-is unless it is too vague to be actionable.\nFor editing: make the requested change explicit and preserve everything else.\n\nPrompt template for precise edits:\n\nChange ONLY: <change>. Keep identical: subject, composition/crop, pose, lighting, color palette, background, text, and overall style. Do not add new objects."
      },
      {
        "title": "Output",
        "body": "Save the first returned image to ~/.openclaw/media/outbound/output-name.png by default (pass that full path in --filename)\nSupports OpenRouter's base64 data URL image responses (message.images[0].image_url.url)\nPrints the saved file path\nDo not read the image back unless the user asks"
      },
      {
        "title": "Examples",
        "body": "Generate new image:\n\nmkdir -p ~/.openclaw/media/outbound\n\nuv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \\\n  --prompt \"A cinematic product photo of a matte black mechanical keyboard on a wooden desk, warm window light\" \\\n  --filename \"~/.openclaw/media/outbound/2026-02-26-14-23-05-keyboard-product-shot.png\" \\\n  --model google/gemini-2.5-flash-image \\\n  --aspect-ratio 16:9 \\\n  --image-size 2K\n\nEdit existing image:\n\nmkdir -p ~/.openclaw/media/outbound\n\nuv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \\\n  --prompt \"Change ONLY: make the sky dramatic with orange sunset clouds. Keep identical: subject, composition, lighting on foreground, and overall style.\" \\\n  --filename \"~/.openclaw/media/outbound/2026-02-26-14-25-30-sunset-sky-edit.png\" \\\n  --model google/gemini-2.5-flash-image \\\n  --input-image \"original-photo.jpg\""
      },
      {
        "title": "Reference",
        "body": "OpenRouter docs: https://openrouter.ai/docs/guides/overview/multimodal/image-generation"
      }
    ],
    "body": "OpenRouter Image Generation & Editing\n\nGenerate new images or edit existing ones using OpenRouter image-capable models via the Chat Completions API.\n\nUsage\n\nRun the script using absolute path (do NOT cd to the skill directory first):\n\nGenerate new image:\n\n# Ensure outbound directory exists first\nmkdir -p ~/.openclaw/media/outbound\n\nuv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \\\n  --prompt \"your image description\" \\\n  --filename \"~/.openclaw/media/outbound/output-name.png\" \\\n  --model google/gemini-2.5-flash-image \\\n  [--aspect-ratio 16:9] \\\n  [--image-size 2K]\n\n\nEdit existing image (image-to-image):\n\n# Ensure outbound directory exists first\nmkdir -p ~/.openclaw/media/outbound\n\nuv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \\\n  --prompt \"editing instructions\" \\\n  --filename \"~/.openclaw/media/outbound/output-name.png\" \\\n  --input-image \"path/to/input.png\" \\\n  --model google/gemini-2.5-flash-image\n\n\nImportant: Default OpenClaw delivery path is ~/.openclaw/media/outbound/. Save generated images there so other OpenClaw flows can pick them up easily.\n\nAPI Key\n\nThe script checks for API key in this order:\n\n--api-key argument\nOPENROUTER_API_KEY environment variable\n\nOptional OpenRouter attribution headers:\n\n--site-url or OPENROUTER_SITE_URL\n--app-name or OPENROUTER_APP_NAME\nModel + Image Config\n--model <openrouter-model-id> is required (no script default)\nExample model: google/gemini-2.5-flash-image\nUse --aspect-ratio for image_config.aspect_ratio (for example 1:1, 16:9)\nUse --image-size for image_config.image_size (1K, 2K, 4K)\nUse --image-config-json '{\"key\":\"value\"}' for advanced/provider-specific extras (merged into image_config)\n\nNote: OpenRouter docs show aspect_ratio and image_size as the common image config fields for image generation. Additional keys may exist for specific providers/models (for example Sourceful features). If a request fails, remove unsupported options or switch models.\n\nNote: The script always sends modalities: [\"image\", \"text\"]. Image-only models (some FLUX variants) may reject this — if you get an unexpected error with a non-Gemini model, this may be the cause. No workaround is currently exposed via CLI args.\n\nDefault Workflow (draft -> iterate -> final)\n\nGoal: iterate quickly before spending time on higher-quality settings.\n\nDraft: smaller size / faster model\n--image-size 1K\nIterate: adjust prompt in small diffs and keep a new filename each run\nFinal: larger size or higher quality if the selected model supports it\nExample: --image-size 4K --aspect-ratio 16:9\nPreflight + Common Failures\n\nPreflight:\n\ncommand -v uv\ntest -n \"$OPENROUTER_API_KEY\" (or pass --api-key)\ntest -d ~/.openclaw/media/outbound || mkdir -p ~/.openclaw/media/outbound\nIf editing: test -f \"path/to/input.png\"\n\nCommon failures:\n\nError: No API key provided. -> set OPENROUTER_API_KEY or pass --api-key\nError loading input image: -> bad path or unreadable file\nHTTP 400 with model/image config error -> unsupported model or invalid image_config.aspect_ratio / image_config.image_size\nHTTP 401/403 -> invalid key, no model access, or quota/credits issue\nNo image found in response -> model may not support image output or request format rejected\nFilename Generation\n\nGenerate filenames with the pattern: ~/.openclaw/media/outbound/yyyy-mm-dd-hh-mm-ss-name.png\n\nExamples:\n\n~/.openclaw/media/outbound/2026-02-26-14-23-05-product-shot.png\n~/.openclaw/media/outbound/2026-02-26-14-25-30-sky-edit.png\nPrompt Handling\nFor generation: pass the user's description as-is unless it is too vague to be actionable.\nFor editing: make the requested change explicit and preserve everything else.\n\nPrompt template for precise edits:\n\nChange ONLY: <change>. Keep identical: subject, composition/crop, pose, lighting, color palette, background, text, and overall style. Do not add new objects.\nOutput\nSave the first returned image to ~/.openclaw/media/outbound/output-name.png by default (pass that full path in --filename)\nSupports OpenRouter's base64 data URL image responses (message.images[0].image_url.url)\nPrints the saved file path\nDo not read the image back unless the user asks\nExamples\n\nGenerate new image:\n\nmkdir -p ~/.openclaw/media/outbound\n\nuv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \\\n  --prompt \"A cinematic product photo of a matte black mechanical keyboard on a wooden desk, warm window light\" \\\n  --filename \"~/.openclaw/media/outbound/2026-02-26-14-23-05-keyboard-product-shot.png\" \\\n  --model google/gemini-2.5-flash-image \\\n  --aspect-ratio 16:9 \\\n  --image-size 2K\n\n\nEdit existing image:\n\nmkdir -p ~/.openclaw/media/outbound\n\nuv run ~/.openclaw/workspace/skills/openrouter-image-generation/scripts/generate_image.py \\\n  --prompt \"Change ONLY: make the sky dramatic with orange sunset clouds. Keep identical: subject, composition, lighting on foreground, and overall style.\" \\\n  --filename \"~/.openclaw/media/outbound/2026-02-26-14-25-30-sunset-sky-edit.png\" \\\n  --model google/gemini-2.5-flash-image \\\n  --input-image \"original-photo.jpg\"\n\nReference\nOpenRouter docs: https://openrouter.ai/docs/guides/overview/multimodal/image-generation"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Bawerlacher/openrouter-image-generation",
    "publisherUrl": "https://clawhub.ai/Bawerlacher/openrouter-image-generation",
    "owner": "Bawerlacher",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openrouter-image-generation",
    "downloadUrl": "https://openagent3.xyz/downloads/openrouter-image-generation",
    "agentUrl": "https://openagent3.xyz/skills/openrouter-image-generation/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openrouter-image-generation/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openrouter-image-generation/agent.md"
  }
}