POST
/
image
/
generate
curl --request POST \
  --url https://api.venice.ai/api/v1/image/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "fluently-xl",
  "prompt": "A beautiful sunset over a mountain range",
  "negative_prompt": "Clouds, Rain, Snow",
  "style_preset": "3D Model",
  "height": 1024,
  "width": 1024,
  "steps": 20,
  "cfg_scale": 7.5,
  "seed": 123456789,
  "lora_strength": 50,
  "safe_mode": false,
  "return_binary": false,
  "hide_watermark": false,
  "format": "webp",
  "embed_exif_metadata": false,
  "inpaint": {
    "strength": 50,
    "source_image_base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "mask": {
      "image_prompt": "Generate a high-resolution image of a cute lop-eared rabbit with a fluffy coat. The rabbit should have a light brown and white fur pattern, with the white fur prominently covering its chest and underside. Its ears should be long and droop down on either side of its head, with the inner part of the ears showing a delicate pink hue. The rabbit'\''s face, wearing round silver spectacles, should have expressive dark eyes and a small, pink nose. It should be sitting upright on a soft, light blue cushion, with a cozy, indoor setting in the background that includes a neutral-toned wall and wooden elements. The overall mood should be warm and endearing, capturing the gentle and charming nature of the rabbit.",
      "object_target": "rabbit'\''s face",
      "inferred_object": "rabbit'\''s face wearing round silver spectacles"
    }
  }
}'
{
  "id": "generate-image-1234567890",
  "request": "<any>",
  "images": [
    "<string>"
  ],
  "timing": {
    "inferenceDuration": 123,
    "inferencePreprocessingTime": 123,
    "inferenceQueueTime": 123,
    "total": 123
  }
}

Postman Collection

For additional examples, please see this Postman Collection.


Authorizations

Authorization
string
header
required

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

Headers

Accept-Encoding
string

Supported compression encodings (gzip, br). Only applied when return_binary is false.

Example:

"gzip, br"

Body

application/json
model
string
required

The model to use for image generation.

Example:

"fluently-xl"

prompt
string
required

The description for the image. Character limit is model specific and is listed in the promptCharacterLimit setting in the model list endpoint.

Required string length: 1 - 1500
Example:

"A beautiful sunset over a mountain range"

negative_prompt
string

A description of what should not be in the image. Character limit is model specific and is listed in the promptCharacterLimit constraint in the model list endpoint.

Maximum length: 1500
Example:

"Clouds, Rain, Snow"

style_preset
string

An image style to apply to the image. Visit https://docs.venice.ai/apiv1imagegenerate for more details.

Example:

"3D Model"

height
integer
default:1024

Height of the generated image. Each model has a specific height and width divisor listed in the widthHeightDivisor constraint in the model list endpoint.

Required range: 0 < x <= 1280
Example:

1024

width
integer
default:1024

Width of the generated image. Each model has a specific height and width divisor listed in the widthHeightDivisor constraint in the model list endpoint.

Required range: 0 < x <= 1280
Example:

1024

steps
integer
default:20

Number of inference steps. The following models have reduced max steps from the global max: flux-dev: 30 max steps, flux-dev-uncensored: 30 max steps, stable-diffusion-3.5: 30 max steps. These constraints are exposed in the model list endpoint for each model.

Required range: 0 < x <= 50
Example:

20

cfg_scale
number

CFG scale parameter. Higher values lead to more adherence to the prompt.

Required range: 0 < x <= 20
Example:

7.5

seed
integer

Random seed for generation. If not provided, a random seed will be used.

Required range: -999999999 <= x <= 999999999
Example:

123456789

lora_strength
integer

Lora strength for the model. Only applies if the model uses additional Loras.

Required range: 0 <= x <= 100
Example:

50

safe_mode
boolean

Whether to use safe mode. If enabled, this will blur images that are classified as having adult content.

Example:

false

return_binary
boolean
default:false

Whether to return binary image data instead of base64.

Example:

false

hide_watermark
boolean
default:false

Whether to hide the Venice watermark. Venice may ignore this parameter for certain generated content.

Example:

false

format
enum<string>
default:png

The image format to return. WebP are smaller and optimized for web use. PNG are higher quality but larger in file size. NOTE: This currently defaults to PNG but will change in the future to WebP. If you wish to receive PNGs, ensure your API call specifies the format.

Available options:
webp,
png
Example:

"webp"

embed_exif_metadata
boolean
default:false

Embed prompt generation information into the image's EXIF metadata.

Example:

false

inpaint
object

Response

200
application/json
Successfully generated image
id
string
required

The ID of the request.

Example:

"generate-image-1234567890"

images
string[]
required

Base64 encoded image data.

timing
object
required
request
any | null

The original request data sent to the API.