跳转到主要内容
POST
/
generate
/
k
/
grok-text-to-image
Grok 文本转图片
curl --request POST \
  --url https://api.sinancode.com/v1/generate/k/grok-text-to-image \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "A beautiful sunset over the ocean",
  "aspect_ratio": ""
}
'
{
  "task_id": "01234567-89ab-cdef-0123-456789abcdef"
}
使用 xAI 的 Aurora 图像生成模型,从文本生成高质量图片。 模型特点:
  • 照片级真实感 - 自回归混合专家架构,生成逼真的人物肖像和实体图像
  • 精准指令遵循 - 准确理解并执行复杂的文本描述
  • 文字与 Logo 渲染 - 出色的艺术文字和品牌标识生成能力
  • 名人/实体识别 - 能准确生成真实世界人物和物体的图像

Authorizations

Authorization
string
header
required

请使用您的 API Token 进行认证

Body

application/json

任务参数

prompt
string
required

提示词(必填)

Required string length: 1 - 5000
Example:

"A beautiful sunset over the ocean"

aspect_ratio
enum<string>

宽高比(可选)

可用选项:
2:3,
3:2,
1:1
Example:

""

Response

OK

task_id
string
required

Task ID

Example:

"01234567-89ab-cdef-0123-456789abcdef"