Create an image
Makes one AI picture from a prompt, or changes an existing picture. The request is charged when it is accepted. It answers at once with an id; get the finished picture with GET /v1/images/{id}.
Body
- promptstringrequired
- What the picture shows.
- modelstring= gpt-image-2.5
- An image model id from GET /v1/models.
- aspectRatiostring= 9:16
- 9:16 vertical, 16:9 wide or 1:1 square.
9:1616:91:1 - imageUrlhttps URL
- A picture to change instead of starting from nothing. The model must edit pictures (editsPictures in GET /v1/models).
Headers
- Idempotency-Keystring
- Optional. Any unique string, so a retry cannot charge twice. See Safe retries.
Response
- idstring
- Use it with the GET endpoint. Pictures and clips only.
- kindstring
- image, video or music.
- statusstring
- processing, completed or failed.
- urlstring
- The finished file, once status is completed.
- creditsnumber
- What this request was charged.
- errorstring
- Why it failed, when status is failed.
curl -X POST https://framesurfer.com/api/v1/images \
-H "Authorization: Bearer $FRAMESURFER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A lighthouse on a cliff at sunset, warm light",
"aspectRatio": "16:9"
}'Response202 Accepted
{
"id": "project-image-7c1e0a9b4d2f",
"kind": "image",
"status": "processing",
"credits": 1,
"model": "gpt-image-2.5"
}