Sell images

This page shows how to sell images. Pick a path, give the agent the route, then register and quote the deployment. Quote a media model has the features, the sizes and the prices.

Choose a path

Path Use it when
OpenAI-compatible API Your API has POST /images/generations and answers in the OpenAI format. You run no agent.
Your own agent Your upstream has other routes. Send an image event for each image.

The rest of this page is for the reference agent. It reads these routes from your upstream.

Give the agent this route

The agent calls POST {base}/images/generations with Authorization: Bearer <key>. Set {base} in LIQUID_UPSTREAM_BASE_URL.

{
  "model": "acme-image-1",
  "prompt": "A trading floor made of water",
  "n": 2,
  "size": "1024x1024",
  "output_format": "png",
  "response_format": "b64_json"
}

Answer with data, a list of images. Each image has b64_json or url. An entry with neither is not an image, and the agent does not count it.

{ "data": [{ "b64_json": "iVBORw0KGgo…" }, { "b64_json": "iVBORw0KGgo…" }] }

The agent charges the images that you return, not the images that the buyer asked for. If data is empty, the job fails and the exchange tries the next offer.

Declare the controls

A buyer's seed, background, output_compression and stream reach only an offer that declared image.seed, image.background, image.output_compression or image.stream. The first-party OpenAI adapter declares image.background and image.output_compression for a gpt-image model, and image.seed when the route has a seed rule. It never declares image.stream.

To send draft images for image.stream, write your own agent and send image_partial events. See Images.

Register and quote

Register the deployment with kind set to image_generation. List the sizes and formats that it makes, and max_count. The tiers and shapes that buyers ask for come from sizes. Register deployments has the fields.

See Quote a media model for an example.

Limits