Skip to main content
POST
/
v1
/
images
/
generations
Image Editing / Generation
curl --request POST \
  --url https://www.anyfast.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "flux-1-kontext-pro",
  "prompt": "Change the background to a sunset beach",
  "input_image": "<string>",
  "n": 1,
  "size": "1024x1024",
  "output_format": "jpeg",
  "seed": 123
}
'
{
  "created": 1774002799,
  "data": [
    {
      "b64_json": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Model ID

Available options:
flux-1-kontext-pro
Example:

"flux-1-kontext-pro"

prompt
string
required

Text description of the desired image, or editing instructions (e.g. 'change the red car to blue').

Example:

"Change the background to a sunset beach"

input_image
string

Base64-encoded or URL of the reference image to edit. Required for image editing.

n
integer
default:1

Number of images to generate.

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

Output image size, e.g. 1024x1024.

Example:

"1024x1024"

output_format
enum<string>

Output image format.

Available options:
jpeg,
png
Example:

"jpeg"

seed
integer

Random seed for reproducible generation.

Response

Image generated successfully

created
integer
Example:

1774002799

data
object[]