
使用参考图片
关闭即为文生图。开启后可上传或粘贴最多 16 张参考图片。
Output size. Use auto, a W:H ratio, or a valid WIDTHxHEIGHT value; explicit pixels are preserved and must match the selected resolution tier.
Output resolution tier. It is independent from rendering quality.
Rendering effort. Auto lets the selected provider choose an appropriate tier.
Number of images to generate. Credits and upstream cost scale with n.
Background handling. Transparent output requires a compatible route.
Requested image output format when supported by the selected provider.
美元估算 $0.045-$0.09:最高充值套餐按 $1 = 2,000 积分计算;入门套餐按 $1 = 1,000 积分计算。

历史记录
保存在此浏览器本地
0 个运行中 · 0 个已完成
计费规则
鉴权
每个请求都需要在 Authorization 头中携带 Bearer 令牌。请在控制台创建 API Key。
Authorization: Bearer YOUR_API_KEYhttps://apiany.ai/v1/images/generations请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | 字符串 | 必填 | 要调用的模型标识,使用该模型的 ID。 |
prompt | 字符串 | 必填 | 描述你想生成内容的文本提示词。 |
size | 字符串 | 可选 | Output size. Use auto, a W:H ratio, or a valid WIDTHxHEIGHT value; explicit pixels are preserved and must match the selected resolution tier. · 可选值: auto, 1:1, 1:2, 2:1, 1:3, 3:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 9:21 · 默认: auto |
resolution | 字符串 | 可选 | Output resolution tier. It is independent from rendering quality. · 可选值: 1K, 2K, 4K · 默认: 1K |
quality | 字符串 | 可选 | Rendering effort. Auto lets the selected provider choose an appropriate tier. · 可选值: auto, low, medium, high, xhigh, max · 默认: auto |
n | 数字 | 可选 | Number of images to generate. Credits and upstream cost scale with n. · 范围: 1–10 · 默认: 1 |
background | 字符串 | 可选 | Background handling. Transparent output requires a compatible route. · 可选值: auto, opaque, transparent · 默认: auto |
output_format | 字符串 | 可选 | Requested image output format when supported by the selected provider. · 可选值: png, jpeg, webp · 默认: png |
output_compression | 数字 | 可选 | Compression level for JPEG or WebP output. · 范围: 0–100 · 默认: 100 |
callback_url | 字符串 | 可选 | 可选的回调地址,异步任务完成后会被调用。 |
请求示例
curl "https://apiany.ai/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2.5",
"prompt": "Generate a polished product campaign image with crisp typography and balanced composition",
"size": "auto",
"resolution": "1K",
"quality": "auto",
"n": 1
}'响应示例
{
"task_id": "task_abc123",
"status": "pending",
"poll_url": "/v1/tasks/task_abc123",
"request_id": "req_abc123",
"credits": {
"reserved": 1000
}
}该端点为异步调用:请求后会立即返回 task_id。请轮询任务状态查询端点,直到 status 变为 succeeded 后再读取 result。生成的媒体链接有效期为 24 小时。