众扬汇 AI 开放平台 API 文档

ideogram(文生图)

OpenAPI Specification

文生图接口(同步返回):按提示词与可选参数直接生成图像。返回的图片地址存在有效期(时长待补),建议及时转存。

请求方式:POST

接口地址

text
https://api.allyang.cn/ideogram/generate

请求头

  • accept(必填):(示例:application/json)
  • content-type(必填):(示例:application/json)
  • Authorization(可选):鉴权头,使用控制台创建的令牌,格式为 Bearer + 令牌。(示例:Bearer {{YOUR_API_KEY}})

请求参数(application/json)

  • image_request(object,必填)
    • aspect_ratio(string,必填):可选比例枚举:ASPECT_10_16、ASPECT_16_10、ASPECT_9_16、ASPECT_16_9、ASPECT_3_2、ASPECT_2_3、ASPECT_4_3、ASPECT_3_4、ASPECT_1_1、ASPECT_1_3、ASPECT_3_1。
    • magic_prompt_option(string,必填):可选值 AUTO、ON、OFF。
    • model(string,必填):可选值 V_1、V_1_TURBO、V_2、V_2_TURBO。
    • prompt(string,必填)
    • style_type(string,必填)
    • negative_prompt(string,必填)
    • resolution(string,必填)
    • color_palette(string,必填)

请求示例

json
{
  "image_request": {
    "aspect_ratio": null,
    "magic_prompt_option": null,
    "model": null,
    "prompt": null,
    "style_type": null,
    "negative_prompt": null,
    "resolution": null,
    "color_palette": null
  }
}

使用提示:返回地址存在有效期,建议下载后自行转存;参数细节以本站参数说明为准(待补)。