Generate images for your pages
How to get the images a product's pages need, by having your agent write precise prompts and hand them to an image model through Codex or an API.
Orvio products lean on imagery. The photos, renders and illustrations are as much part of the design as the type and the colours. When you add a page, adapt a product to another field or restyle from one, every image slot needs an image that belongs.
Your agent cannot create images itself. It can write an excellent image prompt, and an image model can turn that prompt into a file. This page shows two ways to connect the two. Pick one, or neither: the Orvio skill works without them, and then hands you the prompts to run yourself.
What the agent does#
With the Orvio skill, the agent treats imagery as part of the design direction:
- Extend: it reads the product's images first (subjects, framing, light, colour grade, grain, ratio per slot) and makes new ones that match.
- Adapt: it changes the subjects for the new field and keeps the treatment.
- Restyle: it declares an imagery direction in the system file, next to type and colour.
For each slot it then writes a generation prompt with the subject, the composition and framing, the light, the palette from the product's tokens, the lens and texture, the slot's exact ratio, and a list of things to avoid. It looks at the result, regenerates when needed, and saves the file with real alt text.
To ask for this, add a line to any prompt in the Prompt library, for example: "Then list every image slot with its ratio, write a generation prompt for each, and save each result with alt text."
Route 1: the Codex CLI, on your ChatGPT plan#
If you have a paid ChatGPT plan, the OpenAI Codex CLI can generate images with its built-in image generation. OpenAI documents that this counts toward your general Codex usage limits, not as a separate per-image charge. It is not unlimited: image generations use the included limits faster than ordinary turns, and once the included limits are used up they draw from credits. Image generation is not on the Free plan. Check the Codex pricing page for what your plan includes.
Install Codex
On macOS and Linux, use OpenAI's installer:
Install$ curl -fsSL https://chatgpt.com/codex/install.sh | shor npm:
Install with npm$ npm install -g @openai/codexOther options are on the Codex CLI page.
Sign in with ChatGPT
Run
codexin a project folder. On first run, choose Sign in with ChatGPT.Ask for an image
In an interactive Codex session, describe the image in plain language. To call the image skill explicitly, include
$imagegenin the prompt. OpenAI states that built-in image generation usesgpt-image-2.In a Codex session$imagegen A baker folding dough on a floured oak bench, soft window light from the left, warm neutral palette, shallow depth of field, fine grain. 16:9, landscape. No text, no logos, no watermark, no extra fingers.
Run it from your agent
Your agent writes the prompt like the one above and runs Codex non-interactively.
Non-interactive run$ codex exec --skip-git-repo-check \ --sandbox read-only \ "$imagegen <the prompt>"
Then it finds the image Codex made, copies it into the project under the slot's name, and looks at it.
Two details are not in OpenAI's documentation, so treat them as tips, not guarantees. First, whether codex exec can generate images: it has worked when tried, but check that a run produced exactly one image. Second, where the file lands: in our tests Codex saved generated images under ~/.codex/generated_images/. If you do not find it there, ask Codex for the path. Output sizes are not documented either, so put the ratio in the prompt and check the result.
For larger batches, OpenAI suggests setting OPENAI_API_KEY and generating through the API, so API pricing applies. That is route 2.
Route 2: an image API, billed per use#
Connect your agent to an image model through an API. You pay the provider for what you generate, so set a spending limit in the provider's dashboard before you start. The example uses OpenAI's Image API. Other providers work the same way: an endpoint, a model name, a size, and an API key read from the environment.
Create an API key in your OpenAI account and put it in the environment. Never write it into a project file or a prompt.
$ export OPENAI_API_KEY="…"
$ curl -s https://api.openai.com/v1/images/generations \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d { "model": "gpt-image-2.5-flare", "prompt": "<the prompt>", "size": "1536x1024" }' \ | jq -r '.data[0].b64_json' \ | base64 --decode > hero.png
- Endpoint:
POST https://api.openai.com/v1/images/generations. Edits use/v1/images/edits. - Model: OpenAI's guide names
gpt-image-2.5-sunburst(precise editing) andgpt-image-2.5-flare(fast, high-quality everyday generation). Model names change, so check the guide for the current ones. - Size: the guide recommends
1024x1024,1536x1024and1024x1536, and supports custom sizes. Pick the size nearest the slot's ratio, then crop. - Response: the image comes back as base64 in
data[0].b64_json, which the example decodes. - Verification: OpenAI may ask you to complete API Organization Verification before you can use its GPT Image models.
Cost is per token, not a flat price per image: the pricing page lists rates for image and text tokens, so the cost depends on quality and size. Prices change, so none are quoted here. See OpenAI API pricing and the image generation guide.
Rights, and what is yours to check#
Generated images are your responsibility. Before you ship one:
- Read the provider's terms for the plan or API you used, in particular what they say about ownership and permitted use of outputs: OpenAI terms of use. Terms differ between providers and change.
- Do not ask for a real person's likeness, a brand's logo or another artist's work.
- Keep the prompt and the tool name with each image so you can show where it came from.
- Look at every image. A generated image can contain errors or accidental resemblances, and you decide whether it goes live.
This is general information, not legal advice. The Orvio licence covers the product's source, not images you generate; see The licence in practice.