Skip to content

Video Errors & Recovery

CodeMeaningFix
invalid_api_keyKey is missing, wrong, or revokedCheck your key
insufficient_balanceNot enough creditTop up in Wallet
CodeMeaningFix
invalid_modelModel name not recognizedCheck Available Models
invalid_durationDuration out of rangeCheck model’s allowed range
invalid_resolutionResolution not supported by modelCheck model’s supported resolutions
invalid_mediaReference media URL invalid or unreachableVerify URL is publicly accessible
content_policyPrompt violates content policyRephrase your prompt
CodeMeaningWhat to do
generation_failedModel failed to generateCheck error message; usually content-related
timeoutTask exceeded time limitCheck if result is still available; don’t resubmit blindly
upstream_errorUpstream service issueWait and retry

These are different situations that need different handling:

Your HTTP connection times out while polling

Section titled “Your HTTP connection times out while polling”

This does not mean the task failed. The task may still be running.

Action: Just poll again with the same task ID. Don’t resubmit.

# Good: retry polling
try:
result = poll(task_id, timeout=30)
except requests.Timeout:
# Connection timed out, but task is still running
time.sleep(10)
result = poll(task_id, timeout=30) # Just try again

The generation actually failed.

Action: Check the error field for the reason. The charge is automatically refunded.

{
"status": "failed",
"error": {
"code": "generation_failed",
"message": "Content policy violation"
}
}
SituationSafe to retry?Notes
HTTP connection error✅ YesTask may not have been submitted
401/403 authentication✅ YesFix the key first
429 rate limit✅ YesWait and retry
Task failed with content policy⚠️ Only if you change the promptSame prompt will fail again
Task failed with upstream error✅ YesTemporary issue
Polling timeout (task still queued/in_progress)❌ NoTask is still running — resubmitting creates a duplicate charge
  • Task is still queued or in_progress — be patient, it’s working
  • Content policy failure with the same prompt — modify the prompt first
  • You’ve already submitted and lost the task ID — check your logs before creating duplicates

When a task fails, the charge is automatically refunded to your balance:

  • The refund typically appears within minutes
  • You can verify in Wallet → Transaction History
  • The entry will show a refund record linked to the failed task
  • Successful generations where the output doesn’t meet your creative expectations
  • Tasks that complete but the video URL expires before you download it
  • Duplicate submissions (submitting the same task twice because you didn’t save the first task ID)
  1. Save task IDs immediately — store them in your database or queue
  2. Use idempotency in your application — tag submissions with a unique reference so you don’t accidentally submit twice
  3. Download videos promptly — URLs may expire; don’t assume permanent availability
  4. Monitor your balance — set up alerts for low balance in the dashboard
  5. Log error responses — the error.message field contains actionable information