Skip to main content
POST
/
v1
/
images
/
generations
图像生成
curl --request POST \
  --url https://api.seeoneapi.com/v1/images/generations

Documentation Index

Fetch the complete documentation index at: https://docs.seeoneapi.com/llms.txt

Use this file to discover all available pages before exploring further.

请求参数

参数类型必填默认值说明
modelstringgpt-image-2
promptstring图像描述
ninteger1生成数量,1-4
sizestring1024x1024图像尺寸
qualitystringautoauto / high / medium / low
response_formatstringurlurlb64_json

支持的尺寸

1024x10241536x10241024x15362048x20484096x4096

请求示例

curl https://api.seeoneapi.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-你的API密钥" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A serene Japanese garden with cherry blossoms, watercolor style",
    "n": 1,
    "size": "1024x1024",
    "quality": "high"
  }'

响应示例

URL 格式:
{
  "created": 1716000000,
  "data": [
    {
      "url": "https://...",
      "revised_prompt": "A serene Japanese garden..."
    }
  ]
}
Base64 格式(response_format: "b64_json"):
{
  "created": 1716000000,
  "data": [
    {
      "b64_json": "iVBORw0KGgo...",
      "revised_prompt": "A serene Japanese garden..."
    }
  ]
}

注意事项

  • 4K(4096×4096)生成耗时较长,建议超时设置 120 秒以上
  • revised_prompt 是模型优化后的提示词
  • URL 格式的链接有有效期,生产环境建议使用 b64_json