
🇺🇸 English

🇺🇸 English
- Chat Models
- Anthropic
- Suno
- Udio
- Midjourney API
- Flux
- Recraft
- Ideogram
- Luma
- Runway
- Kling-API
- Replicate
- MiniMax
Generate
POST
/ideogram/generate
最后修改时间:2025-02-05 11:29:18
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Header 参数
Authorization
string
可选
默认值:
{{YOUR_API_KEY}}
Body 参数application/json
image_request
object
必需
prompt
string
必需
生成图像的提示。
aspect_ratio
string
可选
(不能与分辨率一起使用)用于图像生成的宽高比,决定图像的分辨率。默认为 ASPECT_1_1。
默认值:
ASPECT_1_1
model
string
可选
用于生成的模型。默认为 V_2。
默认值:
V_2
示例值:
V_1V_1_TURBOV_2V_2_TURBO
magic_prompt_option
string
可选
确定是否应该在生成请求时使用 MagicPrompt
默认值:
AUTO
示例值:
AUTOONOFF
seed
integer
可选
style_type
string
可选
生成的样式类型;这仅适用于 V_2 及以上版本的模型,不应为 V_1 版本的模型指定。
示例值:GENERAL、REALISTIC、DESIGN、RENDER_3D、ANIME
示例值:
GENERALREALISTICDESIGNRENDER_3DANIME
num_images
string
可选
negative_prompt
string
可选
描述从图像中排除的内容。提示中的描述优先于负提示中的描述。
resolution
string
可选
最终图像的分辨率。
示例值:
RESOLUTION_832_1152
示例
{
"image_request": {
"model": "V_2_TURBO",
"magic_prompt_option": "AUTO",
"seed": 111,
"prompt": "cat",
"num_images": 1
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/ideogram/generate' \
--header 'Authorization: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"image_request": {
"model": "V_2_TURBO",
"magic_prompt_option": "AUTO",
"seed": 111,
"prompt": "cat",
"num_images": 1
}
}'
返回响应
🟢200成功
application/json
Body
data
array [object {5}]
必需
包含生成图像的图像对象列表。
seed
integer
必需
prompt
string
必需
用于生成的提示。这可能与原始提示不同。
resolution
string
必需
最终图像的分辨率。
url
string | null
必需
生成的图像的直接链接。
is_image_safe
boolean
必需
该请求是否通过安全检查。如果为假,网址字段将为空。
created
string
必需
请求创建的时间。
示例
{
"data": [
{
"seed": 12345,
"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's 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": "1024x1024",
"url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g",
"is_image_safe": true
},
{
"seed": 12345,
"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's 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": "1024x1024",
"url": "https://ideogram.ai/api/images/direct/8YEpFzHuS-S6xXEGmCsf7g",
"is_image_safe": true
}
],
"created": "2000-01-23T04:56:07.000Z"
}