grok-imagine-2.0-ext API
Generate images from text or references and edit selected regions with grok-imagine-2.0-ext on APISea.
grok-imagine-2.0-extتسعير API لنموذج grok-imagine-2.0-ext
جميع الأسعار بالدولار الأمريكي (USD). مقارنة أسعار APISea بالسعر الرسمي المعلن للوحدة نفسها.
| الخيار | APISea | رسمي | وفّر |
|---|---|---|---|
| افتراضيافتراضي | $0.0165 | $0.08 | −79% |
| region-edit | $0.0165 | $0.01875 | −12% |
| upload-image | $0 | $0 | — |
الأسعار لكل صورة.
ما هو grok-imagine-2.0-ext؟
grok-imagine-2.0-ext is an xAI Grok Imagine model for text-to-image generation, reference-image generation, and selected-region editing on APISea. Submit a prompt to create 1–12 images, or supply up to five reference image URLs to generate one image per request. Seven aspect ratios support square, portrait, and landscape layouts. Text-to-image requests use quality mode by default; reference-image requests must omit the resolution parameter. Separate segment and region_edit operations let applications retrieve object layers and masks, then edit a selected object, rectangle, or polygon.
Requests run asynchronously through POST /v1/images/generations: save the task ID and poll for completion, or configure a webhook. Completed images are returned as URLs. APISea provides one API key and an OpenAI-compatible base URL, https://api.apisea.ai/v1, with pay-as-you-go billing only for successful requests. Default generation costs $0.0165 per image, about 79% below the provider list price; region-edit costs $0.0165 per image. Image uploads and segmentation are free.
أبرز مزايا grok-imagine-2.0-ext
Text and Reference Inputs
Generate 1–12 images from a text prompt, or use up to five reference image URLs to produce one image per request.
Seven Aspect Ratios
Choose square, portrait, or landscape formats using supported ratio strings such as 1:1, 9:16, and 16:9. Text-to-image generation uses quality mode by default.
Object and Region Editing
Use segment to retrieve object layers, boxes, and precise masks. Use region_edit to modify a polygon, rectangle, or detected object.
Async Delivery Options
Submit an image task and poll with its task ID. An optional public HTTPS webhook base URL receives a callback when the task reaches a terminal status.
كيفية استدعاء API الخاص بـ grok-imagine-2.0-ext في 4 خطوات
- 01
احصل على API key
سجّل الدخول إلى APISea، واشحن رصيدك بدءًا من $50، وأنشئ مفتاح sk-sea من وحدة التحكم.
- 02
اضبط عنوان URL الأساسي
استخدم https://api.apisea.ai/v1 عنوانًا أساسيًا في SDK أو عميل HTTP.
- 03
أرسل الطلب
استدعِ POST /v1/images/generations مع "model": "grok-imagine-2.0-ext" والمعلمات أدناه.
- 04
تعامل مع الاستجابة
تتضمن الاستجابة task_id. أرسل طلبات GET /v1/tasks/{task_id} دوريًا حتى تصبح الحالة completed، ثم نزّل روابط النتائج.
أمثلة على الطلبات
الوثائق: Grok Imagine 2.0 Ext Image Generationcurl --request POST \
--url https://api.apisea.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Idempotency-Key: 8eacb46d-ef4e-4f4e-82de-830bd8bc67e2' \
--header 'X-APISea-Response-Version: 2026-07-27' \
--data '{
"model": "grok-imagine-2.0-ext",
"prompt": "A red apple on a white ceramic plate, clean studio product photo",
"n": 1,
"size": "1:1",
"resolution": "quality",
"response_format": "url"
}'المعلمات
| المعلمة | النوع | مطلوب | افتراضي | الوصف |
|---|---|---|---|---|
model | string | مطلوب | — | Fixed value: `grok-imagine-2.0-ext` |
nsfw_check | boolean | اختياري | false | Whether to run content moderation before submitting the image task. |
prompt | string | مطلوب | — | Prompt. Must be non-empty after trim. Trim before submit. |
image_urls | string[] | اختياري | — | Optional array of reference image URLs, up to **5 images**. For local files, [upload images](/docs/uploads/images) first, then use the returned public HTTP(S) URLs. |
n | integer | اختياري | 1 | For text-to-image, generate `1`–`12` images, default `1`. Explicit `0` returns an error. |
size | string | اختياري | — | Aspect ratio. **Prefer ratio strings** (UI should only show ratios): |
resolution | string | اختياري | — | The quality-mode settings below apply only to text-to-image. **Omit `resolution` when sending reference images.** |
response_format | string | اختياري | url | Only `url` is allowed. May be omitted. `b64_json` / `base64` → `400 invalid_response_format`. |
webhook | string | اختياري | — | Optional public HTTPS **base URL**. On terminal status the platform POSTs `{webhook}/callback`. Server-side only — see [Webhook](#webhook-optional). |
ما الذي يمكنك إنشاؤه باستخدام grok-imagine-2.0-ext
Creative Variant Generators
Build a tool that submits a text prompt and returns up to 12 image candidates for a team to review.
Reference-Based Design Tools
Let users select up to five reference images, then generate a single image from those references and a prompt.
Targeted Image Editors
Retrieve detected objects and masks, then let users select an object or draw a box or polygon for a prompted edit.
Multi-Format Asset Workflows
Offer supported aspect ratios for product images, posters, banners, and short-video covers without exposing unsupported size choices.
نصائح للحصول على نتائج أفضل
- 01
Validate Inputs Before Submit
Trim the prompt and reject empty input. Prefer supported ratio strings for size; values such as auto and 4:5 return an invalid_size error.
- 02
Keep Reference Requests Simple
Pass image_urls as an array, preserving selection order. With references, omit resolution and either omit n or set it to 1; upload local files first.
- 03
Retry With Idempotency
Use a new Idempotency-Key UUID for each user-confirmed generation. Network retries must reuse the same key and request body.
- 04
Save Results Securely
Keep the APISea key on your server and poll for task completion or use a webhook. Download completed images before their URLs expire in 72 hours.
القيود ومعلومات مهمة
Requests are asynchronous; the submit response does not contain final images or layers.
Output is URL-only, expires in 72 hours, and does not support streaming or base64 responses.
Reference requests accept at most five images and generate exactly one image per request.
الأسئلة الشائعة حول API الخاص بـ grok-imagine-2.0-ext
How much does grok-imagine-2.0-ext cost on APISea?
Default generation costs $0.0165 per image, versus the provider list price of $0.08—about 79% below list. Region-edit costs $0.0165 per image, image uploads cost $0 per image, and segmentation is free. APISea bills only successful requests.
How do I call grok-imagine-2.0-ext through the API?
Send a server-side POST to https://api.apisea.ai/v1/images/generations with a Bearer APISea key, model set to grok-imagine-2.0-ext, and a non-empty prompt. Save the returned task ID and poll for completion, or configure a webhook.
Can I generate images using reference images?
Yes. Supply up to five public HTTP(S) URLs in image_urls, in selection order; upload local files first. Reference requests generate one image, so omit resolution and omit n or set it to 1.
Which size and quality parameters are supported?
Supported ratios are 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, and 16:9. For text-to-image, omit resolution to use default quality mode or pass resolution: "quality"; actual output pixels may differ from the documented pixel aliases.
Does the model support editing parts of an image?
Yes. The segment operation retrieves objects, layers, boxes, and precise masks, while region_edit edits a selected polygon, rectangle, or detected object. Both operations use the asynchronous image endpoint.
Can I use generated images commercially?
Commercial use is subject to the provider's terms. Review xAI's applicable terms and any rights associated with your prompts and reference images before using outputs commercially.
نماذج ذات صلة
grok-imagine-1.5-apisea
grok-imagine-1.5-ext
grok-imagine-1.5-edit-apiseagrok-imagine-image
grok-imagine-image-2.0
grok-imagine-image-quality
qwen-image-2.0
qwen-image-2.0-pro
qwen-image-3.0
ابدأ التطوير باستخدام grok-imagine-2.0-ext
مفتاح واحد، وادفع حسب الاستخدام بدءًا من $50؛ ولا تُحتسب الرسوم إلا على الطلبات الناجحة.