Ideogram 4.6 API
ideogram/v4.6/text-to-imageIdeogram 4.6 API 将提示词转为海报、封面、标签和照片,文字排版清晰易读。质量可选 very_low、low、medium 或 high,尺寸可用预设画幅或最大 4096×4096 的精确尺寸,每次最多 8 张,并可输出透明背景。Ideogram 4.6 API 的 2K 图片每张 1.6 积分($0.008)起。
获取 API Key预计费用: 6 credits · $0.0300 · 2K
按质量和档位计价,再乘以 n。提交时扣除;返回张数不足时降低扣费,任务失败全额退还。
REST API
快速开始
以下流程提交一个合法的 Ideogram 4.6 Text to Image 请求,取得 task_id,并在异步任务结束后读取结果文件 URL。
连接 Vidgo API
创建 API Key,仅保存在服务端,并通过 Authorization: Bearer VIDGO_API_KEY 发送。
- 端点
- POST
https://api.vidgo.ai/api/generate/submit - 认证
- Authorization: Bearer VIDGO_API_KEY
提交一个任务
向统一提交端点发送当前模型 ID 与 input 对象。input 只能包含本端点参数表列出的字段,其他字段会返回 400。
curl --request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "ideogram/v4.6/text-to-image",
"input": {
"prompt": "Risograph-printed zine cover for a birdwatching club in Kenya. The title reads exactly \"BIRDS OF LAKE NAIVASHA\" in tall condensed letters across the top, with the subtitle \"Field Notes · Volume 3\" underneath. A pied kingfisher dives toward the water among papyrus reeds. Two-color fluorescent pink and teal ink with slight misregistration and grainy halftone texture.",
"size": "3:4",
"quality": "low"
}
}'等待结果
读取 data.task_id,仅在 not_started 或 running 时继续轮询;finished 与 failed 都必须停止。
查询状态
GET https://api.vidgo.ai/api/generate/status/{task_id}建议每 2–5 秒查询一次,并对 429/5xx 退避。也可在顶层提供 callback_url,在任务进入终态时接收回调。
not_startedrunningfinishedfailed{
"code": 200,
"data": {
"task_id": "task-example",
"status": "not_started",
"created_time": "2026-11-03T08:00:00"
}
}{
"code": 200,
"data": {
"task_id": "task-example",
"status": "finished",
"created_time": "2026-11-03T08:00:00",
"progress": 100,
"files": [
{
"file_url": "https://example.com/result.png",
"file_type": "image"
}
]
}
}完整可运行轮询示例
展开后可查看同一 payload 的端到端脚本,包含业务 code、缺失 task_id、失败状态、异常状态和网络错误处理。
set -euo pipefail
: "${VIDGO_API_KEY:?Set VIDGO_API_KEY in your environment}"
REQUEST_BODY=$(cat <<'JSON'
{
"model": "ideogram/v4.6/text-to-image",
"input": {
"prompt": "Risograph-printed zine cover for a birdwatching club in Kenya. The title reads exactly \"BIRDS OF LAKE NAIVASHA\" in tall condensed letters across the top, with the subtitle \"Field Notes · Volume 3\" underneath. A pied kingfisher dives toward the water among papyrus reeds. Two-color fluorescent pink and teal ink with slight misregistration and grainy halftone texture.",
"size": "3:4",
"quality": "low"
}
}
JSON
)
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
--request POST \
--url "https://api.vidgo.ai/api/generate/submit" \
--header "Authorization: Bearer $VIDGO_API_KEY" \
--header "Content-Type: application/json" \
--data "$REQUEST_BODY")
TASK_ID=$(printf '%s' "$SUBMIT_RESPONSE" | jq -r '.data.task_id // .task_id // empty')
if [ -z "$TASK_ID" ]; then
printf 'Submit response did not include task_id:
%s
' "$SUBMIT_RESPONSE" >&2
exit 1
fi
while true; do
STATUS_RESPONSE=$(curl --silent --show-error --fail-with-body \
--url "https://api.vidgo.ai/api/generate/status/$TASK_ID" \
--header "Authorization: Bearer $VIDGO_API_KEY")
STATUS=$(printf '%s' "$STATUS_RESPONSE" | jq -r '.data.status // .status // empty')
case "$STATUS" in
finished)
printf '%s' "$STATUS_RESPONSE" | jq -r '(.data.files // .files // [])[]?.file_url'
break
;;
failed)
printf '%s' "$STATUS_RESPONSE" | jq -r '.data.error_message // .error_message // "Generation failed"' >&2
exit 1
;;
not_started|running)
sleep 2
;;
*)
printf 'Unexpected task status: %s
' "$STATUS" >&2
exit 1
;;
esac
done请求参数
下表仅列出 input 对象内的公开字段。顶层 model 与可选 callback_url 请参考快速开始示例。
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| input.prompt | string | 是 | – | 非空文本,最多 10,000 个字符。需要出现在图中的每个词都请放进英文双引号。 |
| input.quality | string | 否 | medium | very_low、low、medium 或 high。very_low 仅适用于 2K 档。 |
| input.size | string | 否 | auto | auto、预设(1:1、1:1 HD、4:3、3:4、16:9、9:16)或 WIDTHxHEIGHT:边长 256–4096 像素、为 32 的倍数、宽高比不超过 6:1。auto 与预设属于 2K 档;面积超过 2048×2048 像素的自定义尺寸属于 4K 档。 |
| input.n | integer | 否 | 1 | 生成张数,1–8。 |
| input.background | string | 否 | – | transparent 或 opaque。不传则由模型自行决定。 |
| input.seed | integer | 否 | – | 0 到 2147483647 的整数,用于复现结果。 |
响应字段
提交响应返回任务标识;状态响应在任务结束时提供结果文件或失败信息。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 业务返回码,0 或 200 表示成功。 |
| message | string | 可选的人类可读响应信息。 |
| data.task_id | string | 提交成功后用于查询状态的唯一任务 ID。 |
| data.status | string | not_started、running、finished 或 failed。 |
| data.created_time | string | 任务创建时间。 |
| data.progress | integer | 状态响应中的 0–100 进度值。 |
| data.files[] | array | finished 时按返回顺序排列的生成文件。 |
| data.files[].file_url | string | 生成文件(.png)的直接 URL。 |
| data.files[].file_type | string | 结果文件类型为 image。 |
| data.error_message | string | null | failed 状态的可读失败原因。 |
任务生命周期
只有前两个状态可继续轮询;finished 与 failed 均为终态。
not_started已接收并排队,等待执行。
running正在生成,可以继续轮询。
finished成功终态,验证 files 并读取文件 URL。
failed失败终态,读取 error_message 并停止;预扣积分会全部退还。
轮询与错误处理
- 认证使用有效的 VIDGO_API_KEY,将密钥保存在服务端,并通过 Bearer 认证发送请求。
- 参数校验400 表示模型 ID、字段、枚举、长度、数量或尺寸不符合本端点契约,包括传入其他端点的字段。
- 轮询间隔从 2–5 秒开始;对 429 和 5xx 使用指数退避,并设置总超时。
- 终态finished 后读取 files 中的文件 URL;failed 后读取 error_message。两种状态均结束轮询。
- 回调在顶层提供公开 callback_url;服务会在 finished 或 failed 后 POST 任务对象。
- 网络错误区分请求超时、网络失败和任务失败;仅在安全时重试同一查询。
模型规格
| 规格 | 取值 | 说明 |
|---|---|---|
| 模型 | ideogram/v4.6/text-to-image | Ideogram 4.6 Text to Image |
| 输入 | prompt | 最多 10,000 个字符的文本 |
| 输出 | PNG 图片 × n(1–8) | 图片 URL 位于 files[] |
| quality | very_low / low / medium / high | 2K:每张 1.6 / 6 / 12 / 20 积分;4K:每张 12 / 24 / 40 积分 |
| size | auto、6 种预设或 WIDTHxHEIGHT | 最大 4096×4096;面积超过 2048×2048 为 4K |
Ideogram 4.6 API 常见问题
Ideogram 4.6 API 是什么?
Ideogram 4.6 API 让开发者调用 Ideogram 4.6,这是 Ideogram 可生成最高 4K 图片、提供 Very low、Low、Medium 和 High 四档质量的图像模型。在 Vidgo 上,文生图端点每次返回 1–8 张图,支持预设画幅、精确自定义尺寸、透明背景和 seed。你可以通过 API 调用,也可以在上方体验区直接试用。
Ideogram 4.6 API 多少钱?
2K 档 very_low、low、medium、high 每张分别为 1.6、6、12、20 积分;4K 档 low、medium、high 每张分别为 12、24、40 积分。总价为单价乘以 n。
如何用 Ideogram 4.6 API 生成 4K 图片?
发送面积超过 2048×2048 像素的自定义尺寸,例如 4096x2304 或 4096x4096,边长为 32 的倍数,质量选 low、medium 或 high。auto 和预设画幅保持在 2K 档。
Ideogram 4.6 和 Ideogram 4.5 有什么区别?
Ideogram 4.6 文生图支持最高 4K 的自定义尺寸和 very_low 质量,在 Vidgo 上还提供透明背景和 seed 字段。Ideogram 4.5 文生图提供 low、medium、high 三档质量,以及预设画幅和 36 种固定像素尺寸。
Ideogram 4.6 API 能生成透明背景图片吗?
可以。把 background 设为 transparent,Ideogram 4.6 API 会返回透明背景的 PNG,可直接用于贴纸、Logo 和产品标签。
用 Ideogram 4.6 API 生成文字时怎么写提示词?
逐行准确引用文字、说明位置并写明印刷风格,就像杂志封面提示词那样:标题在顶部横排,副标题在其下方。



