Image generation in products
For engineers
Generating and editing images through APIs, prompt templates for consistent output, moderation, provenance labels and cost control
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
A web app calls the image API straight from the browser with the team's key. What is the main problem?
Check yourself · 2 of 5
You want a new background behind a product and the product left alone. What should the mask cover?
Check yourself · 3 of 5
Which part of an image prompt belongs in the fixed template and not in a user slot?
Check yourself · 4 of 5
A user's prompt passes input moderation: "a crowd at a rally". Why still check the generated image?
Check yourself · 5 of 5
Which layer of provenance is the one most viewers actually read?
Topics
- Calling image generation APIs from a product4 min read · Server-side calls to OpenAI, Gemini and FLUX image endpoints with size, quality, timeouts, storage and templated prompts
- Editing images with masks and reference images4 min read · Inpainting masks, conversational edits and reference images that change one region and keep faces, logos and text intact
- Prompt templates for consistent product imagery4 min read · Versioned prompt templates with fixed brand rules, validated slots, in-image text caveats and batch checks for style drift
- Moderating prompts and generated images4 min read · Input and output moderation for image features, provider refusals, likeness, minors and trademarks, and clear block messages
- Labeling generated images with content credentials4 min read · C2PA credentials, invisible watermarks, visible AI labels and the EU AI Act marking duty, with the pipeline steps that strip metadata
- Estimating and capping image generation costs4 min read · Per-image pricing by size and quality, retries and variations, caching and per-user quotas that keep an image feature inside budget
Start here
- Image generation guide (OpenAI) (opens in a new tab)DocsFree
Size, quality, edit and mask parameters for the OpenAI image endpoints.
- Image generation with Gemini (Google) (opens in a new tab)DocsFree
Gemini's text-to-image and conversational editing, including reference images and its watermark note.
- FLUX documentation (Black Forest Labs) (opens in a new tab)DocsFree
How the FLUX API submits a job and returns a polling address instead of the image.
Helps to know first
110 questions · last verified 2026-12