xai/grok-imagine-image
Grok Imagine 的基础款文生图模型,适合批量出图。走 OpenAI 兼容的 /v1/images/generations,可用 aspect_ratio 指定画幅,支持 1k / 2k 分辨率,单次最多 4 张,按张计费。暂不支持图片编辑。
API 调用时用任一 ID 都可以。
xai/grok-imagine-image把 ONEHOP_KEY 占位符替换为你的 API Key。 创建 →
from openai import OpenAI
client = OpenAI(
base_url="https://api.onehop.ai/v1",
api_key="<ONEHOP_KEY>",
)
response = client.images.generate(
model="xai/grok-imagine-image",
prompt="A red panda coding under the moonlight",
n=1,
)
print(response.data[0].url)