Skip to main content

Generate

POST /api/v1/generate
Not all models support every option beyond the basic request. Check the Model Library for model-specific compatibility. Open Model Library.

Base URL

https://app.eigenai.com

Authentication

Send your API key in the Authorization header as a Bearer token.
Authorization: Bearer YOUR_API_KEY

Parameters

Common

NameTypeRequiredDescription
modelstringRequiredThe model ID to use. Find supported models in the Model Library.

Conditional

These options are not supported by every model. Use the Model Library to confirm compatibility.

Image Generation (Text Prompt)

Generate an image from a text prompt (availability varies by model).
NameTypeRequiredDescription
promptstringOptionalText prompt describing what to generate.
negative_promptstringOptionalWhat to avoid in the output (if supported).
sizestringOptionalRequested output size (if supported).
seednumberOptionalRandom seed for reproducibility (if supported).

Image Editing (Upload or URL)

Transform an input image using an instruction prompt.
NameTypeRequiredDescription
image_filefileOptionalUpload the source image file (if supported).
imagefileOptionalSome request types use image instead of image_file for uploaded images.
image_pathstringOptionalReference to the source image (often an HTTPS URL or an internal path), if supported.
promptstringOptionalInstruction describing the desired transformation.
num_inference_stepsnumberOptionalNumber of inference/denoising steps (if supported).
binary_responsebooleanOptionalWhether to return binary image data directly instead of JSON (if supported).
output_formatstringOptionalOutput image format (if supported).
downsizing_mpnumberOptionalDownsample large images for faster processing (if supported).
lora_strengthnumberOptionalLoRA strength knob (if supported).
ranknumberOptionalEdit complexity/strength knob (if supported).
offloadingbooleanOptionalEnable CPU offloading (if supported).
weightstringOptionalSelect an editing profile (if supported).
true_cfg_scalenumberOptionalGuidance/CFG scale (if supported).
sample_stepsnumberOptionalSampling steps (if supported).
sample_guide_scalenumberOptionalSampling guidance scale (if supported).

Audio Transcription (ASR)

Transcribe audio into text.
NameTypeRequiredDescription
filefileOptionalAudio file to transcribe (if supported).
languagestringOptionalSpoken language code (if supported).
response_formatstringOptionalDesired output format (if supported).

Text-to-Speech (TTS)

Generate audio from text.
NameTypeRequiredDescription
textstringOptionalText to convert into speech (if supported).
voicestringOptionalVoice preset name (if supported).
voice_idstringOptionalSaved voice ID for voice cloning (if supported).
voice_namestringOptionalSaved voice name (if supported).
voice_urlstringOptionalURL to a voice reference audio sample (if supported).
voice_settingsobjectOptionalVoice settings object (if supported).
samplingobject|stringOptionalSampling controls object (if supported). Some clients send it as a JSON string.
streambooleanOptionalEnable streaming mode (if supported).
language_idstringOptionalLanguage identifier (if supported).
exaggerationnumberOptionalExpressiveness/intensity knob (if supported).
temperaturenumberOptionalControls randomness (if supported).
diffusion_stepsnumberOptionalDiffusion steps for audio generation (if supported).

Video Generation

Generate videos or image-to-video outputs (availability varies by model).
NameTypeRequiredDescription
frame_numnumberOptionalNumber of frames to generate (if supported).

Storage & Delivery

Control where outputs are stored and how they are returned.
NameTypeRequiredDescription
s3_output_pathstringOptionalOptional output path/bucket override (if supported).

Request body types

JSON request

Content-Type: application/json Use this when you are not uploading files directly.

Multipart request (file upload)

Content-Type: multipart/form-data Use this when you need to upload an image file as part of the request.

Examples

Image generation (JSON)

Generate an image from a text prompt using a JSON request body.
# Select a model in the Model Library: https://app.eigenai.com/model-library

curl -X POST https://app.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://app.eigenai.com/model-library

curl -X POST https://app.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

Audio transcription (multipart upload)

Upload an audio file and receive a transcription.
# Select a model in the Model Library: https://app.eigenai.com/model-library

curl -X POST https://app.eigenai.com/api/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=YOUR_MODEL" \
  -F "file=@/path/to/audio.mp3" \
  -F "language=en" \
  -F "response_format=json"

Text-to-speech (multipart form)

Send text and receive an audio response.
# Select a model in the Model Library: https://app.eigenai.com/model-library

curl -X POST https://app.eigenai.com/api/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "model=YOUR_MODEL" \
  -F "text=Hello, this is a test of the text-to-speech system." \
  -F "voice=Linda" \
  --output speech.wav