一個驗證,對應所有 provider
一組 RunAPI key 即可解鎖整個 catalog。無需分開帳戶,亦無需為每個整合輪換密鑰。
透過 RunAPI 使用 Grok Imagine API,包含 model skill、統一驗證與按用量計費。
curl -X POST https://runapi.ai/api/v1/grok_imagine/edit_image \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-edit-image",
"source_image_url": "https://cdn.runapi.ai/public/samples/image.jpg",
"prompt": "生成一段短片:一隻機械手將棋子放在棋盤上,戲劇性燈光,慢動作。"
}'
import { GrokImagineClient } from "@runapi.ai/grok-imagine";
const client = new GrokImagineClient();
const result = await client.editImage.run({
model: "grok-imagine-edit-image",
source_image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
prompt: "生成一段短片:一隻機械手將棋子放在棋盤上,戲劇性燈光,慢動作。",
});
<?php
require __DIR__ . "/vendor/autoload.php";
use RunApi\GrokImagine\GrokImagineClient;
$client = new GrokImagineClient();
$result = $client->editImage->run([
'model' => 'grok-imagine-edit-image',
'source_image_url' => 'https://cdn.runapi.ai/public/samples/image.jpg',
'prompt' => '生成一段短片:一隻機械手將棋子放在棋盤上,戲劇性燈光,慢動作。',
]);
require "runapi/grok_imagine"
client = RunApi::GrokImagine::Client.new
result = client.edit_image.run(
model: "grok-imagine-edit-image",
source_image_url: "https://cdn.runapi.ai/public/samples/image.jpg",
prompt: "生成一段短片:一隻機械手將棋子放在棋盤上,戲劇性燈光,慢動作。"
)
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
Grok Imagine 是 xAI 的圖片及影片生成套件,涵蓋文字生成圖片、圖片生成圖片、文字生成影片及圖片生成影片,並結合 xAI Grok 的理解能力,解讀複雜細緻的提示詞。
| Endpoint | 解析度 | 時長 | 價格 | |
|---|---|---|---|---|
| edit_image | — | — | $0.04 / 張圖片 |
以下為 grok-imagine-edit-image 的定價。其他變體保留各自的 endpoint 定價。
此模型系列的共用 endpoints,例如延伸、增強或轉換操作。
挑選符合輸出類型、品質門檻與延遲目標的模型與變體。
設定 RunAPI key,並在 coding workspace 安裝 model skill。
使用 skill 指引,在你的 app 內加入模型功能。
透過 task ID 查詢、在支援時串流,或處理 webhook callback。
一組 RunAPI key 即可解鎖整個 catalog。無需分開帳戶,亦無需為每個整合輪換密鑰。
按次以 USD 收費,每月結算。失敗的生成不會收費。
型別化 schema 與 setup 備註打包在 model skill 內,讓實作從正確契約開始。
文字生成圖片、圖片生成圖片、文字生成影片及圖片生成影片——涵蓋靜態圖片、提示詞引導的圖片編輯及動態生成。
會——文字生成影片會產生同步的原生音訊,包括對嘴的對白。
edit_image 端點處理圖片生成圖片任務——grok-imagine-edit-image 接受一張來源圖片,grok-imagine-image-2-0 最多接受五張,用於提示詞引導的風格轉換及構圖編輯。
寫實、藝術及動漫風格,支援 5 種畫面比例。風格透過 prompt 控制。
文字生成影片及圖片生成影片端點方面,基本模型每次生成 6 至 30 秒,Video 1.5 Fast 為 1 至 30 秒,Video 1.5 Preview 為 1 至 15 秒。
先選最平而且符合你質素要求的版本。大多數團隊會先用快速版本,之後再升級到 pro 用於正式生產。