Skip to content

生成图像(Base64 返回)

  • 接口POST https://api.olddog.shop/v1/images/generations
  • 关键参数response_format: "b64_json"

当你希望直接拿到图像二进制内容(Base64)用于本地落盘或二次处理时,可使用 b64_json 返回格式。

请求参数(新增部分)

参数名类型是否必填说明
response_formatstring固定为 "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"
  }'