Gemini 3.1 Flash Image Preview - Image Generator
Fast and efficient AI image generation model by Google AI. Gemini 3.1 Flash Image Preview delivers high-quality image generation optimized for speed, supporting flexible aspect ratios and multiple image sizes for a wide range of creative and commercial applications.
Endpoint
Request Headers
| Field | Value |
|---|---|
| API-KEY | <api-key> |
| Content-Type | application/json |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Feature type identifier. Must be IMAGE_GENERATOR |
model | string | Yes | AI model identifier. Must be gemini-3.1-flash-image-preview |
promptObject | object | Yes | Configuration object containing all generation parameters |
Prompt Object Parameters
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
prompt | string | Yes | Text description of the image to generate | - |
imageSize | string | Yes | Image size quality. Must be one of: "512", "1K", "2K", or "4K" | 1K |
aspectRatio | string | No | Aspect ratio for the generated image. Must be one of: "1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "21:9" | - |
temperature | number | No | Controls randomness in generation (0.0-2.0). Higher values produce more creative results | 1.0 |
topP | number | No | Nucleus sampling parameter (0.0-1.0). Controls diversity of output | 0.95 |
Code Examples
- cURL
- JavaScript
- Python
curl --location 'https://api.1min.ai/api/features' \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"type": "IMAGE_GENERATOR",
"model": "gemini-3.1-flash-image-preview",
"promptObject": {
"prompt": "A futuristic cityscape at sunset with flying vehicles and neon lights reflecting on glass buildings",
"imageSize": "2K",
"aspectRatio": "16:9",
"temperature": 1.0,
"topP": 0.95
}
}'
fetch('https://api.1min.ai/api/features', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
type: 'IMAGE_GENERATOR',
model: 'gemini-3.1-flash-image-preview',
promptObject: {
prompt: 'A futuristic cityscape at sunset with flying vehicles and neon lights reflecting on glass buildings',
imageSize: '2K',
aspectRatio: '16:9',
temperature: 1.0,
topP: 0.95
}
})
})
import requests
url = "https://api.1min.ai/api/features"
headers = {
"Content-Type": "application/json",
"API-KEY": "YOUR_API_KEY"
}
data = {
"type": "IMAGE_GENERATOR",
"model": "gemini-3.1-flash-image-preview",
"promptObject": {
"prompt": "A futuristic cityscape at sunset with flying vehicles and neon lights reflecting on glass buildings",
"imageSize": "2K",
"aspectRatio": "16:9",
"temperature": 1.0,
"topP": 0.95
}
}
response = requests.post(url, headers=headers, json=data)
Interactive Playground
API Playground
https://api.1min.ai/api/featuresDescribe the image you want to generate
Image size quality. Must be one of: 512, 1K, 2K, or 4K
Aspect ratio for the generated image
Controls randomness (0.0-2.0). Higher = more creative
Nucleus sampling parameter (0.0-1.0). Controls diversity
Generated cURL Command:
curl -X POST "https://api.1min.ai/api/features" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "IMAGE_GENERATOR",
"model": "gemini-3.1-flash-image-preview",
"promptObject": {
"prompt": "A futuristic cityscape at sunset with flying vehicles and neon lights reflecting on glass buildings",
"imageSize": "2K",
"aspectRatio": "16:9",
"temperature": 1,
"topP": 0.95
}
}'
Response Format
{
"aiRecord": {
"uuid": "e4f5g6h7-i8j9-0123-4567-890123defghi",
"userId": "user-12345",
"teamId": "team-67890",
"model": "gemini-3.1-flash-image-preview",
"type": "IMAGE_GENERATOR",
"status": "SUCCESS",
"createdAt": "2025-01-15T10:50:00.000Z",
"aiRecordDetail": {
"promptObject": {
"prompt": "A futuristic cityscape at sunset with flying vehicles and neon lights reflecting on glass buildings",
"imageSize": "2K",
"aspectRatio": "16:9",
"temperature": 1.0,
"topP": 0.95
},
"resultObject": [
"development/images/2025_01_15_10_50_45_001_futuristic_cityscape.png"
]
},
"temporaryUrl": "https://s3.us-east-1.amazonaws.com/asset.1min.ai/development/images/2025_01_15_10_50_45_001_futuristic_cityscape.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&..."
}
}
Use Cases
- Creative Content: High-quality imagery for social media and digital marketing
- Professional Design: Business visuals, presentations, and brand assets
- Product Visualization: Product imagery and concept visualization
- Marketing Materials: Visuals for campaigns with flexible aspect ratios for different platforms
- Digital Art: Illustrations and artistic creations at multiple resolutions
- Content Optimization: Fast, cost-effective image generation for high-volume use cases