Documentation Index
Fetch the complete documentation index at: https://docs.eigenai.com/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/v1/generate
Content-Type: application/json for text-to-image · multipart/form-data for image editing
Parameter support can differ depending on the model used to generate the response. Check the Model Library for model-specific compatibility. Open Model Library.
Authentication
Send your API key in the Authorization header as a Bearer token.
Authorization: Bearer YOUR_API_KEY
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). |
Examples
Image generation (JSON)
Generate an image from a text prompt using a JSON request body.
# Select a model in the Model Library: https://api-web.eigenai.com/model-library
curl -X POST https://api-web.eigenai.com/api/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_MODEL",
"prompt": "A fluffy orange tabby cat in a sunlit garden"
}'
Image editing (multipart upload)
Upload an image file and apply an edit instruction prompt.
# Select a model in the Model Library: https://api-web.eigenai.com/model-library
curl -X POST https://api-web.eigenai.com/api/v1/generate \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "model=YOUR_MODEL" \
-F "prompt=Replace the bag with a laptop" \
-F "image_file=@/path/to/source.png" \
-F "num_inference_steps=15" \
-F "binary_response=true" \
--output edited.png