메인 콘텐츠로 건너뛰기
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",
  "quality": "high",
  "enable_web_search": false,
  "width": 1024
}
'
{
  "id": "generate-image-1234567890",
  "images": [
    "<string>"
  ],
  "timing": {
    "inferenceDuration": 123,
    "inferencePreprocessingTime": 123,
    "inferenceQueueTime": 123,
    "total": 123
  },
  "request": "<unknown>"
}

크기 옵션

이미지 모델은 모델별 크기 매개변수를 사용합니다:
  • 픽셀 기반 모델은 widthheight를 허용합니다(예: venice-sd35, qwen-image).
  • 종횡비 모델은 aspect_ratio를 허용합니다(예: qwen-image-2).
  • 해상도 등급 모델은 aspect_ratioresolution 둘 다 허용합니다.
예를 들어, gpt-image-2, nano-banana-2, nano-banana-proresolution 값으로 1K, 2K, 4K를 지원합니다:
{
  "model": "gpt-image-2",
  "prompt": "a cinematic wide shot of Venice at sunset",
  "aspect_ratio": "16:9",
  "resolution": "4K",
  "format": "png"
}
동일한 해상도 등급 크기 패턴은 Nano Banana 모델에도 적용됩니다:
{
  "model": "nano-banana-pro",
  "prompt": "a serene canal in venice at sunset",
  "aspect_ratio": "16:9",
  "resolution": "2K"
}
종횡비를 허용하지만 해상도 등급을 노출하지 않는 모델의 경우, resolution 없이 aspect_ratio를 전송하세요:
{
  "model": "qwen-image-2",
  "prompt": "a serene canal in venice at sunset",
  "aspect_ratio": "16:9"
}
직접 픽셀 크기를 사용하는 모델의 경우, widthheight를 대신 전송하세요:
{
  "model": "venice-sd35",
  "prompt": "a serene canal in venice at sunset",
  "width": 1024,
  "height": 1024
}
모델 간에 크기 필드를 혼합하기 전에 각 모델의 지원되는 크기 옵션은 이미지 모델 또는 모델 엔드포인트를 확인하세요.

품질 등급

일부 모델은 시각적 충실도와 비용 간의 균형을 맞추는 선택적 quality 매개변수(low, medium, high)를 허용합니다. 현재 gpt-image-2에서 지원되며, 다른 모델은 이 매개변수를 무시합니다.
{
  "model": "gpt-image-2",
  "prompt": "a cinematic wide shot of Venice at sunset",
  "aspect_ratio": "16:9",
  "resolution": "2K",
  "quality": "medium"
}
quality를 생략하면 모델은 기본 등급(gpt-image-2의 경우 high)을 사용합니다. 가격은 resolutionquality의 조합에 따라 다릅니다 — gpt-image-2의 등급별 가격(1K/2K/4K × low/medium/high)은 모델 엔드포인트model_spec.pricing.quality 아래에 노출되어 있으며 가격 개요에 나열되어 있습니다.
품질 인식 가격은 모든 API 및 SDK 호출자의 기본값입니다 — opt-in 헤더가 필요하지 않습니다. quality를 생략한 요청은 모델의 기본 등급(gpt-image-2의 경우 high)으로 청구됩니다.

Postman 컬렉션

추가 예제는 이 Postman 컬렉션을 참조하세요.

인증

Authorization
string
header
필수

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

헤더

Accept-Encoding
string

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

예시:

"gzip, br"

본문

application/json
model
string
필수

The model to use for image generation.

예시:

"grok-imagine-image"

prompt
string
필수

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
예시:

"A beautiful sunset over a mountain range"

cfg_scale
number

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

필수 범위: 0 < x <= 20
예시:

7.5

embed_exif_metadata
boolean
기본값:false

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

예시:

false

format
enum<string>
기본값:webp

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

사용 가능한 옵션:
jpeg,
png,
webp
예시:

"webp"

height
integer
기본값:1024

Height of the generated image.

필수 범위: 0 < x <= 1280
예시:

1024

hide_watermark
boolean
기본값:false

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

예시:

false

inpaint
any | null
지원 중단

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.

필수 범위: 0 <= x <= 100
예시:

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
예시:

"Clouds, Rain, Snow"

return_binary
boolean
기본값:false

Whether to return binary image data instead of base64.

예시:

false

variants
integer

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

필수 범위: 1 <= x <= 4
예시:

3

safe_mode
boolean
기본값:true

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

예시:

false

seed
integer
기본값:0

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

필수 범위: -999999999 <= x <= 999999999
예시:

123456789

steps
integer
기본값:8

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

예시:

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.

예시:

"3D Model"

aspect_ratio
string

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

예시:

"1:1"

resolution
string

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

예시:

"1K"

quality
enum<string>

Output quality for supported models (e.g. GPT Image 2 / GPT Image 2 Edit). Higher values can increase the final request charge. See the model list for supported options.

사용 가능한 옵션:
low,
medium,
high
예시:

"high"

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.

예시:

false

width
integer
기본값:1024

Width of the generated image.

필수 범위: 0 < x <= 1280
예시:

1024

응답

Successfully generated image

id
string
필수

The ID of the request.

예시:

"generate-image-1234567890"

images
string[]
필수

Base64 encoded image data.

timing
object
필수
request
any | null

The original request data sent to the API.