Skip to content

Generate

Images

POST /v1/images/generations: one to four images from a prompt, with optional reference pictures.

POST/v1/images/generationsHolds the price of n images, starts them and answers 202 with the generation to poll.
GET/v1/images/generations/{id}The generation, moved forward if it is still running.

Body

FieldTypeNotes
modelstringRequired. An image model id from GET /v1/models.
promptstringRequired. Up to 2,400 characters.
ninteger1 to 4, default 1. Each image is charged.
aspect_ratiostring1:1 (default), 3:4, 4:3, 9:16 or 16:9.
negative_promptstringUp to 1,000 characters, on models that take one.
reference_imagesstring[]Pictures to edit or keep, each an https URL, a data:image/png|jpeg|webp|gif;base64, URI, an upload (upl_…) or one of your image outputs (file_…). Up to 10 by the API, fewer on most models (each model page says).
privatebooleanPrivate mode, on models with options.private: nothing is kept, not even the prompt. Each image comes back once, as b64_json, in the read that completes it. See Private mode.
max_cost_usdnumberThe most this request may cost, in USD: a higher price is refused with 400 max_cost_exceeded before anything is held. See Quotes.

Send an Idempotency-Key header to retry safely (Idempotency).

curl https://frameport.ai/v1/images/generations \
  -H "Authorization: Bearer $FRAMEPORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "fp-image-1",
    "prompt": "A lighthouse on a cliff at dawn, long exposure, soft fog",
    "n": 1,
    "aspect_ratio": "16:9"
  }'

Price

An image costs its model's per_image price, times n. Some models add per_extra_reference_image for each picture after the first. The hold is the full price; on success it becomes the charge, and a failed image costs nothing.

Outputs

One output per image. Each settles on its own: with n: 4, three can succeed and one fail, and only three are charged. content_type tells the file type.

200 OK, succeeded
{
  "id": "gen_4kQ8vT2nLm9Xr7Wd1sYcPa",
  "object": "generation",
  "type": "image",
  "model": "fp-image-1",
  "status": "succeeded",
  "input": {
    "prompt": "A lighthouse on a cliff at dawn, long exposure, soft fog",
    "n": 1,
    "aspect_ratio": "16:9"
  },
  "reserved_usd": 0.025,
  "cost_usd": 0.025,
  "outputs": [
    {
      "id": "file_8Hc2RkQw5ZpT1mVb7nXe3L",
      "status": "succeeded",
      "url": "https://frameport.ai/v1/files/file_8Hc2RkQw5ZpT1mVb7nXe3L?expires=1795779600&signature=Qm9yZW1fZXhhbXBsZV9zaWduYXR1cmU",
      "url_expires_at": "2026-11-27T11:10:00.000Z",
      "content_type": "image/png",
      "cost_usd": 0.025
    }
  ],
  "error": null,
  "created_at": "2026-11-27T10:00:00.000Z",
  "completed_at": "2026-11-27T10:01:12.000Z"
}
Each model page lists the reference pictures, edits and negative prompt a model takes, with a request body per mode.