1. 第三方api
抠抠图
  • 印花提取
    • 标准效果-异步api
      • image file 印花提取api
      • image url 印花提取api
      • 异步轮询查询结果
  • 抠图api
    • 通用抠图
      • 同步api
        • image url 抠图api
        • image file 抠图api
        • image base64 抠图api
      • 异步api
        • image url 抠图api
        • image file 抠图api
        • image base64 抠图api
        • 异步轮询查询结果
    • 印花抠图
      • 同步api
        • image url 印花抠图api
        • image file 印花抠图api
        • image base64 印花抠图api
      • 异步api
        • image url 印花抠图api
        • image file 印花抠图api
        • image base64 印花抠图api
        • 异步轮询查询结果
  • AI生成阴影
    • 异步AI生成阴影api
      • image url ai生成阴影api
      • image file ai生成阴影api
      • 异步轮询查询结果
  • 第三方api
    • nano-banana
      POST
    • seedream4.5
      POST
    • nano-banana-pro
      POST
  1. 第三方api

nano-banana

将废弃
POST
/v1beta/models/gemini-2.5-flash-image:generateContent

请求参数

Header 参数

Body 参数application/json必填

示例
{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "inline_data": {
            "mime_type": "image/jpg",
            "data": "图二base64</9j/4AAQSkZJRxxxx6xilSlAAAQ...>"
          }
        },
        {
          "inline_data": {
            "mime_type": "image/jpeg",
            "data": "图一base64</9j/4AAQSkZJRxxxx6xilSlAAAQA...>"
          }
        },
        {
          "text": "生成图片:按照图二中的背景替换成图一"
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "IMAGE"
    ],
    "imageConfig": {
      "aspectRatio": "生成图像的宽高比。可选值:1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9。要是不提供此字段API将默认返回与输入图片最接近的原图比例"
    }
  }
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://apis.koukoutu.com/v1beta/models/gemini-2.5-flash-image:generateContent' \
--header 'Authorization: Bearer sk-xxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "inline_data": {
            "mime_type": "image/jpg",
            "data": "图二base64</9j/4AAQSkZJRxxxx6xilSlAAAQ...>"
          }
        },
        {
          "inline_data": {
            "mime_type": "image/jpeg",
            "data": "图一base64</9j/4AAQSkZJRxxxx6xilSlAAAQA...>"
          }
        },
        {
          "text": "生成图片:按照图二中的背景替换成图一"
        }
      ]
    }
  ],
  "generationConfig": {
    "responseModalities": [
      "IMAGE"
    ],
    "imageConfig": {
      "aspectRatio": "生成图像的宽高比。可选值:1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9。要是不提供此字段API将默认返回与输入图片最接近的原图比例"
    }
  }
}'

返回响应

🟢200成功
application/json
Body

示例
{
    "candidates": [
        {
            "content": {
                "parts": [
                    {
                        "inlineData": {
                            "mimeType": "image/jpeg",
                            "data": "<图像base64>,如:/9j/4AAQSkZJRxxxx6xilSlAAAQAAAAxxx1ZLU="
                        }
                    }
                ],
                "role": "model"
            },
            "finishReason": "STOP",
            "index": 0
        }
    ],
    "usageMetadata": {
        "promptTokenCount": 266,
        "candidatesTokenCount": 1226,
        "totalTokenCount": 1643,
        "promptTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 8
            },
            {
                "modality": "IMAGE",
                "tokenCount": 258
            }
        ],
        "candidatesTokensDetails": [
            {
                "modality": "IMAGE",
                "tokenCount": 1120
            }
        ],
        "thoughtsTokenCount": 151
    },
    "modelVersion": "gemini-2.5-flash-image",
    "responseId": "xxxx"
}
🟠401未认证
修改于 2026-04-16 07:26:23
上一页
异步轮询查询结果
下一页
seedream4.5
Built with