Skip to main content
NexLLM’s image endpoints let you generate brand-new images from natural language descriptions and edit or modify existing images. Both endpoints are OpenAI-compatible, so any code written for the DALL·E API works directly with NexLLM by changing only the base URL.

Endpoints

Image Generation Parameters

string
required
The image generation model to use. Example: dall-e-3, dall-e-2. For Imagen models on Vertex AI, ensure your API key is assigned to a group that includes them (see the note below).
string
required
A text description of the image you want to generate. More detailed prompts generally produce better results. Maximum length varies by model.
integer
The number of images to generate. Defaults to 1. dall-e-3 supports only n=1; dall-e-2 supports up to 10.
string
The resolution of the generated image. Supported values depend on the model. Common options: 256x256, 512x512, 1024x1024, 1792x1024, 1024x1792. Defaults to 1024x1024.

Code Example

Image Editing Example

To edit an existing image, send a POST request to /v1/images/edits with the original image file and a prompt describing the change you want:
To access Imagen models (Google’s image generation models on Vertex AI), your API key must be assigned to a channel group that includes them — for example, the gemini-vertex group. Check the channel groups overview to confirm which models are available under your key.