- Home
- Skills
- Madappgang
- Claude Code
- Gemini Api
gemini-api_skill
- TypeScript
215
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill madappgang/claude-code --skill gemini-api- SKILL.md2.7 KB
Overview
This skill is a concise reference for using the Google Gemini image API via a TypeScript-based CLI and scripts. It documents supported models, aspect ratios, CLI flags, error codes, and retry behavior to help developers generate, edit, and iterate on images reliably. The content focuses on practical settings for image quality, composition, and operational recovery.
How this skill works
The skill inspects and explains the CLI options and API parameters used to call Gemini image models, including text-to-image generation, image editing with reference inputs, and style templates. It lists supported model IDs and recommended resolutions, maps common aspect ratios to use cases, and enumerates error codes with recovery steps. Retry behavior and exponential backoff details are provided to handle transient failures automatically.
When to use it
- Generate high-quality images or quick prototypes using the appropriate Gemini model (e.g., gemini-3-pro-image-preview for up to 4K).
- Edit or restyle photos by providing an existing image and a reference style file with the --edit and --ref flags.
- Produce multiple variations or batches to select the best result and speed up iteration.
- Integrate image generation into CI or scripts while handling transient network and server errors automatically.
- Choose aspect ratios for platform-specific outputs (social, mobile stories, cinematic widescreen).
Best practices
- Be specific in prompts: include style, lighting, composition, and focal details for predictable outputs.
- Use markdown-style templates for repeatable style application across batches and projects.
- Provide reference images for close stylistic matching instead of relying on text prompts alone.
- Generate variations in batches to compare results and iterate by editing selected outputs.
- Configure --max-retries and rely on exponential backoff for rate limits and transient network errors.
Example use cases
- Create a 4K promotional image with gemini-3-pro-image-preview and --aspect 16:9 for desktop headers.
- Edit a product photo using --edit product.jpg and --ref style.png to match a brand look.
- Generate social media icons with --aspect 1:1 and a compact prompt for consistency across platforms.
- Produce mobile story assets using --aspect 9:16 and batch generation for A/B testing creative variations.
- Automate image generation in scripts with --max-retries set higher for unstable network environments.
FAQ
Create an API key at makersuite.google.com/app/apikey and export it as GEMINI_API_KEY in your environment.
Which model should I pick for best quality?
Use gemini-3-pro-image-preview for highest quality up to 4K; use gemini-2.5-flash-image for faster, lower-resolution iterations.