Images API
使用 AI 模型生成图像。
端点
POST https://api.ofox.ai/v1/images/generations请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | ✅ | 图像生成模型 |
prompt | string | ✅ | 图像描述文本 |
n | number | — | 生成数量,默认 1 |
size | string | — | 图像尺寸,如 1024x1024 |
quality | string | — | 图像质量:standard 或 hd |
response_format | string | — | 返回格式:url 或 b64_json |
请求示例
cURL
Terminal
curl https://api.ofox.ai/v1/images/generations \
-H "Authorization: Bearer $OFOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/dall-e-3",
"prompt": "一只戴着墨镜的小狐狸在冲浪",
"n": 1,
"size": "1024x1024"
}'响应格式
{
"created": 1703123456,
"data": [
{
"url": "https://...",
"revised_prompt": "..."
}
]
}图像生成功能支持的模型和定价请查看 模型目录 。