# model には "grok-imagine-1.5-video-apimart" を指定でき、エイリアス "grok-imagine-1.5-video-ext" にも対応しています
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-1.5-video-apimart",
"prompt": "ビーチを走る犬、晴天、スローモーション",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "grok-imagine-1.5-video-apimart",
"prompt": "ビーチを走る犬、晴天、スローモーション",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "grok-imagine-1.5-video-apimart",
prompt: "ビーチを走る犬、晴天、スローモーション",
size: "16:9",
duration: 6,
resolution: "720p"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
"status": "submitted"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました。APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高が不足しています。チャージしてから再度お試しください",
"type": "payment_required"
}
}
{
"error": {
"code": 403,
"message": "アクセスが禁止されています。このリソースへのアクセス権限がありません",
"type": "permission_error"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます。しばらくしてから再度お試しください",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "サーバー内部エラー、しばらくしてから再度お試しください",
"type": "server_error"
}
}
{
"error": {
"code": 502,
"message": "ゲートウェイエラー、サーバーが一時的に利用できません",
"type": "bad_gateway"
}
}
Grok Imagine 1.5
Grok Imagine 1.5 動画生成
- 非同期処理モード、タスクIDを返して後続のクエリに使用
- 高品質AI動画生成、テキストから動画・画像から動画に対応
- 柔軟なアスペクト比と画質オプション
POST
/
v1
/
videos
/
generations
# model には "grok-imagine-1.5-video-apimart" を指定でき、エイリアス "grok-imagine-1.5-video-ext" にも対応しています
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-1.5-video-apimart",
"prompt": "ビーチを走る犬、晴天、スローモーション",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "grok-imagine-1.5-video-apimart",
"prompt": "ビーチを走る犬、晴天、スローモーション",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "grok-imagine-1.5-video-apimart",
prompt: "ビーチを走る犬、晴天、スローモーション",
size: "16:9",
duration: 6,
resolution: "720p"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
"status": "submitted"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました。APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高が不足しています。チャージしてから再度お試しください",
"type": "payment_required"
}
}
{
"error": {
"code": 403,
"message": "アクセスが禁止されています。このリソースへのアクセス権限がありません",
"type": "permission_error"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます。しばらくしてから再度お試しください",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "サーバー内部エラー、しばらくしてから再度お試しください",
"type": "server_error"
}
}
{
"error": {
"code": 502,
"message": "ゲートウェイエラー、サーバーが一時的に利用できません",
"type": "bad_gateway"
}
}
モデル名互換のお知らせ:本エンドポイントはエイリアス
grok-imagine-1.5-video-ext にも対応しており、grok-imagine-1.5-video-apimart と同等です。両者は互換的に使用でき、効果は同一です。# model には "grok-imagine-1.5-video-apimart" を指定でき、エイリアス "grok-imagine-1.5-video-ext" にも対応しています
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "grok-imagine-1.5-video-apimart",
"prompt": "ビーチを走る犬、晴天、スローモーション",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "grok-imagine-1.5-video-apimart",
"prompt": "ビーチを走る犬、晴天、スローモーション",
"size": "16:9",
"duration": 6,
"resolution": "720p"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "grok-imagine-1.5-video-apimart",
prompt: "ビーチを走る犬、晴天、スローモーション",
size: "16:9",
duration: 6,
resolution: "720p"
};
const headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
"code": 200,
"data": [
{
"task_id": "task_01JNXXXXXXXXXXXXXXXXXX",
"status": "submitted"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました。APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高が不足しています。チャージしてから再度お試しください",
"type": "payment_required"
}
}
{
"error": {
"code": 403,
"message": "アクセスが禁止されています。このリソースへのアクセス権限がありません",
"type": "permission_error"
}
}
{
"error": {
"code": 429,
"message": "リクエストが多すぎます。しばらくしてから再度お試しください",
"type": "rate_limit_error"
}
}
{
"error": {
"code": 500,
"message": "サーバー内部エラー、しばらくしてから再度お試しください",
"type": "server_error"
}
}
{
"error": {
"code": 502,
"message": "ゲートウェイエラー、サーバーが一時的に利用できません",
"type": "bad_gateway"
}
}
認証
string
必須
すべてのAPIはBearer Token認証が必要ですAPIキーの取得:APIキー管理ページにアクセスしてAPIキーを取得してくださいリクエストヘッダーに追加:
Authorization: Bearer YOUR_API_KEY
リクエストパラメータ
string
デフォルト:"grok-imagine-1.5-video-apimart"
必須
動画生成モデル名対応モデル:
grok-imagine-1.5-video-apimart- Grok 動画生成(エイリアスgrok-imagine-1.5-video-extに対応)
"grok-imagine-1.5-video-apimart"旧バージョンの呼び出しとの互換性のため、エイリアス
grok-imagine-1.5-video-ext(grok-imagine-1.5-video-apimart に対応)は引き続き正常に使用できます。string
必須
動画内容の説明、多言語対応
string
デフォルト:"16:9"
動画サイズオプション:
16:9- 横長(デフォルト)9:16- 縦長1:1- 正方形3:2- 横長2:3- 縦長
integer
デフォルト:6
動画の長さ(秒)範囲:6〜15(最短6秒、最長15秒)⚠️ 注意: 純粋な数値を入力してください(例:
6)。引用符を付けるとエラーが発生しますstring
デフォルト:"480p"
動画品質オプション:
480p- 標準画質(デフォルト)720p- 高画質
string[]
参照画像のURLリスト制限:
- 最大 7 枚の画像
- 公開アクセス可能なURLである必要があります
- base64 形式はサポートされていません
参照画像をアップロードすると、アスペクト比は自動的に参照画像のアスペクト比に合わせられます。
Response
integer
レスポンスステータスコード
タスク結果の確認動画生成は非同期タスクです。送信後、
task_id が返されます。タスクステータス取得エンドポイントを使用して、生成の進捗と結果を確認してください。使用シーン
シーン 1:テキストから動画生成
{
"model": "grok-imagine-1.5-video-apimart",
"prompt": "ビーチを走る犬、晴天、スローモーション",
"size": "16:9",
"duration": 6
}
シーン 2:画像から動画生成
{
"model": "grok-imagine-1.5-video-apimart",
"prompt": "シーンに自然なダイナミック効果を追加する",
"image_urls": ["https://example.com/start.png"],
"size": "16:9",
"duration": 10,
"resolution": "720p"
}
⌘I