# Install ModelKiwi image generation Install the full skill directory, not just SKILL.md. It is named `modelkiwi-image-gen` to coexist with other image tools. ## One-command installation macOS / Linux / WSL (Bash): ```bash curl -fsSL https://www.modelkiwi.com/install/image-gen.sh | bash ``` Windows (PowerShell, not cmd): ```powershell irm https://www.modelkiwi.com/install/image-gen.ps1 | iex ``` The installer checks Node.js 18+, offers nvm on macOS/Linux or winget on Windows if it is missing, lets you choose a client, asks for your ModelKiwi key with hidden input, verifies the downloaded files, and installs them. Existing versions and replaced key configuration are backed up. It makes no image API request and does not alter your client's model provider, MCP or sandbox configuration. Restart/reload the AI client after installation, then say: “Use $modelkiwi-image-gen to generate a minimalist green product poster.” ## Clients and paths - Codex: `${CODEX_HOME:-~/.codex}/skills/modelkiwi-image-gen` - Claude Code: `${CLAUDE_CONFIG_DIR:-~/.claude}/skills/modelkiwi-image-gen` - OpenCode: `${XDG_CONFIG_HOME:-~/.config}/opencode/skills/modelkiwi-image-gen` - OpenClaw: `~/.openclaw/workspace/skills/modelkiwi-image-gen` for the default workspace - Hermes: `${HERMES_HOME:-~/.hermes}/skills/modelkiwi-image-gen` - Other/custom workspaces: choose the custom directory option and enter that client's skill directory including the final `modelkiwi-image-gen` folder. Windows uses the equivalent directories under your user profile. OpenClaw users with a custom workspace must choose its actual skills directory. Clients must support local skills and script execution; a chat interface without those features cannot run the skill. ## AI-assisted installation If an AI client cannot operate an interactive terminal, it can install files without touching credentials: ```bash curl -fsSL https://www.modelkiwi.com/install/image-gen.sh | bash -s -- --client codex --no-config ``` Supported `--client` values: `codex`, `claude`, `opencode`, `openclaw`, `hermes`. Use `--directory /absolute/skill/directory` for a custom location. Never choose a generic home or project directory. Do not install packages or replace user configuration beyond the scope authorized by the user. Alternatively, read and save every resource from the public directory: `https://www.modelkiwi.com/install/skill/modelkiwi-image-gen/` - SKILL.md - INSTALL.md - scripts/node/image-gen.js - scripts/python/image_gen.py - references/api-recipes.md - agents/openai.yaml - package.json `manifest.json` publishes the version and SHA-256 hashes. This guards against incomplete/corrupt downloads; it is not an independent cryptographic signature. Use the original ModelKiwi HTTPS origin. ## Key configuration Create a key at https://www.modelkiwi.com/keys using group `default`, with permission for the selected image model and enough quota/balance. Keys from upstream services do not substitute for a ModelKiwi key. The normal installer saves `IMAGE_GEN_API_KEY` in: - macOS/Linux: `${XDG_CONFIG_HOME:-~/.config}/modelkiwi/.env` - Windows: `%APPDATA%\modelkiwi\.env` The file contains a secret; keep it private and out of Git. Unix files use mode 600. The PowerShell bootstrap restricts the file and backups to the current user. Existing key configuration is preserved unless the user chooses replacement. Old credential backups also contain secrets. Alternatively, set a process environment variable before starting your AI client: ```bash export IMAGE_GEN_API_KEY='YOUR_MODELKIWI_KEY' ``` ```powershell $env:IMAGE_GEN_API_KEY = 'YOUR_MODELKIWI_KEY' ``` Environment variables set in a terminal are inherited only by processes started from that terminal. The saved ModelKiwi config works without changing shell startup files. You may use `IMAGE_GEN_ENV_FILE` or `--env-file` for another existing private dotenv file. The generation scripts only read these files; they do not create, modify or upload dotenv files. The API key is sent only as the Authorization header to `https://api.modelkiwi.com/v1/images/generations`. ## Supported calls ```bash node scripts/node/image-gen.js --prompt "A cinematic landscape in Brazil, warm natural light" --out ./landscape node scripts/node/image-gen.js --model grok-imagine-image-quality --prompt "A minimal mint-green product photo" --out ./product python3 scripts/python/image_gen.py --prompt "A cinematic landscape in Brazil" --out ./landscape ``` Only text-to-image is currently verified. The clients reject editing modes, unconfigured model IDs and quantities other than 1 before making a paid request. They determine image extension from actual bytes. No automatic retries or upstream fallback domains are used. ## Reinstall, restore and remove Run the installation command again to update. The previous skill becomes `modelkiwi-image-gen.bak-`. Replaced key files become `.env.bak-`. To restore, close the client, move the current skill aside and rename the chosen backup to `modelkiwi-image-gen`; similarly restore the chosen key config if needed. To uninstall, remove only this skill directory from the selected client. If no other client uses the credentials, remove the ModelKiwi `.env` file and its backups too. Removing local files does not revoke your server-side API Key; revoke it in the ModelKiwi console if desired.