柔軟なパラメータ
aspect_ratio, enable_pro, enable_safety_checker, image_url, mask_indices を含む 9 個のドキュメント済みパラメータを設定できます。
curl -X POST https://runapi.ai/api/v1/grok_imagine/segment_map \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image-2-0",
"prompt": "チェスの駒をチェス盤に置くロボットの手の短い動画を生成してください。ドラマチックなライティング、スロー再生で。"
}'
import { GrokImagineClient } from "@runapi.ai/grok-imagine";
const client = new GrokImagineClient();
const result = await client.segmentMap.run({
model: "grok-imagine-image-2-0",
prompt: "チェスの駒をチェス盤に置くロボットの手の短い動画を生成してください。ドラマチックなライティング、スロー再生で。",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/grok_imagine/segment_map",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"grok-imagine-image-2-0","prompt":"チェスの駒をチェス盤に置くロボットの手の短い動画を生成してください。ドラマチックなライティング、スロー再生で。"}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/grok_imagine/segment_map");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'grok-imagine-image-2-0',
'prompt' => 'チェスの駒をチェス盤に置くロボットの手の短い動画を生成してください。ドラマチックなライティング、スロー再生で。',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.segmentMap().run({"model":"grok-imagine-image-2-0","prompt":"チェスの駒をチェス盤に置くロボットの手の短い動画を生成してください。ドラマチックなライティング、スロー再生で。"});
task.waitForResult();
require "runapi/grok_imagine"
client = RunApi::GrokImagine::Client.new
result = client.segment_map.run(
model: "grok-imagine-image-2-0",
prompt: "チェスの駒をチェス盤に置くロボットの手の短い動画を生成してください。ドラマチックなライティング、スロー再生で。"
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.segmentMap.Run({"model":"grok-imagine-image-2-0","prompt":"チェスの駒をチェス盤に置くロボットの手の短い動画を生成してください。ドラマチックなライティング、スロー再生で。"})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model grok-imagine-image-2-0 \
--endpoint segment_map \
--wait
7 個のバージョンを利用可能
モデルを選んで、数秒で生成できます。
| プロバイダー | xAI |
| モデル ID | grok-imagine-image-2-0 |
| モダリティ | 画像 |
| タスク種別 | Asynchronous |
| API エンドポイント | /api/v1/grok_imagine/edit_image, /api/v1/grok_imagine/segment_map, /api/v1/grok_imagine/text_to_image |
| 請求単位 | 回 |
| 入力パラメータ | aspect_ratio, callback_url, enable_pro, enable_safety_checker, image_url, mask_indices, model, prompt, source_image_url, source_image_urls, source_task_id |
| アスペクト比 | 1:1, 2:3, 3:2, 16:9, 9:16, auto |
| カタログ状態 | 稼働中 |
無料で登録し、ダッシュボードから grok-imagine-image-2-0 用の API キーを作成します。
/api/v1/grok_imagine/segment_map に grok-imagine-image-2-0 のモデル ID とパラメータを指定して POST リクエストを送信します。
タスクをポーリングするかコールバックに従って、完了した grok-imagine-image-2-0 の結果を取得します。
aspect_ratio, enable_pro, enable_safety_checker, image_url, mask_indices を含む 9 個のドキュメント済みパラメータを設定できます。
3 個の公開 endpoint を提供しています: edit_image, segment_map, text_to_image。
非同期タスクはコールバック URL を受け付け、完了通知を送信します。
回 に基づいて計量課金されます。サブスクリプション不要。
image_urlPublic image URL that the service can fetch.
callback_urlWebhook URL for terminal Task delivery.
source_task_idCompleted Image 2.0 text-to-image Task ID owned by the same account. Compatibility input; use image_url instead.
テキスト prompt からビジュアルアセットを作成します。
prompt に沿って既存画像を変換します。
SDK で再現可能な生成を行います。
このモデルの確認済み顧客フィードバックはまだありません。
quickstart に表示されるモデル ID を渡してください。
はい。呼び出しまたは単位ごとの従量課金です。
はい。variant はリクエストのパラメーターです。model ID を変更するだけで切り替えられ、コード変更、再認証、別の請求設定は不要です。全 variant が同じ API key とリクエスト形式を共有します。
streaming が利用可能な場合、RunAPI はエンドツーエンドで配信します。LLM モデルは token 単位の streaming に対応し、メディアモデルは非同期タスクの polling または webhook callback で結果を届けます。
公開 GitHub repo に issue を作成するか、[email protected] にメールしてください。該当する生成を調査できるよう task ID と model ID を添えてください。
いいえ。RunAPI API key だけでこの variant とカタログ内の全モデルを利用できます。提供元のアカウントは不要です。