API / disable-audio-on-imagine-video

API

Disable audio on Imagine video generation

Disable audio on Imagine video generation

Imagine videos ship with an audio track by default. Set generate_audio to false on POST https://api.x.ai/v1/videos/generations when you need a silent plate (for example before you lay your own score, or when you will dub later). Works on text-to-video and the other generation modes that share this endpoint. Use your regular XAI_API_KEY.

Silent text-to-video

REQUEST_ID=$(curl -s -X POST https://api.x.ai/v1/videos/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
    "model": "grok-imagine-video-1.5",
    "prompt": "A paper boat drifting down a rain-soaked street",
    "generate_audio": false,
    "duration": 8,
    "aspect_ratio": "16:9",
    "resolution": "720p"
  }' | jq -r '.request_id')

while true; do
  RESULT=$(curl -s "https://api.x.ai/v1/videos/$REQUEST_ID" \
    -H "Authorization: Bearer $XAI_API_KEY")
  STATUS=$(echo "$RESULT" | jq -r '.status')
  if [ "$STATUS" = "done" ]; then
    echo "$RESULT" | jq -r '.video.url'
    break
  elif [ "$STATUS" = "failed" ] || [ "$STATUS" = "expired" ]; then
    echo "Request $STATUS"; echo "$RESULT" | jq .
    break
  fi
  sleep 5
done
import os
from xai_sdk import Client

client = Client(api_key=os.getenv("XAI_API_KEY"))
response = client.video.generate(
    prompt="A paper boat drifting down a rain-soaked street",
    model="grok-imagine-video-1.5",
    generate_audio=False,
    duration=8,
    aspect_ratio="16:9",
    resolution="720p",
)
print(response.url)

When you still want voice

Preset dialogue uses reference_audios with voice_id on grok-imagine-video-1.5 (see Add spoken dialogue with reference audios). Leave generate_audio at its default (or omit it) so the clip can carry that track. generate_audio: false turns the whole soundtrack off.

Pitfalls

  • Download the returned URL promptly; Imagine video URLs expire.
  • 1080p is for text-to-video and image-to-video on grok-imagine-video-1.5. Reference-to-video stays capped at 720p.
  • Console API credits are a separate bill from SuperGrok's weekly pool on grok.com.