Appearance
Gemini 3.1 Flash Lite Image
gemini-3.1-flash-lite-image is Google's Gemini 3.1 Flash Lite Image model. It is optimized for velocity, scale, and low cost when speed and price are the primary constraints.
Google notes that this Lite model is not optimized for multiple reference inputs or multi-turn sequential editing. Use it for fast 1K generation and simple edit workflows; use gemini-3.1-flash-image-preview when reference consistency or broader output tiers matter more.
API surface
| Operation | Endpoint | Mode |
|---|---|---|
| Image generation | POST /v1/images/generations | Sync |
| Image generation task | POST /v1/async/images/generations | Async |
| Image editing | POST /v1/images/edits | Sync |
| Image editing task | POST /v1/async/images/edits | Async |
Pricing
| Model id | Output tier | Credits / image |
|---|---|---|
gemini-3.1-flash-lite-image | 1K | 2 |
Request fields
This model uses the same OpenAI-compatible image fields as the rest of Pixapi.
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Use gemini-3.1-flash-lite-image. |
prompt | string | Yes | Describe the desired image or edit. |
image | string or string[] | Required for edits | Input image URL. Prefer a single reference image for this Lite model. |
n | number | No | Number of images to return. Only 1 is currently supported. |
size | string | No | Output aspect ratio: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, or 21:9. |
Example
bash
curl https://api.pixapi.ai/v1/images/generations \
-H "Authorization: Bearer $PIXAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-lite-image",
"prompt": "A polished product photo of a ceramic coffee cup",
"n": 1,
"size": "1:1"
}'py
import os
import requests
response = requests.post(
"https://api.pixapi.ai/v1/images/generations",
headers={
"Authorization": f"Bearer {os.environ['PIXAPI_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "gemini-3.1-flash-lite-image",
"prompt": "A polished product photo of a ceramic coffee cup",
"n": 1,
"size": "1:1"
},
)
response.raise_for_status()
print(response.json())js
const response = await fetch('https://api.pixapi.ai/v1/images/generations', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PIXAPI_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "gemini-3.1-flash-lite-image",
"prompt": "A polished product photo of a ceramic coffee cup",
"n": 1,
"size": "1:1"
}),
});
if (!response.ok) {
throw new Error(await response.text());
}
console.log(await response.json());go
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"model": "gemini-3.1-flash-lite-image",
"prompt": "A polished product photo of a ceramic coffee cup",
"n": 1,
"size": "1:1"
}`)
req, err := http.NewRequest(
"POST",
"https://api.pixapi.ai/v1/images/generations",
bytes.NewBuffer(body),
)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("PIXAPI_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
result, _ := io.ReadAll(resp.Body)
fmt.Println(string(result))
}For the shared response shape and edit upload example, see the API Reference.
