Image

/api/v1/image/generations

Generate an image based on input parameters using an OpenAI compatible endpoint. This endpoint does not support the full feature set of the Venice Image Generation endpoint, but is compatible with the existing OpenAI endpoint.

Authentication: This endpoint accepts either a Bearer API key or a SIGN-IN-WITH-X header for x402 wallet-based authentication. The legacy X-Sign-In-With-X header is also accepted during migration. When using x402, a 402 Payment Required response indicates insufficient balance and includes top-up instructions.

post/api/v1/images/generations

Request

  • Base URL: https://api.venice.ai
  • URL: https://api.venice.ai/api/v1/images/generations
  • Auth: one of:
    • HTTP bearer
    • API key in header SIGN-IN-WITH-X

Headers

Accept-Encodingstring
Example:gzip, br

Supported compression encodings (gzip, br).

Request body

background'transparent' | 'opaque' | 'auto' nullable

This parameter is not used in Venice image generation but is supported for compatibility with OpenAI API

modelstring

The model to use for image generation. Defaults to Venice's default image model. If a non-existent model is specified (ie an OpenAI model name), it will default to Venice's default image model.

moderation'low' | 'auto' nullable

Controls blurring of images classified as adult content. auto (the default, also used when null) blurs them; low returns unblurred output. This is the OpenAI-compatible equivalent of safe_mode on /image/generate. No Pro subscription is required, and the mature filter setting in the Venice app does not affect this. The x-venice-is-blurred response header reports whether the returned image was blurred.

ninteger nullable

Number of images to generate. Venice presently only supports 1 image per request.

output_compressioninteger nullable

This parameter is not used in Venice image generation but is supported for compatibility with OpenAI API

output_format'jpeg' | 'png' | 'webp'

Output format for generated images

promptstring required

A text description of the desired image.

quality'auto' | 'high' | 'medium' | 'low' | 'hd' | 'standard' nullable

This parameter is not used in Venice image generation but is supported for compatibility with OpenAI API

response_format'b64_json' | 'url' nullable

Response format. URL will be a data URL.

size'auto' | '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | '1792x1024' | '1024x1792' nullable

Size of generated images. Default is 1024x1024

style'vivid' | 'natural' nullable

This parameter is not used in Venice image generation but is supported for compatibility with OpenAI API

userstring

This parameter is discarded and is supported for compatibility with OpenAI API. It is not an alias of anon_user_id.

anon_user_idstring

Optional identifier for the API customer's end user. Combined with the Venice user id when attributing the request to upstream providers. Distinct from the discarded OpenAI user field. Must be printable ASCII and must not contain ||.

Example request

{
  "background": "auto",
  "model": "grok-imagine-image",
  "moderation": "auto",
  "n": 1,
  "output_format": "png",
  "prompt": "A beautiful sunset over mountain ranges",
  "quality": "auto",
  "response_format": "b64_json",
  "size": "1024x1024",
  "style": "natural",
  "user": "user123",
  "anon_user_id": "end-user-123"
}

Response

Successfully generated image

createdinteger required

Unix timestamp for when the request was created

Example response

{
  "created": 1713833628,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.