Grok Imagine Image 2.0 API
接入 API 之前,先试用 Grok Imagine Image 2.0。
在正式接入前测试出图质量、估算积分消耗、生成示例。
Create image task
Fixed to grok-imagine-image-2.0Optional. Add 1-3 images to switch to editing mode. Each input image is billed once per request.

充值前先算清测试成本。
定价是分辨率(1K/2K)× 质量(Low/Medium)的简单矩阵。从单张样张成本开始,选择合适的测试预算。
First Test Cost
Text-to-Image - 1K - Low qualityOne 1K Low prompt-only image
About 333 tests with $10 in credits.
Start with the 1K Low tier for drafts, then switch to Medium or 2K for the final check. Input images add a per-image fee once per request.
Testing Budget Guide
Pick an amount based on how many tests you expect.Good for a first validation.
Good for prompt iteration.
Good before production integration.
Common Cost Examples
Estimated cost for one generated image. Multiply the output rate by n for multi-image requests; input image fees are charged once per request.
Model Pricing
| Item | Rule | Rate | Billing |
|---|---|---|---|
| 1K · Low | Fastest tier (~10s) for drafts and prompt iteration. | $0.030/image-25% 2.04 cr/image$0.040 官方价 | Per output image |
| 1K · Medium (default) | Default tier with better detail; generation may take 10-75s. | $0.045/image-25% 3.06 cr/image$0.060 官方价 | Per output image |
| 2K · Low | Higher resolution with the fast quality tier. | $0.045/image-25% 3.06 cr/image$0.060 官方价 | Per output image |
| 2K · Medium | Highest tier for final quality checks. | $0.060/image-25% 4.08 cr/image$0.080 官方价 | Per output image |
Optional Add-ons & Billing NotesInput image pricing and multi-image requests.
| Item | Rule | Rate | Billing |
|---|---|---|---|
| Input images | Applied to each input image in image_urls (max 3), charged once per request regardless of n. | $0.0075/image-25% 0.51 cr/image$0.010 官方价 | Per input image |
| Multiple outputs (n) | n can be 1-10. The output rate is multiplied by n; failed tasks are not charged. | Output rate × n | Per request |
Grok Imagine Image 2.0 文生图与图像编辑能力
Grok Imagine Image 2.0 使用官方模型 ID grok-imagine-image-2.0,在一个 API 路由中支持文生图和 1-3 张参考图编辑,并提供 13 种比例、1K/2K 输出及单次最多 10 张批量生成。
Grok Imagine Image 2.0 指南与对比
Grok Imagine Image 2.0 核心图像能力

用一条提示词生成商业主视觉

用参考图完成定向编辑

融合 2-3 张参考图
Grok Imagine Image 2.0 API 适合哪些图像工作流
生成营销视觉
用输入图编辑
用 n 批量出图
按档位控制成本
图像 API 能力定位与模型选择
| 特性 | Grok Imagine Image 2.0 | Seedream 5.0 Pro | GPT Image |
|---|---|---|---|
| 起价 | 约 $0.030 / 张 | 约 $0.034 / 张起 | 按 token 或档位 |
| 输出档位 | Low/Medium × 1K/2K | 1K / 2K | 质量档位 |
| 参考图输入 | 最多 3 张 | 最多 10 张 | 支持 |
| 单次出图数 | 1-10 张 | 1 张 | 因模型而异 |
| 适合场景 | 快速迭代、批量创意、参考图编辑 | 广告、商品创意、图像编辑 | OpenAI 图像工作流 |
模型 ID、参考图与输出限制
官方模型 ID,两种图像模式
模型 ID 为 grok-imagine-image-2.0。只发提示词就是文生图;加 1-3 张输入图即切换到图像编辑模式,不需要另一个编辑模型 ID。
质量与分辨率相互独立
quality(low/medium)控制生成强度与速度;resolution(1k/2k)控制输出像素。二者独立且都进价格矩阵,四个组合分别按基准价 1×/1.5×/1.5×/2× 计价。
输入图费只收一次
每张输入图每次请求加收基准价的 0.25×,与 n 无关。任务失败不扣费。
为什么通过 EvoLink 统一 API 接入 Grok Imagine Image 2.0
生成前查看实时成本
提交任务前,可根据分辨率、质量、输出数量和参考图查看当前价格与预计积分。
统一 API
一个 API Key 通用于 Grok、Seedream、Nano Banana、GPT Image、视频、音频和大语言模型。
统一余额
在同一个控制台跟踪积分、消费和模型用量。
任务状态追踪
随时查看图像任务处于已提交、处理中、已完成还是失败状态。
结果稳定托管
生成结果转存至 EvoLink CDN,上游临时链接过期后仍可访问。
Grok 模型家族



EvoLink 上的其他图像模型




常见问题
Grok Imagine Image 2.0 API 的官方模型 ID 是什么?
官方模型 ID 是 grok-imagine-image-2.0。文生图和 1-3 张参考图编辑使用同一个 ID,无需切换到单独的编辑模型。
Grok Imagine Image 2.0 怎么收费?
按分辨率 × 质量矩阵计价:1K Low 为基准价,1K Medium 和 2K Low 为 1.5 倍,2K Medium 为 2 倍。输出费按 n 倍计,每张输入图每次请求加收基准价的 0.25 倍。
接入 API 前能先试用吗?
可以。用 Playground 测试出图质量、估算积分,并在接入产品前查看请求 JSON。
quality 和 resolution 有什么区别?
quality(low/medium)控制生成强度——low 约 10 秒,medium 10-75 秒但细节更好;resolution(1k/2k)控制输出像素。二者是独立参数,都影响价格。
怎么用它做图像编辑?
在 image_urls 里传 1-3 个图片 URL 并附上提示词,模型会自动切换到编辑模式。多张图时在提示词中用 <IMAGE_0>、<IMAGE_1>、<IMAGE_2> 指代各图。
能用 n 一次生成多张图吗?
可以。单次请求 n 可取 1-10,输出费按 n 倍计,输入图费每次请求只收一次。
输入图收费吗?
收。image_urls 中每张输入图加收基准价的 0.25 倍,每次请求只收一次、与 n 无关。仅接受公网 http(s) URL,不支持 base64 上传。
能自定义像素尺寸吗?
不能。size 只接受 13 种比例预设加 auto,不支持自定义宽 × 高;分辨率由独立的 1k/2k 参数控制。
生成失败会怎样?
失败不扣费——预扣金额全额退还,包括上游拒绝、内容审核拦截和超时。
充值后去哪里继续?
回到 Playground 继续测试,或创建 API Key,用 model 为 grok-imagine-image-2.0 调用 /v1/images/generations。
API Reference
Select endpoint
Authentication
All APIs require Bearer Token authentication.
Authorization:
Bearer YOUR_API_KEY/v1/images/generationsGenerate Image
Grok Imagine Image 2.0 is xAI's image generation and editing model — text-to-image and image editing share the same model name. Omit image_urls for text-to-image; pass 1-3 reference images and it automatically switches to image editing, no model change needed.
Asynchronous processing mode, use the returned task ID to .
Generated image links are valid for 24 hours, please save them promptly.
Request Parameters
modelstringRequiredDefault: grok-imagine-image-2.0Image generation model name. Text-to-image and image editing share this model name; the mode switches automatically depending on whether image_urls is provided.
| Value | Description |
|---|---|
| grok-imagine-image-2.0 | Grok Imagine Image 2.0 model |
grok-imagine-image-2.0promptstringRequiredPrompt describing the image you want to generate, or how to edit the reference images you provide.
Notes
- Multi-image reference syntax: use <IMAGE_0>, <IMAGE_1>, <IMAGE_2> in the prompt to refer to the 1st, 2nd and 3rd reference image respectively
- Indexes start at 0 and map one-to-one to the order of the image_urls array
- Example: Place the person from <IMAGE_0> into the scene of <IMAGE_1>
Cyberpunk Tokyo street at night, neon lights reflecting on the wet pavementimage_urlsarrayOptionalReference image URL list for image-to-image and image editing functions.
Notes
- Number of input images per request: 0~3 (omitted = text-to-image, 1~3 = image editing)
- Only publicly accessible http / https image URLs are supported; base64 and data URLs are not supported
- Supported file formats: .jpeg, .jpg, .png, .webp
- Image URLs must be directly accessible by the server, or directly download when accessed (typically ending with image file extensions such as .png, .jpg)
- In image editing scenarios the reference images incur an additional charge, counted once per request and not multiplied by n
["https://example.com/person.png", "https://example.com/scene.png"]sizestringOptionalDefault: autoAspect ratio of the generated image, defaults to auto.
| Value | Description |
|---|---|
| auto | The model decides the ratio itself; omitting this parameter is equivalent to auto (output is usually portrait) |
| 1:1 | Square |
| 4:3 / 3:4 | Classic landscape / portrait |
| 3:2 / 2:3 | Standard landscape / portrait |
| 16:9 / 9:16 | Widescreen / mobile portrait |
| 2:1 / 1:2 | Ultra-wide / ultra-tall |
| 19.5:9 / 9:19.5 | Full-screen phone landscape / portrait |
| 20:9 / 9:20 | Ultra-wide landscape / portrait |
Notes
- Values outside the 13 supported ratios are not supported; custom WIDTHxHEIGHT pixel sizes are not accepted
16:9resolutionstringOptionalDefault: 1KPixel tier of the output image, defaults to 1K; supports the 1K and 2K tiers.
| Value | Description |
|---|---|
| 1K | Standard resolution (default) |
| 2K | Higher resolution |
Notes
- This model does not support 4K
- Values are case-insensitive
1KqualitystringOptionalDefault: mediumGeneration quality tier, controls how deeply the model thinks, defaults to medium.
| Value | Description |
|---|---|
| low | Faster output, lower cost |
| medium | Better image quality and detail |
Notes
- This model only supports the low / medium tiers; other values such as high are not supported
- quality (quality tier) and resolution (pixel tier) are independent and can be combined freely
- Values are case-insensitive
mediumnintegerOptionalDefault: 1Number of images to generate, range 1~10, defaults to 1.
| Value | Description |
|---|---|
| 1-10 | Any integer between 1 and 10 |
Notes
- Each image is billed independently, cost grows linearly with n
- The additional charge for reference images is counted once per request and is not multiplied by n
- When the task completes, results returns n independent image links
1callback_urlstringOptionalHTTPS callback address after task completion.
Notes
- Triggered when task is completed, failed, or cancelled; sent after billing confirmation
- HTTPS only; callbacks to internal IP addresses are prohibited; max length 2048 chars
- Timeout: 10s, max 3 retries on failure (after 1s / 2s / 4s)
- Callback body format is consistent with the task query API response; a 2xx response is considered successful, other status codes trigger a retry
https://your-domain.com/webhooks/image-task-completed