Skip to main content
POST /v1/media/images renders synchronously: the reply carries the finished files and what the render cost. There is no job to poll — an image is done before the request returns, so it is never a media_job. The same render is what an agent’s generate_image tool does; the catalogue is shared.

The image generation object

string
Always image_generation.
string
The model that rendered, which is the one you named or the default it picked.
File[]
One file per rendered image, n of them when the model produced that many. Each is published and carries source.type = image_generation.
integer
What was debited for the render, in integer micro-USD, on the media tier. See Pricing.

Generate images

POST /v1/media/images200 OK — scope agents:write, Idempotency-Key required.
string
required
What to render.
string
A model id from GET /v1/media/models?kind=image. Omitted, the cheapest priced image model is used; an id the catalogue does not know is validation_failed.
string[]
Up to 4 public http(s) reference images for an edit or an image-to-image render. A private or loopback host is validation_failed.
integer
How many images, 1–4. Default 1. Every one is filed — none is dropped.
string
Such as 16:9 or 1:1. Passed to the model as-is.
integer
Repeat an earlier result.
Read the bytes with GET /v1/files/{id}?download=true.

Billing

A render is billed what it actually cost, once it has happened, on the media tier; nothing is quoted beforehand because the catalogue publishes no price for most models. Before rendering, the organization’s prepaid balance is checked against a small floor — insufficient_credits if it is below it — and the debit settles under the request’s idempotency key, so a replayed request returns the same files and charges once. A render the model refuses or fails is provider_error and is not billed.

Errors

Stock photos

GET /v1/media/stock — scope agents:read Searches a stock photo library and returns up to count photos, each with a direct image URL at the size you asked for, a small preview, and the photographer credit the licence asks you to show. Free: a search is booked to the ledger as a search line at $0, so it shows up in a spend breakdown as a call that happened, not as one that was never priced.
string
required
What the photo should show. 1–200 characters.
number
default:"10"
How many photos to return, 1–30. There is no cursor: count is the whole page.
string
landscape, portrait or square.
string
A dominant colour — a name such as red, blue, brown, black, white, or a hex value such as #978E82.
string
The image size url points at: small, medium or large. Default large. Picks the rendition only — it does not narrow the results.

The stock photo object

string
Always stock_photo.
string
The library’s own id for the photo. Opaque and unprefixed — it is not a Vetta resource id and cannot be fetched on its own; keep the photo by importing its url as a file.
number
Pixel width of the original.
number
Pixel height of the original. width > height is a landscape photo.
string
A direct image URL at the requested size. Fetchable without a key.
string
A small thumbnail, for picking before downloading.
string | null
A one-line description of the photo, when the library has one.
string | null
Who took it. The licence asks that this credit be shown wherever the photo is used.
string | null
The page to link the credit to. This is the one field that may point at the library’s own domain.
string | null
The photo’s average colour as a hex value.

Keeping a photo

A result is a URL, not a file. To hold the bytes as a fil_ — so a session can attach it, or a page can serve it from your own storage — import url through Files; the imported file records where it came from as a URL import.

In a session

Agents reach the same search as the find_stock_photo tool, which takes query, count and orientation. It is on by default with permission allow.

Errors