# Generate consistent product images with Driftflight's API

Driftflight's text-to-image API has no seed or reference image, so the controls for a consistent set of product images are three values sent the same on every request: a `preset`, a prompt template that changes only the product, and a `model` tier. Each product is one request to `POST https://agents.driftflight.com/zcj/u42pu506ctc9/v1/images/generate`, at $0.06 on studio, with template drafts on sketch at $0.01. You send your credential as a bearer token, pay each request's 402 price quote over x402 or MPP, retry the same request, and download the image from `imageUrl`.

## At a glance

- **Endpoint:** `POST https://agents.driftflight.com/zcj/u42pu506ctc9/v1/images/generate`, one image per request, with your credential as a bearer token
- **Body:** `prompt` (required), `model` (`sketch`, `studio` or `gallery`; billed as studio if omitted), `preset` (one of six styles)
- **Consistency controls:** the same `preset`, prompt template and `model` on every request in the set
- **Price per image:** sketch $0.01, studio $0.06, gallery $0.14
- **Payment:** a 402 is the price quote for one request, which you pay and retry. x402 and MPP are the wallet rails, settling in USDC. No account or API key, but every call still needs a registered agent credential as a bearer token, which a wallet cannot replace.
- **Response:** JSON with `imageUrl`, `model`, `preset`, `licence` and `credits`
- **Limits:** the API reference lists three body fields, `prompt`, `model` and `preset`, and no seed, reference-image, size or batch field. Every tier lists `1408x768`.
- **Full purchase flow:** [the buyer skill](https://agents.driftflight.com/zcj/u42pu506ctc9/SKILL.md)

## Fix the preset, template and tier for the set

The API reference lists no seed or reference-image field to hold a look. Consistency comes from sending the same three values every time.

| Value | Field | Set it to |
| --- | --- | --- |
| Style | `preset` | One of `editorial`, `product-studio`, `film-noir`, `botanical`, `watercolor` or `isometric`, the values the API reference lists for `preset` |
| Wording | `prompt` | A template with one product slot, such as `{product}, centered on a plain warm grey background, soft diffused studio light, three-quarter view` |
| Tier | `model` | `sketch` to test the template, `studio` for every image in the set |

Only the product slot changes between requests. Background, light and angle stay word for word.

## Render the catalog set, one request per product

1. Test the template on sketch. Send the request unpaid, with your credential as a bearer token:

   ```bash
   curl -i -X POST https://agents.driftflight.com/zcj/u42pu506ctc9/v1/images/generate \
     -H 'Authorization: Bearer <token>' \
     -H 'Content-Type: application/json' \
     -d '{"prompt": "a matte black ceramic coffee mug, centered on a plain warm grey background, soft diffused studio light, three-quarter view", "model": "sketch", "preset": "product-studio"}'
   ```

   The storefront answers `402 payment_required`, and a request sent without your bearer credential is refused with `401 bearer_required` before any price is quoted. The body carries `payment.amountUsd` and a `protocols` block with a challenge for each rail. Nothing is charged yet, so it is safe to stop here.

2. Pay the 402 with your x402 or MPP client and retry the same request with the proof attached and the bearer still on it: in the `x-payment` header for x402, or as `Authorization: Payment <credential>` for MPP, with your bearer token sent as `ZC-Agent-Authorization: Bearer <token>`. A paid request returns `200` with this shape:

   ```json
   {"imageUrl": "<URL of the image>", "model": "<tier>", "preset": "<preset>", "licence": "<licence>", "credits": "<credits>"}
   ```

   This example draft paid $0.01. If the wording is wrong, edit the template and draft again on sketch, where each attempt costs least.

3. Render each product on studio. Set `model` to `studio`, keep `preset`, fill only the product slot, and send the same bearer credential:

   ```json
   {"prompt": "a tan leather card wallet, closed, centered on a plain warm grey background, soft diffused studio light, three-quarter view", "model": "studio", "preset": "product-studio"}
   ```

   Four products fill the slot in the example set, each its own request and its own 402: `a matte black ceramic coffee mug`, `a tan leather card wallet, closed`, `a frosted glass candle jar with a wooden lid` and `a natural canvas tote bag`.

   - The mug render paid $0.06.
   - The wallet render paid $0.06.
   - The candle jar render paid $0.06.
   - The tote bag render paid $0.06.

4. Download each image from its `imageUrl`, a public URL, and save it under its product's name with the extension its content type gives:

   ```bash
   curl -sL "<imageUrl>" -o images/matte-black-mug.<ext>
   ```

5. Record the three values next to the images, so products added later use the same ones:

   ```json
   {"preset": "product-studio", "model": "studio", "template": "{product}, centered on a plain warm grey background, soft diffused studio light, three-quarter view"}
   ```

## Budget for the set

A set costs its drafts times $0.01 plus its products times $0.06. One draft and four products cost $0.25. Three drafts and fifty products cost $3.03. Pay-as-you-go is one 402 per call, so compare each quote's `payment.amountUsd` with the budget left and stop before paying one that exceeds it.

Each tier's price is below the card rail's per-call floor of $0.50, so a card pays through Prepaid credits instead. POST to the credits plan's `purchase.url` from [the catalog](https://agents.driftflight.com/zcj/u42pu506ctc9/manifest.json), a `/plans/{planId}/purchase` path, with a bearer credential and an `amountUsd` of at least $1. A bearer credential is the agent identity the storefront issues; register one through [auth.md](https://agents.driftflight.com/zcj/u42pu506ctc9/auth.md). Image calls then draw down the balance.

A credential that a human has claimed with a verified email has 3 free sketch images, sent with the `zc-mode: free` header, which can cover drafts.

## Limits

- One image per request. The API reference lists no batch field, so a set of fifty products is fifty requests.
- A request without `model` is billed as studio. Set it on every request.
- After a timeout on a paid request, check the result before retrying, so you do not pay twice.

## Errors

| Status or code | Meaning | Action |
| --- | --- | --- |
| `401 bearer_required` | The request carried no agent credential | Register one, send it as a bearer token and retry; a wallet payment cannot stand in for it |
| `402 payment_required` | The request is unpaid; the body is the quote | Pay it and retry the same request |
| `400 invalid_request` | The body is malformed | Fix the JSON and send again |
| `settlement_failed` | The payment did not settle; `settlementReason` says why | Fix the wallet, then send the request again for a fresh 402 |
| `payment_consumed` | That payment was already settled | Check the original request's delivery before paying again |

## Frequently asked questions

### How do I keep AI product images consistent without seeds or reference images?

Send the same `preset`, the same prompt template and the same `model` on every request, and change only the product named in the template. Driftflight's API reference lists no seed, reference-image or colour field, so those three values are the controls you have.

### Which Driftflight preset suits product photos?

The example set uses `product-studio`, one of the six presets the API reference lists. Whichever preset you choose, use the same one on every request in the set.

### What is the price of catalog images on Driftflight?

Each studio image costs $0.06 and each sketch draft $0.01. Multiply by the number of products and drafts, such as $3.03 for three drafts and fifty products.

### Can I add products to the set later?

Yes. Use the recorded preset, template and tier, and put the new product in the slot.

### Do I need an API key or account?

No account or API key is needed, but every call, paid or free, needs a registered agent credential sent as a bearer token from the first request; a wallet payment cannot stand in for it. Registering one is free and needs no human step. Claiming it to a human's verified email is optional and can come later: it makes what you buy durable and opens the free allowance.

## Keep reading

- [Buyer skill](https://agents.driftflight.com/zcj/u42pu506ctc9/SKILL.md): the full purchase flow
- [How to pay](https://agents.driftflight.com/zcj/u42pu506ctc9/payment.md): the 402 flow, each rail and plan purchases
- [Error reference](https://agents.driftflight.com/zcj/u42pu506ctc9/errors.md): every error code
- [Catalog](https://agents.driftflight.com/zcj/u42pu506ctc9/manifest.json): live prices and plans

---

Updated 2026-11-17. All Driftflight guides: https://agents.driftflight.com/guides.md. Storefront: https://agents.driftflight.com/zcj/u42pu506ctc9/llms.txt.
