API 目录

Ideogram(文生图)

POST
/ideogram/generate

文生图生成

POST https://www.vortapapi.com/v1/ideogram/generate

根据输入的文本提示词同步生成图像。你可以在请求中传入提示词以及其他可选生成参数,以控制图像风格、尺寸、种子等生成行为。

生成完成后,接口会返回图像结果信息。返回的图片 URL 为临时地址,有效期为 24 小时,过期后将无法继续访问。

请求头

名称必填说明
Content-Type请求体格式,通常为 application/json
Accept响应格式,通常为 application/json
AuthorizationAPI 密钥,格式为 Bearer sk-***

请求示例

curl https://www.vortapapi.com/v1/ideogram/generate \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer sk-***" \
  -d '{
    "prompt": "A serene tropical beach scene with tall palm trees, soft sand, blue ocean water, and a colorful sunrise sky."
  }'

响应示例

{
  "created": "2024-12-15T17:32:00.965408+00:00",
  "data": [
    {
      "is_image_safe": true,
      "prompt": "A serene tropical beach scene. Dominating the foreground are tall palm trees with lush green leaves, standing tall against a backdrop of a sandy beach. The beach leads to the azure waters of the sea, which gently kisses the shoreline. In the distance, there is an island or landmass with a silhouette of what appears to be a lighthouse or tower. The sky above is painted with fluffy white clouds, some of which are tinged with hues of pink and orange, suggesting either a sunrise or sunset.",
      "resolution": "768x1232",
      "seed": 1785282233,
      "style_type": null,
      "url": "https://www.vortapapi.com/v1/images/ephemeral/WkoxvqiOTaaCqG1nO2tQoA.png?exp=1734370337&sig=110fe96dc9e01002c8d837e5b4cde1aaa266195561d231ce76e19e095e478ffe"
    }
  ]
}

响应字段说明

字段类型说明
createdstring图像生成完成的时间戳
dataarray生成结果列表
data[].is_image_safeboolean图像是否通过安全检查
data[].promptstring实际用于生成图像的提示词
data[].resolutionstring生成图像的分辨率
data[].seedinteger本次生成使用的随机种子
data[].style_typestring | null图像风格类型;未指定时可能为 null
data[].urlstring生成图片的临时访问地址,24 小时内有效