| 接口类型 | 端点 | 说明 |
|---|---|---|
| OpenAI聊天接口 | /v1/chat/completions | 支持流、非流 连续对话、不支持尺寸 |
| OpenAI图片生成接口 | /v1/image/generations | 文生图、支持尺寸 |
| OpenAI图片编辑接口 | /v1/image/edits | 图生图(支持传入1~6张图)、支持尺寸 |
Authorization: Bearer ********************| Aspect ratio | Resolution |
|---|---|
| 1:1 | 1024x1024 |
| 2:3 | 832x1248 |
| 3:2 | 1248x832 |
| 3:4 | 864x1184 |
| 4:3 | 1184x864 |
| 4:5 | 896x1152 |
| 5:4 | 1152x896 |
| 9:16 | 768x1344 |
| 16:9 | 1344x768 |
| 21:9 | 1536x672 |
gemini-3+系列模型请使用以下值 1K、2K、4Kgemini-3.1-flash-image-preview额外支持0.5Kgemini-3+系列模型支持该参数。输入具体的图片比例
示例: 2:3`// 基础示例
{
"model": "nano-banana",
"prompt": "一张逼真的高分辨率照片,拍摄的是繁忙的城市街道",
"size": "2:3"
}
// nano-banana-pro(gemini-3-pro-image-preview)
{
"model": "nano-banana-pro",
"prompt": "一张逼真的高分辨率照片,拍摄的是繁忙的城市街道",
"size": "4K",
"aspect_ratio": "2:3"
}
// 名称携带-2k、-4k,无需传aspect_ratio
{
"model": "nano-banana-pro-2k",
"prompt": "一张逼真的高分辨率照片,拍摄的是繁忙的城市街道",
"size": "2:3",
"response_format": "url"
}curl --location --request POST 'https://api.pawmaas.com/v1/images/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '// 基础示例
{
"model": "nano-banana",
"prompt": "一张逼真的高分辨率照片,拍摄的是繁忙的城市街道",
"size": "2:3"
}
// nano-banana-pro(gemini-3-pro-image-preview)
{
"model": "nano-banana-pro",
"prompt": "一张逼真的高分辨率照片,拍摄的是繁忙的城市街道",
"size": "4K",
"aspect_ratio": "2:3"
}
// 名称携带-2k、-4k,无需传aspect_ratio
{
"model": "nano-banana-pro-2k",
"prompt": "一张逼真的高分辨率照片,拍摄的是繁忙的城市街道",
"size": "2:3",
"response_format": "url"
}'{
"created": 1745984918,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAABAAAAAYACAI..."
}
],
"usage": {
"input_tokens": 8,
"input_tokens_details": {
"image_tokens": 0,
"text_tokens": 8
},
"output_tokens": 1308,
"total_tokens": 1316
}
}