grok-imagine-image-2.0 API
Generate and edit images with xAI’s grok-imagine-image-2.0 on APISea.
grok-imagine-image-2.0تسعير API لنموذج grok-imagine-image-2.0
جميع الأسعار بالدولار الأمريكي (USD). مقارنة أسعار APISea بالسعر الرسمي المعلن للوحدة نفسها.
| الخيار | APISea | رسمي | وفّر |
|---|---|---|---|
| 1K · low | $0.0352 | $0.04 | −12% |
| 1K · mediumافتراضي | $0.0528 | $0.06 | −12% |
| 2K · low | $0.0528 | $0.06 | −12% |
| 2K · medium | $0.0704 | $0.08 | −12% |
الأسعار لكل صورة.
مواد الإدخال
| الخيار | الوحدة | APISea | رسمي |
|---|---|---|---|
| Default | لكل صورة | $0.0088 | $0.01 |
ما هو grok-imagine-image-2.0؟
grok-imagine-image-2.0 is xAI’s Grok Imagine model for asynchronous image generation and editing on APISea. Use a text prompt to generate images, or include one to three reference images for editing and multi-image reference workflows. Each request supports one to ten outputs, 1K or 2K resolution, and aspect ratios ranging from square to portrait and landscape formats. Text-to-image requests also offer low or medium quality, with medium as the default.
Call the model through APISea’s image generation endpoint using your API key. Submission returns a task ID rather than a finished image; poll for completion to retrieve the result. APISea uses pay-as-you-go pricing and bills only for successful requests. Output pricing starts at $0.0352 per image for APISea 1K · low, and reference image input costs $0.0088 per image. The default configuration is about 12% below the provider list price.
أبرز مزايا grok-imagine-image-2.0
Generation and editing
Generate from text alone, or supply one to three reference images for editing and multi-image reference requests.
Resolution and quality controls
Choose 1K or 2K output resolution. Text-to-image requests support low or medium quality; omit quality when using reference images.
Flexible output formats
Request one to ten images and select from supported square, portrait, landscape, and elongated aspect ratios, or use auto.
Asynchronous task tracking
A successful submission returns HTTP 202 with a task ID. Poll the task status until it becomes completed or failed.
كيفية استدعاء API الخاص بـ grok-imagine-image-2.0 في 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-image-2.0" والمعلمات أدناه.
- 04
تعامل مع الاستجابة
تتضمن الاستجابة task_id. أرسل طلبات GET /v1/tasks/{task_id} دوريًا حتى تصبح الحالة completed، ثم نزّل روابط النتائج.
أمثلة على الطلبات
الوثائق: Grok Imagine Image 2.0 Official Generation and Editingcurl --request POST \
--url https://api.apisea.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-APISea-Response-Version: 2026-07-27' \
--data '{
"model": "grok-imagine-image-2.0",
"prompt": "A cinematic neon-lit city street in the rain",
"n": 1,
"aspect_ratio": "16:9",
"resolution": "2k",
"quality": "medium"
}'المعلمات
| المعلمة | النوع | مطلوب | افتراضي | الوصف |
|---|---|---|---|---|
model | string | مطلوب | grok-imagine-image-2.0 | Must be `grok-imagine-image-2.0`. |
nsfw_check | boolean | اختياري | false | Whether to run content moderation before submitting the image task. |
prompt | string | مطلوب | — | Image generation or editing instructions. Must be non-empty after trimming and no longer than 8,000 characters. |
n | integer | اختياري | 1 | Number of output images, from `1` to `10`. |
aspect_ratio | string | اختياري | auto | Supported values: `1:1`, `3:4`, `4:3`, `9:16`, `16:9`, `2:3`, `3:2`, `9:19.5`, `19.5:9`, `9:20`, `20:9`, `1:2`, `2:1`, and `auto`. |
resolution | string | اختياري | 1k | |
quality | string | اختياري | — | Text-to-image only: `low` or `medium` (default). Do not send this field when `image_urls` is present. |
image_urls | array | اختياري | — | One to three reference images. Only publicly accessible absolute HTTP(S) URLs are accepted. Upload local images with `POST /v1/uploads/images`, then use the returned `url`. Omit the field when there is no reference image. |
ما الذي يمكنك إنشاؤه باستخدام grok-imagine-image-2.0
Creative variation tools
Build a prompt-based workspace that requests multiple image options in one task for team review.
Reference-based editing
Let users submit publicly accessible image URLs alongside instructions to request edits.
Multi-image creative workflows
Accept up to three reference images with a prompt for workflows that need multiple visual inputs.
Format-specific asset creation
Generate square, portrait, or landscape images for different placement requirements using explicit aspect ratio controls.
نصائح للحصول على نتائج أفضل
- 01
Separate generation from editing
Omit image_urls for text-to-image requests. Include one to three reference URLs for editing, and do not send quality with those requests.
- 02
Choose output costs deliberately
APISea 1K · low costs $0.0352 per image, while APISea 2K · medium costs $0.0704 per image. Set n deliberately because it controls the number of output images.
- 03
Poll after submission
Read the task ID from data.id and poll data.poll_url or GET /v1/tasks/{task_id}. Treat HTTP 202 as task acceptance, not a completed result.
- 04
Keep credentials server-side
Submit requests from your backend or BFF. Do not expose a long-lived APISea API key in browser code, public environment variables, URLs, local storage, or client logs.
القيود ومعلومات مهمة
Processing is asynchronous, so submission does not return the final images.
Prompts must be non-empty after trimming and no longer than 8,000 characters.
Reference inputs are limited to three publicly accessible absolute HTTP(S) URLs; quality is text-to-image only.
الأسئلة الشائعة حول API الخاص بـ grok-imagine-image-2.0
How much does grok-imagine-image-2.0 cost on APISea?
APISea 1K · low costs $0.0352 per image; APISea 1K · medium and APISea 2K · low each cost $0.0528 per image; APISea 2K · medium costs $0.0704 per image. Reference image input (Default) costs $0.0088 per image. The default configuration is about 12% below the provider list price.
How do I call grok-imagine-image-2.0?
Send POST https://api.apisea.ai/v1/images/generations with Bearer authorization, model set to grok-imagine-image-2.0, and a non-empty prompt. The response returns a task ID; poll data.poll_url or GET /v1/tasks/{task_id} for the final result.
Does the model support image editing?
Yes. Include image_urls with one to three publicly accessible absolute HTTP(S) URLs and describe the requested edit in prompt. Do not send quality when image_urls is present.
Which resolution and quality settings are supported?
The resolution parameter accepts 1k or 2k and defaults to 1k. For text-to-image only, quality accepts low or medium, with medium as the default.
How many images can I request at once?
Set n from 1 to 10; the default is 1. A request can include up to three reference images, and its prompt cannot exceed 8,000 characters.
Can I use generated images commercially?
Commercial use is subject to the provider's terms. Review xAI’s applicable terms before using outputs in commercial products or campaigns.
نماذج ذات صلة
grok-imagine-1.5-apisea
grok-imagine-1.5-ext
grok-imagine-1.5-edit-apiseagrok-imagine-2.0-ext
grok-imagine-image
grok-imagine-image-quality
qwen-image-2.0
qwen-image-2.0-pro
qwen-image-3.0
ابدأ التطوير باستخدام grok-imagine-image-2.0
مفتاح واحد، وادفع حسب الاستخدام بدءًا من $50؛ ولا تُحتسب الرسوم إلا على الطلبات الناجحة.