GPT Image

image_generate creates or edits an image with OpenAI’s built-in GPT image generation. It runs through the connected ChatGPT/Codex account (OAuth) or an OpenAI API key. The image is saved as a PNG with a provenance sidecar and returned to the agent so it can review the result.

The creative-director uses it for stills (strongest for in-image text, product edits from reference photos, and layout). The /video workflow uses it for mood frames and for the GPT image + motion generation path.

Parameters

ParameterDescription
promptFull art-direction brief: subject, composition, framing, lighting, palette, exact text in quotes, style references
size1024x1024, 1024x1536 (portrait), 1536x1024 (landscape), or auto (default)
qualitylow, medium, high (default), or auto
backgroundtransparent, opaque, or auto
referencesImage paths to edit or match: product shots, brand marks, previous outputs
slugCampaign slug; output goes to outputs/creatives/<slug>/
variantIdFile name without extension, e.g. v1-hero. Defaults to a timestamp
outputExplicit .png path; overrides slug and variantId
backendopenai-codex (ChatGPT account) or openai (API key). Default: whichever is connected, Codex first
hostModelOpenAI chat model that drives the image tool. Default: newest connected

To iterate, pass the previous output in references with a precise change request.

Output

  • outputs/creatives/<slug>/<variant-id>.png
  • outputs/creatives/<slug>/<variant-id>.json — backend, host model, prompt, revised prompt, size, quality, background, reference paths, duration, timestamp

Setup

Connect an OpenAI Codex (ChatGPT) account or an OpenAI API key. In the CLI, use openmarketing model login (or /login in the REPL). In the desktop app, use the Accounts settings. If both are connected and one fails, the tool falls back to the other. An expired sign-in shows an error asking you to sign in again.

Source

extensions/ads-tools/models.ts.