curl --request POST \
--url https://api.omnimux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "a product photo on white background",
"aspect_ratio": "16:9",
"response_format": "b64_json",
"n": 1
}'
curl --request POST \
--url https://api.omnimux.ai/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "change the studio backdrop to warm morning sunlight",
"images": ["https://example.com/product.jpg"],
"aspect_ratio": "1:1"
}'
{
"created": 1741428397,
"data": [
{ "url": "https://example.com/image.png" }
]
}
{
"created": 1741428397,
"data": [
{ "b64_json": "iVBORw0KGgoAAAANSUhEUg..." }
]
}
{ "error": { "message": "Invalid request", "type": "invalid_request_error", "code": "bad_request" } }
{ "error": { "message": "Invalid token", "type": "authentication_error", "code": "unauthorized" } }
{
"error": {
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}
{ "error": { "message": "Model not allowed", "type": "permission_error", "code": "forbidden" } }
{ "error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" } }
{ "error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" } }
curl --request POST \
--url https://api.omnimux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "a product photo on white background",
"aspect_ratio": "16:9",
"response_format": "b64_json",
"n": 1
}'
curl --request POST \
--url https://api.omnimux.ai/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "change the studio backdrop to warm morning sunlight",
"images": ["https://example.com/product.jpg"],
"aspect_ratio": "1:1"
}'
{
"created": 1741428397,
"data": [
{ "url": "https://example.com/image.png" }
]
}
{
"created": 1741428397,
"data": [
{ "b64_json": "iVBORw0KGgoAAAANSUhEUg..." }
]
}
{ "error": { "message": "Invalid request", "type": "invalid_request_error", "code": "bad_request" } }
{ "error": { "message": "Invalid token", "type": "authentication_error", "code": "unauthorized" } }
{
"error": {
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}
{ "error": { "message": "Model not allowed", "type": "permission_error", "code": "forbidden" } }
{ "error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" } }
{ "error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" } }
Grok Imagine
Grok Imagine 生图
通过 OmniMux 调用 Grok Imagine Image(grok-imagine-image),支持 POST /v1/images/generations 与 /v1/images/edits,兼容 aspect_ratio 与 b64_json 返回格式。
curl --request POST \
--url https://api.omnimux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "a product photo on white background",
"aspect_ratio": "16:9",
"response_format": "b64_json",
"n": 1
}'
curl --request POST \
--url https://api.omnimux.ai/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "change the studio backdrop to warm morning sunlight",
"images": ["https://example.com/product.jpg"],
"aspect_ratio": "1:1"
}'
{
"created": 1741428397,
"data": [
{ "url": "https://example.com/image.png" }
]
}
{
"created": 1741428397,
"data": [
{ "b64_json": "iVBORw0KGgoAAAANSUhEUg..." }
]
}
{ "error": { "message": "Invalid request", "type": "invalid_request_error", "code": "bad_request" } }
{ "error": { "message": "Invalid token", "type": "authentication_error", "code": "unauthorized" } }
{
"error": {
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}
{ "error": { "message": "Model not allowed", "type": "permission_error", "code": "forbidden" } }
{ "error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" } }
{ "error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" } }
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.omnimux.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "a product photo on white background",
"aspect_ratio": "16:9",
"response_format": "b64_json",
"n": 1
}'
curl --request POST \
--url https://api.omnimux.ai/v1/images/edits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-image",
"prompt": "change the studio backdrop to warm morning sunlight",
"images": ["https://example.com/product.jpg"],
"aspect_ratio": "1:1"
}'
{
"created": 1741428397,
"data": [
{ "url": "https://example.com/image.png" }
]
}
{
"created": 1741428397,
"data": [
{ "b64_json": "iVBORw0KGgoAAAANSUhEUg..." }
]
}
{ "error": { "message": "Invalid request", "type": "invalid_request_error", "code": "bad_request" } }
{ "error": { "message": "Invalid token", "type": "authentication_error", "code": "unauthorized" } }
{
"error": {
"message": "Insufficient quota. Please top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}
{ "error": { "message": "Model not allowed", "type": "permission_error", "code": "forbidden" } }
{ "error": { "message": "Rate limit exceeded", "type": "rate_limit_error", "code": "rate_limit_exceeded" } }
{ "error": { "message": "Internal server error", "type": "server_error", "code": "internal_error" } }
- 调用
POST /v1/images/generations生成图像(model设为grok-imagine-image);图像编辑请调用POST /v1/images/edits - 兼容 OpenAI 参数
aspect_ratio(未传size时自动映射为size)以及response_format(url或b64_json) - 实时模型状态与定价请以OmniMux 控制台或
GET /v1/models为准;如需高质量档位,请查看 Grok Imagine Image Quality 生图 - 若上游以异步方式执行,请记录创建响应中的
task_id/id并在控制台用量日志中查看结果
身份
| 字段 | 值 |
|---|---|
| 系列 | 图像系列 |
| 品牌 | Grok Imagine |
| model | grok-imagine-image |
型号对比
| 模型 ID | 定位 | 端点 | 文档 |
|---|---|---|---|
grok-imagine-image | 标准版 | POST /v1/images/generations · /v1/images/edits | 本页 |
grok-imagine-image-quality | 高质量档位 | POST /v1/images/generations · /v1/images/edits | Grok Imagine Image Quality 生图 |
grok-imagine-image-2-0 | 2.0 版本 | POST /v1/images/generations · /v1/images/edits | Grok Imagine Image 2.0 生图 |
接口
| 方法 | 路径 | 用途 |
|---|---|---|
POST | /v1/images/generations | 文生图或带参考图生成 |
POST | /v1/images/edits | 图像编辑(必须提供至少一张参考图) |
https://api.omnimux.ai
鉴权
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
Authorization | header | string | 是 | Bearer sk-...(API Key) |
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 固定为 grok-imagine-image |
prompt | string | 是 | 图像描述或编辑指令 |
n | integer | 否 | 生成张数(受网关上限约束) |
size | string | 否 | 尺寸或宽高比(模型相关) |
aspect_ratio | string | 否 | 宽高比;未显式传入 size 时网关自动映射到 size |
response_format | string | 否 | 返回格式:url 或 b64_json |
quality | string | 否 | 质量档位(模型相关) |
images | string[] | 条件 | 参考图 URL 或 base64 数组(调用 POST /v1/images/edits 时必填);image、image_urls、input_reference 为可接受别名,转发前统一归一为 images |
参考图限制
本模型尚无正式模型规格档案,参考图最大张数、接受格式与单文件大小上限未核验:此处不作具体数值承诺。响应
200
| 字段 | 类型 | 说明 |
|---|---|---|
created | integer | 创建时间戳(同步响应时返回) |
data | array | 图像结果对象(含 url 或 b64_json 及可选 revised_prompt) |
task_id / id | string | 异步任务 id(当上游以异步任务执行时返回) |
task_id / 控制台日志为准(公开文档不提供独立图像查询路径)。