Images
Generate images using Gemini’s native image generation capabilities.Endpoint
Examples
- Python
- JavaScript
- cURL
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
contents | array | Yes | Array of content objects |
generationConfig | object | No | Generation configuration |
Content Object
| Field | Type | Description |
|---|---|---|
parts | array | Array of part objects with text prompt |
Part Object
| Field | Type | Description |
|---|---|---|
text | string | Image generation prompt |
Response
The response includes base64-encoded image data:Response Fields
| Field | Type | Description |
|---|---|---|
candidates | array | Array of generated candidates |
candidates[].content.parts[].inlineData.mimeType | string | Image MIME type (e.g., image/png) |
candidates[].content.parts[].inlineData.data | string | Base64-encoded image data |
candidates[].finishReason | string | Why generation stopped |
More Examples
Artistic Image
- Python
- JavaScript
- cURL
Product Visualization
- Python
- JavaScript
- cURL
Available Models
| Model | Description |
|---|---|
gemini-3-pro-image-preview | Multimodal with native image generation |
Headers
| Header | Required | Description |
|---|---|---|
x-goog-api-key | Yes | Your ScaleLLM API key (sk_your_key) |
Content-Type | Yes | application/json |
For text generation and vision tasks, see the Chat endpoint.