curl --request POST \
--url https://api.newapi.si/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nano-banana",
"prompt": "a cute cat running in cloud",
"n": 1,
"size": "1024x1792"
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
]
}图片生成OpenAI DALL-E格式
生成图像(OpenAI Dall-E兼容)
OpenAI Dall-E格式图片生成接口。
POST /v1/images/generations:创建图片生成任务
标准鉴权头:
-
Content-Type: application/json -
model: string:必填,对外模型名 -
prompt: string:推荐,图片生成描述 -
n: number:可选,生成张数 -
size: string:可选,尺寸或分辨率表达 -
quality: string:可选,质量等级 -
response_format: string:可选,返回格式
常用兼容扩展参数:
imageimage_urlimage_urlsimage_listsubject_image_listscene_imagestyle_imagenegative_promptaspect_ratioresolutioncallback_urlexternal_task_id
3.1 Nano Banana 系列
对外模型:
nano-banananano-banana-pronano-banana-pro-2knano-banana-pro-4knano-banana-2nano-banana-2-2knano-banana-2-4k
能力说明:
nano-banana:基础文生图,也兼容图编辑nano-banana-pro*:更高质量版本nano-banana-2*:更新版本族*-2k/*-4k:高分辨率型号
常用参数:
- 文生图:
model + prompt - 图编辑:
model + prompt + image,也兼容image_urls - 常用扩展:
nsizequalityresponse_format
示例:
{
"model": "nano-banana",
"prompt": "a cute cat running in cloud",
"n": 1,
"size": "1024x1792"
}
{
"model": "nano-banana-pro",
"prompt": "把主体改成赛博朋克夜景",
"image": "https://example.com/input.png",
"n": 1
}
3.2 Seedream 系列
对外模型:
doubao-seedream-3-0-t2i-250415doubao-seedream-4-0-250828doubao-seedream-4-5-251128doubao-seedream-5-0-260128
能力说明:
- 统一按文生图调用
- 建议优先传标准参数:
prompt + model + size/aspect_ratio
常用参数:
model + prompt- 可选:
sizeaspect_ration
3.3 Kolors 虚拟试衣
这是独立虚拟试衣服务,不属于 Kling 视频模型版本。
支持 kolors-virtual-try-on-v1、kolors-virtual-try-on-v1-5。
最小入参为 model + human_image + cloth_image,不需要 model_name。
{
"model": "kolors-virtual-try-on-v1",
"human_image": "https://example.com/human.jpg",
"cloth_image": "https://example.com/cloth.jpg"
}
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.newapi.si/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "nano-banana",
"prompt": "a cute cat running in cloud",
"n": 1,
"size": "1024x1792"
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
]
}请求体
application/json
