メインコンテンツへスキップ
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 の Grok モデルを使用してテキストから画像を生成します。

承認

Authorization
string
header
必須

API トークンを使用して認証してください

ボディ

application/json

タスクパラメータ

prompt
string
必須

プロンプト(必須)

Required string length: 1 - 5000
:

"A beautiful sunset over the ocean"

aspect_ratio
enum<string>

アスペクト比(任意)

利用可能なオプション:
2:3,
3:2,
1:1
:

""

レスポンス

OK

task_id
string
必須

Task ID

:

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