Generate Image

VerifiedCaution

Generate images using OpenAI or Google Gemini APIs. Requires an API key.

Sby Skills Guide Bot
ContentIntermediate
7/22/2026
Claude Code
#image-generation#openai#gemini#visual-assets#api-keys

Recommended for

Automated summary

Generates images through the OpenAI (gpt-image-2) or Google Gemini (Nano Banana) APIs and saves the resulting file to disk.

Strengths

  • Clear workflow: API key detection, provider selection, generation, then reporting where the image was saved
  • Built-in conversational onboarding that walks the user through obtaining a key and persisting it to their shell profile
  • Concrete API references for both providers, including request bodies, sizes, quality levels and base64 decoding

Limitations

  • Requires a valid API key; nothing works until the environment is configured
  • No editing, inpainting or variations of an existing image — generation from a prompt only
  • The Gemini section is partly guidance only, since endpoints and model names vary by version
When to use it

Use it when you need quick visual assets such as icons, sprites, textures, artwork or mockups.

When not to use it

Avoid it when you have no API key, need to modify an existing image, or require deterministic royalty-free assets.

Security analysis

Caution
Quality score72/100

The skill is a straightforward image-generation integration. It does not contain destructive commands, obfuscated payloads, curl|sh, or exfiltration to unknown hosts; all endpoints are the official OpenAI and Google APIs and the workflow is transparent. The risk is moderate rather than severe: it handles user API keys, proposes persisting them to a shell profile, and asks the agent to log request headers, all of which touch secrets and could leak credentials if followed literally. This is legitimate use of network and credential tools, so 'caution' rather than 'risky'.

Findings
  • •Handles long-lived API secrets: instructs the agent to take a user-supplied API key and persist it to the user's shell profile (step 3 of Onboarding), which writes credentials to disk in plaintext and leaves them in every future shell session.
  • •Instructs logging outgoing request headers and body 'with keys redacted' to aid debugging — header logging is a common way secrets leak into logs if redaction is imperfect, and no redaction mechanism is specified.
  • •Performs outbound network requests with bearer credentials to api.openai.com and generativelanguage.googleapis.com; destinations are legitimate and official, but this is privileged network + secret access with no declared allowed-tools.
  • •Gemini auth section suggests both Authorization: Bearer tokens and ?key=<KEY> query-param usage; query-string API keys are additionally prone to appearing in logs/proxies.
  • •Encourages parallel batch API calls, which can amplify cost/quota without any guardrails mentioned.
How this analysis is made

Examples

App icon
Generate a 1024x1024 app icon of a stylized fox head, flat vector style, deep orange background, no text
Game sprite
Create a pixel-art sprite sheet texture for a 2D platformer, 16-bit style, transparent-friendly dark background
UI mockup
Make a mockup image of a minimalist dashboard UI on a laptop screen, soft neutral lighting, high quality

name: generate-image description: >- Generate images using AI. Use when asked to generate, create, or make images, textures, icons, sprites, artwork, visual assets, or mockups. Supports OpenAI (gpt-image-2) and Google Gemini (Nano Banana). Requires an API key for the chosen provider. argument-hint: "[description of the image to generate]" license: MIT metadata: version: "2.1.0" providers: "openai, gemini"

Generate Image

You are an image generation assistant. When invoked, follow the workflow below.

Workflow

  1. Check for API keys — check whether SKILL_IMAGE_GEN_OPENAI_KEY and/or SKILL_IMAGE_GEN_GEMINI_KEY are set in the environment.
  2. If one key is set — use that provider. No need to ask.
  3. If both are set — pick based on context (OpenAI for polish, Gemini for speed), or ask if the user has a preference.
  4. If no keys are set — run the Onboarding section.
  5. Generate the image using the appropriate API reference.
  6. Tell the user where the image was saved.

Onboarding

Only run this if no keys are set. Guide the user conversationally.

  1. Ask which provider they'd like to use:
    • OpenAI (gpt-image-2) — High quality, excellent text rendering, paid per image
    • Google Gemini (Nano Banana) — Fast, free tier available, great for iteration
  2. Direct them to get an API key:
    • OpenAI → https://platform.openai.com/api-keys
    • Gemini → https://aistudio.google.com/apikey
  3. Once they provide the key, set SKILL_IMAGE_GEN_OPENAI_KEY or SKILL_IMAGE_GEN_GEMINI_KEY in the current session and persist it to the appropriate shell profile.
  4. Proceed to generate the image they originally asked for.

API Reference: OpenAI

Method: POST URL: https://api.openai.com/v1/images/generations

Headers:

  • Authorization: Bearer <SKILL_IMAGE_GEN_OPENAI_KEY>
  • Content-Type: application/json

Body (JSON):

{
  "model": "gpt-image-2",
  "prompt": "<user prompt>",
  "n": 1,
  "size": "1024x1024",
  "quality": "medium"
}

| Field | Default | Options | |---|---|---| | model | gpt-image-2 | gpt-image-2, gpt-image-1 | | size | 1024x1024 | 1024x1024, 1024x1536, 1536x1024, auto | | quality | medium | low, medium, high |

Response: data[0].b64_json contains the base64-encoded image. Decode it and save to the output path. If data[0].url is present instead, download the image from that URL.

API Reference: Google Gemini (Nano Banana)

Method: POST (uses Generative Language Image or Content endpoint depending on model)

URL (examples):

  • Text+image/content endpoint: https://generativelanguage.googleapis.com/v1beta/models/<model>:generateContent
  • Image-specific endpoint (newer image models may use): https://generativelanguage.googleapis.com/v1/models/<model>:generateImage

Authentication (recommended):

  • Preferred: Authorization: Bearer <ACCESS_TOKEN> (use OAuth2 service account or short-lived access token).
  • API Key (legacy / limited): can be passed as x-goog-api-key: <KEY> header or ?key=<KEY> query param, but some image-generation models require OAuth/Bearer tokens.

Headers:

  • Authorization: Bearer <ACCESS_TOKEN> (preferred)
  • Content-Type: application/json

Body (JSON) — content endpoint (text+image):

{
  "contents": [{"parts": [{"text": "Generate an image: <user prompt>"}]}],
  "generationConfig": {"responseModalities": ["IMAGE"]}
}

Body (JSON) — image-specific endpoint (if supported by model):

{
  "prompt": "<user prompt>",
  "imageConfig": {"modes": ["RGB"], "size": "1024x1024"}
}

| Field | Default | Options | |---|---|---| | model (in URL) | gemini-2.0-flash-exp or an image-capable model | e.g., gemini-2.5-flash-image, image-bison |

Response (guidance):

  • For content endpoint: inspect candidates[0].content.parts[] for entries with inlineData.data (base64 image) and inlineData.mimeType.
  • For image endpoint: response commonly includes images or data field carrying base64-encoded image(s) or URLs — decode/save accordingly.

Notes & troubleshooting:

  • Many Google image models now require OAuth Bearer tokens; prefer service-account-based short-lived tokens rather than long-lived API keys.
  • If 401/403 errors occur, verify token scopes and that the calling project has the Generative API enabled.
  • If requests return 400, confirm request body shape and model name.
  • Log outgoing request headers and body (with keys redacted) to aid debugging.

Error cases: error key (API error), promptFeedback.blockReason (safety block), finishReason: "SAFETY" (filtered).

Migration guidance:

  • Update integrations to support both Authorization: Bearer and x-goog-api-key but prefer and document using OAuth where image models require it.
  • Add tests that mock both endpoints and assert request shape, headers, and image decoding behavior.

Agent Guidelines

  • Choose the output path intelligently — save to the project's relevant directory (e.g., assets/, images/, or the current directory).
  • For game textures, enrich prompts with "seamless", "tileable", "game asset".
  • For batch generation, make multiple API calls in parallel.
  • If the user asks to switch providers or what options are available, explain both and help them set up.
  • Always create the output directory before saving.
  • Ensure special characters in the user's prompt are properly escaped in the JSON body.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/generate-image-mrwakgb7/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/generate-image-mrwakgb7' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/generate-image-mrwakgb7/download' --output '.skill-downloads/generate-image-mrwakgb7/SKILL.md.part' && mv '.skill-downloads/generate-image-mrwakgb7/SKILL.md.part' '.skill-downloads/generate-image-mrwakgb7/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/generate-image-mrwakgb7/SKILL.md' && test -s '.skill-downloads/generate-image-mrwakgb7/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/generate-image' && cp -R '.skill-downloads/generate-image-mrwakgb7' '.claude/skills/generate-image'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/generate-image-mrwakgb7'

openskills read 'generate-image-mrwakgb7'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/generate-image-mrwakgb7/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills