跳转到主要内容
你可以用 OpenAI 兼容接口调用图片生成与编辑接口。 你需要先在 Console 创建 API key

获取 API key

Console 复制 key。

模型列表

先确认 model 该填哪个 id。

文生图(generations)

  • 接口地址POST https://api.yelinai.com/v1/images/generations
curl https://api.yelinai.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4o-image",
    "prompt": "A serene Japanese garden with cherry blossoms",
    "size": "1024x1024"
  }'

图像编辑(edits)

  • 接口地址POST https://api.yelinai.com/v1/images/edits
不同模型对编辑参数支持不同。 你先用最小示例跑通再扩展参数。