Skip to main content
POST
Generate images
Both endpoints take a model and a prompt and return generated images or video. List the models with GET /v1/images/models and GET /v1/videos/models; both lists are free and not rate-limited and include a predev price object per row.

Images

POST /v1/images returns generated images synchronously and is charged when the response is returned.
Pick another model from GET /v1/images/models; each row lists the parameters it accepts in supported_parameters, and some models edit an input image rather than start from a prompt. To edit an image or draw from one, pass it in input_references. Each item is a URL or data: URL string, or {"type": "image_url", "image_url": {"url": "..."}}.
Use credits_per_image or the other predev prices in the model row to estimate cost; the actual charge follows the call’s metered usage, like every other call.

Video

Video generation is asynchronous:
  1. POST /v1/videos submits the job and returns it with its id and a polling_url.
  2. GET /v1/videos/{id} reports status. polling_url is this same URL, ending with the job’s id, so polling either one works.
  3. GET /v1/videos/{id}/content returns the finished video.
Submitting a job needs at least 10 credits available. The job is charged once it finishes, not at submission: on the first status poll that reports completion, on the /content download if you never polled, or by pre.dev afterwards if you stopped polling. Poll until the status is terminal (completed, failed, cancelled or expired) before reading /content. Poll and download with the job’s id from the submit response. Jobs belong to the workspace that created them; another workspace’s job id returns 404.

Authorizations

Authorization
string
header
required

The workspace API key (pdk_…) from Integrations → Built-in in the pre.dev dashboard.

Headers

x-predev-project-id
string

Attribute this call to one of the workspace's projects. An id the workspace does not own is ignored.

Body

application/json
model
string
required

An id from GET /v1/images/models.

Example:

"recraft/recraft-v4.1-flash"

prompt
string
required
Minimum string length: 1
n
integer

Upper bound on images; a model can return fewer.

Required range: 1 <= x <= 10
size
string

A tier such as 2K, or exact pixels such as 1024x1024.

aspect_ratio
string
Examples:

"1:1"

"16:9"

"9:16"

quality
enum<string>
Available options:
auto,
low,
medium,
high,
xhigh,
max
output_format
enum<string>
Available options:
png,
jpeg,
webp,
svg
background
enum<string>
Available options:
auto,
transparent,
opaque
input_references
(string | object)[]

Reference images for image-to-image models: each a URL or data: URL string, or an image_url object.

A URL or data: URL of the image.

seed
integer
stream
boolean

Stream partial images, on models whose catalog row has supports_streaming: true.

Response

Generated images as base64. With stream: true on a model that supports it, partial images arrive as server-sent events.

data
object[]
required
created
integer
usage
object