Grok Video
Grok Video
xAI Grok video model with normal/fun/spicy styles
- Endpoint
- POST /api/v1/videos/generate
- model
- grok-video
- Output
- Video
- Credits
- from 30
1
Enviar uma tarefa
POST
/api/v1/videos/generateParâmetros
modelstringObrigatórioMust be "grok-video"
typestringOpcionalPadrãotext-to-video"text-to-video" or "image-to-video" (default: text-to-video)
text-to-videoimage-to-videopromptstringObrigatórioText prompt (3-5000 chars)
mode_optionstringOpcionalPadrãonormal"normal", "fun", or "spicy" (default: normal)
normalfunspicyaspect_ratiostringOpcional"16:9", "9:16", "1:1", "2:3", or "3:2" (text-to-video only)
16:99:161:12:33:2image_urlsstring[]OpcionalRequired for image-to-video; one public http/https URL only
input_imagestringOpcionalDeprecated. Alias for image_urls[0]
Requisição
curl -X POST https://www.bananapro.site/api/v1/videos/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-video",
"type": "text-to-video",
"prompt": "A handheld shot of a bustling ramen alley at night",
"mode_option": "fun",
"aspect_ratio": "16:9"
}'Resposta200
{
"success": true,
"data": {
"task_id": "task_grok123",
"credits_used": 30,
"remaining_credits": 470,
"model": "grok-video"
}
}Os valores de credits_used nestes exemplos são ilustrativos. O consumo real é calculado no envio e retornado pela API.
2
Consultar a tarefa
GET
/api/v1/videos/{task_id}status
pending- Accepted and waiting to start. Keep polling.
processing- Running. Keep polling.
completed- Finished. Read video_url; output holds the full result.
failed- Ended without a result. error_message says why and credits_refunded shows what was returned.
Poll every 5 to 10 seconds and stop at completed or failed, or register a webhook to be notified instead. Failed tasks are refunded automatically.
Requisição
curl https://www.bananapro.site/api/v1/videos/task_abc123 \
-H "Authorization: Bearer sk-your-api-key"Resposta200
{
"success": true,
"data": {
"task_id": "task_abc123",
"model": "grok-video",
"status": "completed",
"output": { "video_url": "https://..." },
"video_url": "https://...",
"error_message": null,
"credits_used": 30,
"credits_refunded": 0,
"created_at": "2026-10-04T10:00:00.000Z",
"updated_at": "2026-10-04T10:01:12.000Z",
"completed_at": "2026-10-04T10:01:12.000Z"
},
"request_id": "req_abc123"
}Aguardar o resultado
TASK_ID=task_abc123
while true; do
TASK=$(curl -s https://www.bananapro.site/api/v1/videos/$TASK_ID \
-H "Authorization: Bearer sk-your-api-key")
STATUS=$(echo "$TASK" | jq -r '.data.status')
if [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ]; then
echo "$TASK" | jq
break
fi
sleep 10
donePreços
| Mode | Credits |
|---|---|
| text-to-video | 30 |
| image-to-video | 30 |
Funcionalidades
- Text-to-video generation
- Image-to-video generation
- Style modes (normal/fun/spicy)
- Fast generation