Skip to content

Gemini 3 Pro Image Preview

gemini-3-pro-image-preview is the premium Gemini image model for high-quality generation and editing. Use the canonical Gemini model id and pass an aspect ratio through size.

API surface

OperationEndpointMode
Image generationPOST /v1/images/generationsSync
Image generation taskPOST /v1/async/images/generationsAsync
Image editingPOST /v1/images/editsSync
Image editing taskPOST /v1/async/images/editsAsync

Pricing

Credits

Model idOutput tierCredits / image
gemini-3-pro-image-preview1K (1024px)8
gemini-3-pro-image-preview-2k2K (2048px)8
gemini-3-pro-image-preview-4k4K (4096px)16

Request fields

This model uses the same OpenAI-compatible image fields as the rest of Pixapi.

FieldTypeRequiredDescription
modelstringYesUse gemini-3-pro-image-preview.
promptstringYesDescribe the desired image or edit.
imagestring or string[]Required for editsInput image URL, or an array of image URLs when multiple references are supported.
nnumberNoNumber of images to return. Only 1 is currently supported.
sizestringNoOutput 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-3-pro-image-preview",
  "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-pro-image-preview",
    "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-pro-image-preview",
  "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-pro-image-preview",
  "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.