Image generation on Venice is synchronous. Send a prompt toDocumentation Index
Fetch the complete documentation index at: https://docs.venice.ai/llms.txt
Use this file to discover all available pages before exploring further.
/image/generate and receive your image in the same response, either as base64 inside JSON or as raw binary when return_binary is true.
Endpoints
| Endpoint | Purpose | When to use |
|---|---|---|
POST /image/generate | Native Venice image generation API | Use this for full feature support |
GET /image/styles | List available style presets | Use this before sending style_preset |
POST /images/generations | OpenAI-compatible image generation API | Use this when migrating existing OpenAI image clients |
Step 1: Send a generation request
Sizing is model-specific. Some models accept explicitwidth and height; some expose aspect_ratio; and resolution-tier models expose aspect_ratio plus resolution values such as 1K, 2K, or 4K.
Pixel-based sizing example:
images array contains base64-encoded image data. Decode the first item to save or display it. timing.total is the full request duration in milliseconds.
Step 2: Decode and save the image
Step 3: Return binary instead of JSON (optional)
If you want the response body to be the image file itself, setreturn_binary: true. This is useful when you want to stream or save the image directly without base64 decoding.
return_binary is true, the response body is raw image/jpeg, image/png, or image/webp data based on the format you requested.
variants is only supported when return_binary is false.Step 4: List available image styles (optional)
If you want to usestyle_preset, first fetch the available styles from /image/styles:
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model ID to use for generation |
prompt | string | Yes | - | What to generate |
negative_prompt | string | No | - | What to avoid in the image |
width | integer | No | 1024 | Output width in pixels for pixel-based models such as venice-sd35 and qwen-image |
height | integer | No | 1024 | Output height in pixels for pixel-based models such as venice-sd35 and qwen-image |
format | string | No | webp | Output format: jpeg, png, or webp |
variants | integer | No | 1 | Number of images to generate (1-4), only when return_binary is false |
return_binary | boolean | No | false | Return raw image bytes instead of base64 JSON |
safe_mode | boolean | No | true | Blur adult content when enabled |
seed | integer | No | random | Reuse the same seed for more consistent iterations |
cfg_scale | number | No | model-dependent | Higher values push the model to follow the prompt more closely |
style_preset | string | No | - | Apply a preset style from Image Styles |
aspect_ratio | string | Conditional | - | Used by models that support ratio-based sizing, such as qwen-image-2, gpt-image-2, nano-banana-2, and nano-banana-pro |
resolution | string | Conditional | - | Used by models that support resolution tiers such as 1K, 2K, or 4K |
enable_web_search | boolean | Conditional | false | Allows supported models to use current web information; adds extra cost |
Model-specific options
High-resolution generation
Some image models supportaspect_ratio without a selectable resolution tier. For example, qwen-image-2 accepts aspect ratio and maps it to model-specific output dimensions:
aspect_ratio plus a resolution tier. For example, gpt-image-2, nano-banana-2, and nano-banana-pro support 1K, 2K, and 4K:
Style presets
If the selected model supports it,style_preset lets you steer the output without rewriting your whole prompt. You can fetch valid preset names from Image Styles:
OpenAI-compatible endpoint
If you’re already using OpenAI image SDKs or existing DALL-E integrations, Venice also supportsPOST /images/generations. It offers a simpler request format, but fewer features than the native Venice endpoint.
Request:
/image/generate when you need Venice-specific options such as cfg_scale, style_preset, variants, or binary responses.
Prompting tips
- Start with the subject, then add medium, lighting, composition, and mood.
- Put must-avoid details in
negative_promptinstead of overloading the main prompt. - Reuse
seedwhen iterating so you can compare prompt changes without fully changing the composition. - Keep sizing model-aware. Some models use
width/height, some useaspect_ratio, and resolution-tier models useaspect_ratioplusresolution. - Use
variantsduring exploration, then switch back to a single output once you’ve locked in the direction.
Errors
| Status | Meaning | Action |
|---|---|---|
400 | Invalid request parameters | Check field names, types, and model-specific constraints |
401 | Authentication failed or model requires a higher access tier | Check your API key and model access |
402 | Insufficient balance | Add credits at venice.ai/settings/api |
415 | Invalid content type | Send JSON with Content-Type: application/json |
429 | Rate limit exceeded or model overloaded | Retry with backoff; check Retry-After header |
500 | Inference processing failed | Retry the request |
503 | Model at capacity | Retry after a short delay |
When Safe Venice is enabled, inspect response headers such as
x-venice-is-blurred and x-venice-is-content-violation if you need to detect moderation outcomes programmatically.