---
title: "Generate media"
method: POST
path: "/media/generate"
tags: ["Media"]
---

# Generate media

`POST /media/generate`

## Request

- Base URL: `https://api.pickfu.com/v1`
- URL: `https://api.pickfu.com/v1/media/generate`
- Auth: HTTP bearer

Generates an image from a text prompt using AI. The generated image is uploaded to the PickFu CDN and a permanent URL is returned.

## Request body

- object
  - `prompt` string, required: Text prompt describing the image to generate
  - `type` 'image': Media type to generate (default: image)
  - `aspectRatio` '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9': Aspect ratio of the generated image (default: 1:1)
  - `imageUrls` string[]: Up to 3 reference image URLs (https://… or data: URIs) the model can see while generating. Useful for preserving product appearance across variants.

## Response `200`

Default Response

- object
  - `success` boolean
  - `data` object
    - `url` string: CDN URL of the generated image
    - `model` string: Model used for generation (echoed for traceability)
    - `aspectRatio` string: Aspect ratio of the generated image
    - `prompt` string: The prompt used for generation

## Other responses

- `402`: The team's platform credit balance cannot cover this action (only when platform credits are enforced)

---

[API](https://skmtc.dev/pickfu/apis/pickfu-api.md) · [All operations](https://skmtc.dev/pickfu/apis/pickfu-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pickfu/apis/pickfu-api/revisions/919fc58413ea?raw)
