images/generations 是 OpenAI 的图像生成接口,通过文本提示词创建高质量的图像内容。dall-e-2 和 dall-e-3 生成的图像返回格式必须为 url 或 b64_json。URLs 仅在图像生成后有效 60 分钟。此参数不支持 gpt-image-1,后者将始终返回 base64 编码的图像。curl --location --request POST 'https://api.deerapi.com/v1/images/generations' \
--header 'Authorization: {{api-key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-image-1-mini",
"prompt": "A cute baby sea otter",
"n": 1,
"stream": true,
"size": "1024x1024"
}'{
"created": 1713833628,
"data": [
{
"b64_json": "..."
}
],
"usage": {
"total_tokens": 100,
"input_tokens": 50,
"output_tokens": 50,
"input_tokens_details": {
"text_tokens": 10,
"image_tokens": 40
}
}
}