生成图像(Base64 返回)
- 接口:
POST https://api.olddog.shop/v1/images/generations - 关键参数:
response_format: "b64_json"
当你希望直接拿到图像二进制内容(Base64)用于本地落盘或二次处理时,可使用 b64_json 返回格式。
请求参数(新增部分)
| 参数名 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| response_format | string | 是 | 固定为 "b64_json"。 |
其余参数与「生成图像(URL 返回)」一致。
cURL 示例
bash
curl --request POST "https://api.olddog.shop/v1/images/generations" \
--header "Authorization: Bearer $OLD_DOG_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"prompt": "极简线条风的柴犬头像,白底,矢量插画风格",
"size": "1024x1024",
"response_format": "b64_json"
}'