Video · xAI

Grok Imagine API

Grok Imagine API access for image and video generation from text, including text-to-image, image-to-image, text-to-video, and image-to-video.

جاهز للتشغيل · 6 variants · ابتداءً من $0.020
runapi.ai
curl -X POST https://runapi.ai/api/v1/grok_imagine/edit_image \
  -H "Authorization: Bearer $RUNAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-imagine-video-1.5-fast",
  "image_url": "https://cdn.runapi.ai/public/samples/image.jpg",
  "prompt": "Generate a short video of a robot hand placing a chess piece on a board, dramatic lighting, slow motion."
}'
import { GrokImagineClient } from "@runapi.ai/grok-imagine";

const client = new GrokImagineClient();
const result = await client.editImage.run({
    model: "grok-imagine-video-1.5-fast",
    image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
    prompt: "Generate a short video of a robot hand placing a chess piece on a board, dramatic lighting, slow motion.",
});
<?php

require __DIR__ . "/vendor/autoload.php";

use RunApi\GrokImagine\GrokImagineClient;

$client = new GrokImagineClient();
$result = $client->editImage->run([
        'model' => 'grok-imagine-video-1.5-fast',
        'image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
        'prompt' => 'Generate a short video of a robot hand placing a chess piece on a board, dramatic lighting, slow motion.',
]);
require "runapi/grok_imagine"

client = RunApi::GrokImagine::Client.new
result = client.edit_image.run(
    model: "grok-imagine-video-1.5-fast",
    image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
    prompt: "Generate a short video of a robot hand placing a chess piece on a board, dramatic lighting, slow motion."
)
npx skills add runapi-ai/grok-imagine -g
# Claude Code
claude mcp add runapi -s user -- npx -y @runapi.ai/mcp

# Codex
codex plugin install runapi-mcp@agents

# Cursor / Windsurf / VS Code
npx @runapi.ai/mcp init cursor
@runapi.ai/grok-imagine v1
OVERVIEW

Grok Imagine is xAI's image and video generation suite covering text-to-image, edit-image, text-to-video, and image-to-video. It integrates with xAI's Grok intelligence to interpret complex, nuanced prompts.

  • عدة إصدارات لمستويات مختلفة من السرعة / الجودة
  • يتضمن model skill التوثيق والـschemas وملاحظات الإعداد
  • يعمل مع workflows موجهة لتطوير التطبيقات
  • لا يتم احتساب رسوم على عمليات التوليد الفاشلة
VARIANTS

قارن جميع إصدارات API

Variant Billing From
grok-imagine-edit-image call $0.040 عرض →
grok-imagine-image-to-video second $0.020 عرض →
grok-imagine-text-to-image call $0.040 عرض →
grok-imagine-text-to-video second $0.020 عرض →
grok-imagine-video-1.5-fast call $0.750 عرض →
grok-imagine-video-1.5-preview second $0.020 عرض →
PRICING

Utility endpoints

Shared endpoints for this model line, such as extension, enhancement, or conversion actions.

Extend video
$0.10-$0.30 / video
Extension length: 6s · Output resolution: 480p $0.10
Extension length: 6s · Output resolution: 720p $0.20
Extension length: 10s · Output resolution: 480p $0.20
Extension length: 10s · Output resolution: 720p $0.30
Upscale image
$0.10 / request
SKILLS

ثبّت skill Grok Imagine لتطوير التطبيقات

حمّل توثيق النموذج والـschemas وملاحظات الأسعار وخطوات الإعداد إلى مساحة عمل الكود.

# Install the model skill for app development workflows
npx skills add runapi-ai/grok-imagine -g
Installs docs, schemas, pricing context, and setup notes into your developer workspace.
Or use this setup request in your coding tool:
Install the Grok Imagine skill for this app:

1. Add runapi-ai/grok-imagine with the skills installer.
2. Load SKILL.md in this workspace.
3. Use its docs, schemas, pricing notes, and setup steps when adding model features.
4. Confirm the install path when done.
كيف يعمل

من model skill إلى أول نتيجة في أربع خطوات

01

اختر النموذج

اختر النموذج والإصدار المناسبين لنوع المخرجات ومستوى الجودة وزمن الاستجابة المستهدف.

02

الإعداد

اضبط مفتاح RunAPI وثبّت model skill في مساحة عمل الكود.

03

التنفيذ

استخدم تعليمات المهارة لإضافة ميزة النموذج داخل تطبيقك.

04

الاستلام

استعلم عبر task ID أو استخدم البث عند دعمه أو عالج webhook callback.

CONTEXT

ما هي Grok Imagine API؟

Grok Imagine is xAI's creative AI suite built on Grok, covering image and video generation. Through RunAPI, all Grok Imagine endpoints share a single API key.

Provider
xAI
Modality
Video
لماذا RunAPI

لماذا تستخدم Grok Imagine API عبر RunAPI

مصادقة واحدة لكل مزود

مفتاح RunAPI واحد يفتح الوصول إلى الكتالوج بالكامل. لا حسابات منفصلة، ولا تدوير مفاتيح لكل تكامل.

تسعير وفوترة موحّدان

تسعير لكل استدعاء بالدولار الأمريكي، ويُفوتر شهريًا. لا تُحتسب التوليدات الفاشلة.

Skill مع schemas

تأتي الـschemas المعرّفة وملاحظات الإعداد داخل model skill حتى يبدأ التنفيذ من العقد الصحيح.

FAQ

أسئلة شائعة

What creative modes does Grok Imagine support?

Text-to-image, edit-image, text-to-video, and image-to-video — covering still images, prompt-guided image edits, and motion generation.

Does Grok Imagine generate audio with video?

Yes — text-to-video generates synchronized native audio including dialogue with lip-sync.

How many reference images can I provide?

The edit-image endpoint accepts one source image for prompt-guided style transfer and composition editing.

What image styles are available?

Realistic, artistic, and anime styles across 5 aspect ratios. Style is controlled via the prompt and style parameter.

How long are generated videos?

6 to 15 seconds per generation (up to 30 seconds on the fast variant) for both text-to-video and image-to-video endpoints.

أي نسخة ينبغي أن أبدأ بها؟

اختر أرخص نسخة تفي بمعيار الجودة لديك. يبدأ معظم الفرق بالنسخة السريعة ثم ينتقلون إلى pro للإنتاج.

هل توجد خطة مجانية؟

تحصل الحسابات الجديدة على أول طلبات مجانية على كل نموذج. بعد ذلك، الدفع حسب كل طلب.

هل تدعمون البث المباشر للنتائج؟

حيث يتوفر البث المباشر، يوفّر RunAPI البث من البداية إلى النهاية.

كيف يتم احتساب الرسوم عند الفشل؟

لا يتم تحصيل رسوم على عمليات التوليد الفاشلة.

هل يتم تخزين المخرجات مؤقتًا؟

يتم حفظ المخرجات المولدة ويمكن استرجاعها بواسطة task ID. لا يتم تخزين المدخلات مؤقتًا.

هل يمكنني الاستخدام تجاريًا؟

نعم — يشمل كل إصدار الاستخدام التجاري ما لم يقيّده ترخيص النموذج صراحةً، ويُشار إلى ذلك في صفحة الإصدار.

ماذا عن حدود المعدل؟

تتدرج حدود المعدل لكل مفتاح وفق فئة الاستخدام. راجع صفحة الأسعار للاطلاع على الحدود الحالية.

أين يمكنني الإبلاغ عن المشاكل؟

افتح issue في مستودع GitHub العام أو راسل الدعم عبر البريد الإلكتروني.

ابدأ الآن

ابدأ البناء باستخدام Grok Imagine API.