curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/grok-imagine-image-quality/text-to-image",
"input": {
"prompt": "A quiet forest under soft morning light, with natural detail.",
"n": 1,
"aspect_ratio": "1:1",
"resolution": "1K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-example",
"status": "running",
"created_time": "2026-09-10T08:00:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Request timeout{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Grok (xAI)
Grok Imagine Image Quality 文生图
Grok Imagine Image Quality 文生图 API 生成 1K 或 2K 图像变体,提供竖版、横版和方形设计的画幅选项。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/grok-imagine-image-quality/text-to-image",
"input": {
"prompt": "A quiet forest under soft morning light, with natural detail.",
"n": 1,
"aspect_ratio": "1:1",
"resolution": "1K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-example",
"status": "running",
"created_time": "2026-09-10T08:00:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Request timeout{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
模型
- xai/grok-imagine-image-quality/text-to-image - 根据文本提示词生成图像。
功能
- 根据文本提示词生成图像。
- 可选
1K、2K输出分辨率。 - 通过
n控制输出图像数量。
输出选项
宽高比
aspect_ratio:可选。可选值:1:1、2:3、3:2、9:16、16:9。默认:1:1。
分辨率
resolution:可选。可选值:1K、2K。默认:1K。
图像数量
n:可选。要生成的图像数量。整数,至少为1。默认:1。未规定最大值;小数、字符串和布尔值会被拒绝。
高级参数
model 和可选的 callback_url 放在请求根级。所有工作流参数(包括输出选项)都放在 input 内。
只发送本工作流支持的 input 字段。不支持的 input 字段会在扣除积分前被拒绝。
提示词
prompt:必填。描述期望的图像。最小长度:1 个字符。- 值必须是字符串且不能为空。未规定提示词最大长度。
计费因素
计费取决于输出分辨率(resolution)和输出图像数量(n)。
积分在提交时扣除,任务失败会退还。授权
使用 VIDGO_API_KEY。
请求体
application/json