CLI & API

Image Generation

Generate logos, heroes, and marketing art via CLI or HTTP API.

Generate web graphics and logos through the site API — no web UI required.

Configuration details: CLI & API Guide.

Prerequisites

  1. Create a key at Settings → API Keys (sk-...)
  2. Configure the CLI:
pnpm ads login --host https://modkie.com --api-key sk-xxxxxxxx

Or environment variables:

ADS_HOST=https://modkie.com
ADS_API_KEY=sk-xxxxxxxx

Commands

Generate and wait

pnpm ads image generate \
  --preset logo \
  --prompt "minimal wordmark, flat vector, white background" \
  --out ./public/brand/logo.png

Optional: --timeout 300000 (milliseconds, default 180000).

Generate and upload to media library

pnpm ads image generate \
  --preset web-hero \
  --prompt "SaaS dashboard hero, clean lighting, no text" \
  --out ./public/marketing/hero.png \
  --upload \
  --json

--json output example:

{
  "taskId": "...",
  "status": "success",
  "imageUrl": "https://...",
  "localPath": "./public/marketing/hero.png",
  "url": "https://cdn.../uploaded.png"
}

Query a task

pnpm ads image query --task-id <uuid> --json

List capabilities / schema

pnpm ads actions list
pnpm ads actions schema ai.image.generate_and_wait

Presets

presetAspectUse case
logo1:1Logo, app icon
web-hero16:9Homepage / landing hero
web-section4:3Feature section art
og-image16:9Social share (no text overlay)

CLI flags vs API fields

FlagAPI field
--promptprompt
--presetpreset
--scenescene
--providerprovider
--modelmodel
--aspectaspectRatio
--resolutionresolution
--timeouttimeoutMs
--uploadtriggers storage.upload_image

API-only fields: imageInput, options, workspaceId.

HTTP examples

Generate (blocking):

curl -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -X POST https://modkie.com/api/actions/ai.image.generate_and_wait \
  -d '{"preset":"logo","prompt":"minimal tech logo"}'

Image-to-image:

curl -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -X POST https://modkie.com/api/actions/ai.image.generate_and_wait \
  -d '{
    "prompt": "same style portrait",
    "scene": "image-to-image",
    "imageInput": ["https://example.com/reference.png"],
    "timeoutMs": 300000
  }'

Async create + poll:

curl -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -X POST https://modkie.com/api/actions/ai.image.generate \
  -d '{"preset":"logo","prompt":"minimal tech logo"}'

API endpoints

MethodURL
GEThttps://modkie.com/api/actions
GEThttps://modkie.com/api/actions/ai.image.generate_and_wait/schema
POSThttps://modkie.com/api/actions/ai.image.generate_and_wait
POSThttps://modkie.com/api/actions/ai.image.query

Auth: Authorization: Bearer sk-xxx or X-Api-Key: sk-xxx