Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用
文生图xAI

Grok Imagine Image

API 文档
x-ai/grok-imagine-image

Grok Imagine Image by xAI generates images from a prompt or edits up to 5 input images, at $0.02 per image. Call it from this page, through /v1/run, or with the xAI Images API at SandBase.

试用该模型

Playground

打开 playground
输入
Describe the image, or the change to make to the input images.

PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 5

Up to 5 images to edit or combine (upload or public HTTPS URL). Leave empty to generate from the prompt.
Output aspect ratio. auto picks one from the prompt or the first input image.
Output size: 1k or 2k.
高级设置
110
Images to generate (1-10). Each image is billed. 范围:1 到 10。

Fill in prompt to run

Per run$0.02
结果
空闲

您的输出将显示在这里

完成输入,然后点击运行。

Grok Imagine Image

Grok Imagine Image is xAI's previous image model, at $0.02 per image. It generates images from a prompt, or edits and combines up to 5 input images. For better quality and 1.5K output, use Grok Imagine Image 2.0.

Use the form on this page, call x-ai/grok-imagine-image through /v1/run, or call the xAI API below with model: grok-imagine-image. Both bill the same as xAI.

Inputs

FieldTypeDefaultNotes
promptstring, required—What to draw, or what to change.
imagesimage list, up to 5—Images to edit or combine. Leave empty to generate.
ninteger 1–101Images to generate.
aspect_ratioauto1:116:99:164:33:43:22:32:11:219.5:99:19.520:99:2021:95:2autoOutput shape.
resolution1k / 2k1kOutput size; the price is the same.

xAI API

SandBase implements xAI's Images and Videos API under https://api.sandbase.ai/grok/v1. Requests and responses match xAI's API reference field by field, so the xAI SDK or any OpenAI-style HTTP client works after you change the base URL and use your SandBase API key.

xAISandBase
Base URLhttps://api.x.ai/v1https://api.sandbase.ai/grok/v1
GeneratePOST /images/generationsPOST /images/generations
EditPOST /images/editsPOST /images/edits
Deferred resultGET /images/{request_id}GET /images/{request_id}
modelgrok-imagine-imagegrok-imagine-image
curl https://api.sandbase.ai/grok/v1/images/edits \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-image",
    "prompt": "Turn this photo into a watercolor painting",
    "image": {"url": "https://example.com/photo.jpg"},
    "response_format": "url"
  }'

quality and resolution: 1.5k are only available on Grok Imagine Image 2.0 and return 400 here, as they do at xAI.

Billing

$0.02 per image. Editing adds $0.002 per input image. Failed runs are not billed.

RequestPrice
Generate 1 image$0.02
Generate 4 images$0.08
Edit 1 input image$0.022

One mode at a time

Learn more