Appearance
Gemini 2.5 Flash Image
gemini-2.5-flash-image is the fast Gemini image model for prompt-based image generation and editing. Use the canonical Gemini model id in new integrations.
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
Credits
| Model id | Credits / image |
|---|---|
gemini-2.5-flash-image | 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-2.5-flash-image. |
prompt | string | Yes | Describe the desired image or edit. |
image | string or string[] | Required for edits | Input image URL, or an array of image URLs when multiple references are supported. |
n | number | No | Number of images to return. Only 1 is currently supported. |
size | string | No | Output aspect ratio: 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2, 4:5, or 5:4. |
Example
bash
curl https://api.pixapi.ai/v1/images/generations \
-H "Authorization: Bearer $PIXAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-2.5-flash-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-2.5-flash-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-2.5-flash-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-2.5-flash-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.
