创建图像
https://api.baicaigpt.com/v1/images/generations
根据提示创建图像。官方文档,参见:https://platform.openai.com/docs/api-reference/images/create
请求参数
Header 参数
Content-Type
string
必需
示例值:
application/json
Authorization
string
必需
示例值:
{{BAICAI_API_KEY}}
Body 参数application/json
prompt
string
提示词
所需图像的文本描述。 dall-e-2 的最大长度为 1000 个字符, dall-e-3 的最大长度为 4000 个字符。
model
string
模型
默认为 dall-e-2,用于图像生成的模型。
n
integer
图像数量
默认为 1,要生成的图像数量。必须介于 1 和 10 之间。对于 dall-e-3 ,仅支持 n=1 。
quality
string
质量
默认为标准standard,将生成的图像的质量。 hd 创建具有更精细细节和整个图像更高一致性的图像。仅 dall-e-3 支持此参数。
size
string
尺寸
默认为 1024x1024,生成图像的大小。必须是 256x256 、 512x512 或 1024x1024 (对于 dall-e-2 )之一。对于 dall-e-3 模型,必须是 1024x1024 、 1792x1024 或 1024x1792 之一。
style
string
风格
默认为生动vivid,生成图像的风格。必须是 vivid 或 natural 之一。生动使模型倾向于生成超真实和戏剧性的图像。自然使模型生成更自然、不太真实的图像。仅 dall-e-3 支持此参数。
示例
{
"prompt": "A cute baby sea otter",
"model": "dall-e-3",
"size": "1024x1792"
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSON
数据结构
created
integer
必需
data
array [object {2}]
必需
revised_prompt
string
可选
url
string
可选
示例
{
"created": 1710119349,
"data": [
{
"revised_prompt": "Draw an adorable baby sea otter. The otter should be floating on its back in clear turquoise waters, with its little paws held up. It should have a soft, fluffy brown fur and bright, curious eyes looking directly at us. Add details like its rounded ears and whiskered face to make it look more endearing.",
"url": "https://oaidalleapiprodscus.blob.core.windows.net/private/org-VFCywG2rS9tq8Uq7IQFrNYnH/user-lpbDixzlIxRCItQ4thh1mlG4/img-jE9rWR8pERqszK4UXUy6JeiS.png?st=2024-03-11T00%3A09%3A09Z&se=2024-03-11T02%3A09%3A09Z&sp=r&sv=2021-08-06&sr=b&rscd=inline&rsct=image/png&skoid=6aaadede-4fb3-4698-a8f6-684d7786b067&sktid=a48cca56-e6da-484e-a814-9c849652bcb3&skt=2024-03-10T18%3A17%3A48Z&ske=2024-03-11T18%3A17%3A48Z&sks=b&skv=2021-08-06&sig=JGzrEHbuRiijWv4ubQ9EcT1znG38GnVtLUnmkK1Ov1k%3D"
}
]
}
修改时间 2 个月前