Skip to main content
POST
/
image
/
generate
/api/v1/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": "grok-imagine-image",
  "prompt": "A beautiful sunset over a mountain range",
  "cfg_scale": 7.5,
  "embed_exif_metadata": false,
  "format": "webp",
  "height": 1024,
  "hide_watermark": false,
  "inpaint": "<unknown>",
  "lora_strength": 50,
  "negative_prompt": "Clouds, Rain, Snow",
  "return_binary": false,
  "variants": 3,
  "safe_mode": false,
  "seed": 123456789,
  "steps": 8,
  "style_preset": "3D Model",
  "aspect_ratio": "1:1",
  "resolution": "1K",
  "enable_web_search": false,
  "width": 1024
}
'
{
  "id": "generate-image-1234567890",
  "images": [
    "<string>"
  ],
  "timing": {
    "inferenceDuration": 123,
    "inferencePreprocessingTime": 123,
    "inferenceQueueTime": 123,
    "total": 123
  },
  "request": "<unknown>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.venice.ai/llms.txt

Use this file to discover all available pages before exploring further.

Sizing Options

Image models use model-specific sizing parameters:
  • Pixel-based models accept width and height, for example venice-sd35 and qwen-image.
  • Aspect-ratio models accept aspect_ratio, for example qwen-image-2.
  • Resolution-tier models accept both aspect_ratio and resolution.
For example, gpt-image-2, nano-banana-2, and nano-banana-pro support resolution values of 1K, 2K, and 4K:
{
  "model": "gpt-image-2",
  "prompt": "a cinematic wide shot of Venice at sunset",
  "aspect_ratio": "16:9",
  "resolution": "4K",
  "format": "png"
}
The same resolution-tier sizing pattern also applies to Nano Banana models:
{
  "model": "nano-banana-pro",
  "prompt": "a serene canal in venice at sunset",
  "aspect_ratio": "16:9",
  "resolution": "2K"
}
For models that accept aspect ratio but do not expose resolution tiers, send aspect_ratio without resolution:
{
  "model": "qwen-image-2",
  "prompt": "a serene canal in venice at sunset",
  "aspect_ratio": "16:9"
}
For models that use direct pixel dimensions, send width and height instead:
{
  "model": "venice-sd35",
  "prompt": "a serene canal in venice at sunset",
  "width": 1024,
  "height": 1024
}
Check Image Models or the Models endpoint for each model’s supported sizing options before mixing sizing fields across models.

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:

"grok-imagine-image"

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 - 7500
Example:

"A beautiful sunset over a mountain range"

cfg_scale
number

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

Required range: 0 < x <= 20
Example:

7.5

embed_exif_metadata
boolean
default:false

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

Example:

false

format
enum<string>
default:webp

The image format to return. WebP are smaller and optimized for web use. PNG are higher quality but larger in file size.

Available options:
jpeg,
png,
webp
Example:

"webp"

height
integer
default:1024

Height of the generated image.

Required range: 0 < x <= 1280
Example:

1024

hide_watermark
boolean
default:false

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

Example:

false

inpaint
any | null
deprecated

This feature is deprecated and was disabled on May 19th, 2025. A revised in-painting API will be launched in the near future.

lora_strength
integer

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

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

50

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 string length: 7500
Example:

"Clouds, Rain, Snow"

return_binary
boolean
default:false

Whether to return binary image data instead of base64.

Example:

false

variants
integer

Number of images to generate (1–4). Only supported when return_binary is false.

Required range: 1 <= x <= 4
Example:

3

safe_mode
boolean
default:true

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

Example:

false

seed
integer
default:0

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

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

123456789

steps
integer
default:8

Number of inference steps. This model does not support steps - this field is ignored.

Example:

8

style_preset
string

An image style to apply to the image. Visit https://docs.venice.ai/api-reference/endpoint/image/styles for more details.

Example:

"3D Model"

aspect_ratio
string

Aspect ratio (utilized by certain image models including Nano Banana). Examples: "1:1", "16:9".

Example:

"1:1"

resolution
string

Resolution (utilized by certain image models including Nano Banana). Examples: "1K", "2K", "4K".

Example:

"1K"

Enable web search for the image generation task. This will allow the model to use the latest information from the web to generate the image. Only supported by certain models. If web search is used, additional credits are getting charged.

Example:

false

width
integer
default:1024

Width of the generated image.

Required range: 0 < x <= 1280
Example:

1024

Response

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.