APIs and capabilities

Image Generation Guide

Install the image generation skill, choose a Codex, Gemini or Grok image group, and generate or edit images with reference pictures.

To ask an AI assistant to generate or edit images, install this skill once, then describe what you need. The assistant can use the skill for these tasks. To write API requests yourself, see the API Scripting Guide.

Copy this prompt to your AI assistant

Replace `sk-XXXXX` with the image generation API key you created.

1Install and enable this image generation skill:
2https://zhenapi.ai/install/skill/image-gen/INSTALL.md
3 
4When I ask to generate an image, edit an image, or create an image from a reference,
5use this skill by default and prefer its included scripts.
6 
7Here is my API key dedicated to image generation:
8sk-XXXXX
9 
10Save this key in the IMAGE_GEN_API_KEY environment variable,
11and use it for subsequent image generation and editing requests.
12Do not include the key in code, replies or Git commits.
13 

Create a key and select a group

  1. Open https://zhenapi.ai/keys and create an API key.
  2. Choose the group for your image model and copy the complete key.
  3. Save the key in the environment variable IMAGE_GEN_API_KEY, then ask your assistant to install the skill.
  4. Keep the key out of source code, public conversations and Git. Ensure the process running the skill inherits this environment variable in every client.

Groups and image models

API key groupCommon image modelsUsage
Codex Pro (External)gpt-image-2.6-sunburst
gpt-image-2.6-flare
gpt-image-2.5-sunburst
gpt-image-2.5-flare
gpt-image-2
Recommended for general text-to-image generation and image editing.
Gemini (Official Direct)gemini-nano-banana-2.1
gemini-3.1-flash-lite-image
gemini-3.1-flash-image
gemini-3-pro-image
gemini-2.5-flash-image
For Gemini image generation. Specify the exact model ID.
Grok Enterprisegrok-imagine-image
grok-imagine-image-quality
Select the desired model explicitly in your script or prompt.

The model parameter is passed to the gateway as provided, but the model must be available for your key group. If you receive model_not_found, check your group on the API Keys page.

Example prompts after installation

Text to image
1Use the image generation skill to create a minimal blue technology-themed product poster with plenty of empty space.
Image editing
1Use the image generation skill to edit my image: change the background to light blue while keeping the subject and text unchanged.
Reference image generation
1Use the image generation skill to create a new brand visual from my reference image, preserving the subject and using a consistent color palette.
Switch models
1Use the image generation skill with the grok-imagine-image-quality model to create a cinematic banner.

Use this skill when you want an AI assistant to generate images for you. For direct API calls, response handling or application integration, open the API Scripting Guide for Python, Node.js and parameter examples.