Endpoints
| Endpoint | Path | Description |
|---|---|---|
| Image Generation | POST /v1/images/generations | Generate new images from a text prompt |
| Image Editing | POST /v1/images/edits | Edit or modify an existing image |
Image Generation Parameters
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).A text description of the image you want to generate. More detailed prompts generally produce better results. Maximum length varies by model.
The number of images to generate. Defaults to
1. dall-e-3 supports only n=1; dall-e-2 supports up to 10.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 aPOST 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.