Skip to content

Gemini 3.1 Flash Lite Image

gemini-3.1-flash-lite-image 是 Google 的 Gemini 3.1 Flash Lite Image 图片模型,面向速度、规模和低成本优化,适合把延迟和单次成本作为主要约束的产品工作流。

Google 官方说明该 Lite 模型不适合多参考图输入或多轮连续编辑。建议用于快速 1K 生成和简单编辑;如果需要更强参考一致性或更多输出档位,请使用 gemini-3.1-flash-image-preview

API 形式

操作Endpoint模式
图片生成POST /v1/images/generations同步
图片生成任务POST /v1/async/images/generations异步
图片编辑POST /v1/images/edits同步
图片编辑任务POST /v1/async/images/edits异步

价格

模型 id输出档位每张积分
gemini-3.1-flash-lite-image1K2

请求字段

该模型与 Pixapi 其他图片模型一样,使用 OpenAI 兼容图片字段。

字段类型必填说明
modelstring使用 gemini-3.1-flash-lite-image
promptstring描述要生成或编辑的图片。
imagestring 或 string[]编辑必填输入图片 URL。该 Lite 模型建议优先使用单张参考图。
nnumber返回图片数量,当前仅支持传 1
sizestring输出比例:1:13:22:33:44:34:55:49:1616:921:9

示例

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))
}

共享响应结构和图片编辑上传示例见 API 参考