POST /api/v1/generate
Content-Type: application/json for text-to-image · multipart/form-data for image editing
Authentication
Send your API key in theAuthorization header as a Bearer token.
Parameters
Common
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | The model ID to used to generate the response, like flux-1-kontext. Find supported models in the Model Library. |
prompt | string | Required | Text prompt describing what to generate. |
Conditional
The following parameters are not supported by every model. Check the Model Library for model-specific compatibility.Image Generation (Text Prompt)
Generate an image from a text prompt.| Name | Type | Required | Description |
|---|---|---|---|
seed | integer | Optional | Random seed for reproducible results. If not provided, a random seed will be used. |
mode | string | Optional | Generation mode: “text-to-image” (default) for generating images from text prompts, or “image-editing” for editing source images. |
real_time | boolean | Optional | Enable real-time web search mode for current references. Text to Image mode only. Defaults to false. |
width | integer | Optional | Output width in pixels, t2i mode only (default: 1024, range: 512–2048). |
height | integer | Optional | Output height in pixels, t2i mode only (default: 1024, range: 512–2048). |
guidance_scale | number | Optional | Classifier-free guidance scale (default: 1.0). |
Image Editing (Upload or URL)
Transform the source image using an instruction prompt.| Name | Type | Required | Description |
|---|---|---|---|
image_file | file | Optional | Upload the source image file. |
image | file | Optional | Some request types use image instead of image_file for uploading source images. |
image_path | string | Optional | Reference to the source image (often an HTTPS URL or an internal path). |
num_inference_steps | number | Optional | Number of inference/denoising steps. Defaults to 30. |
binary_response | boolean | Optional | Whether to return binary image data directly instead of JSON. |
output_format | string | Optional | Output image format (jpg or png). |
downsizing_mp | number | Optional | Downsample large images for faster processing. |
lora_strength | number | Optional | a numerical multiplier that controls the intensity of the applied Low-Rank Adaptation (LoRA) on the base model’s weights. Defaults to 0.8. |
rank | number | Optional | Edit complexity/strength knob. Defaults to 32. |
offloading | boolean | Optional | Enable CPU offloading in constrained environments. |
weight | string | Optional | Select an editing profile (lightning or vanilla). |
true_cfg_scale | number | Optional | Guidance scale controlling how strongly the prompt is applied.. |
sample_steps | number | Optional | Sampling steps. |
sample_guide_scale | number | Optional | Sampling guidance scale. |
negative_prompt | string | Optional | What to avoid in the output. |
s3_output_path | string | Optional | Destination bucket/key for the output image (e.g. s3://chatbot-images-eigenai/banana_example.png). |