Skip to main content
All errors return specific HTTP status codes and detailed error messages in the detail field.

Error Categories

  • User Errors
  • Validation Errors
  • Content Errors
  • System Errors
Issues caused by invalid requests or insufficient resources.
HTTP Status: 402 Payment RequiredDescription: Not enough credits to complete the requestSolution: Add more credits to your account
{
  "detail": "INSUFFICIENT_CREDITS"
}
HTTP Status: 404 Not FoundDescription: Generation with specified ID does not existSolution: Verify the generation ID is correct
{
  "detail": "Generation not found"
}
HTTP Status: 401 UnauthorizedDescription: Token not provided, invalid, or expiredSolution: Include valid Bearer token in Authorization header
{
  "detail": "Missing credentials"
}

HTTP Status Code Reference

200
OK
Request successful
201
Created
Generation created successfully
400
Bad Request
Invalid parameters or request format
401
Unauthorized
Invalid or missing token
402
Payment Required
Insufficient credits
404
Not Found
Generation not found
422
Validation Error
Invalid input format or missing required fields
500
Internal Server Error
Server-side error
503
Service Unavailable
Service temporarily unavailable

Common Error Scenarios

Scenario 1: Insufficient Balance

# Check balance before generation
balance_response = requests.get(
    "https://platform.runblob.io/v1/data/balance",
    headers={"Authorization": f"Bearer {token}"}
)

balance = balance_response.json()["balance"]

if float(balance) < 0.12:  # Minimum for 10s video
    print("Insufficient balance. Please add credits.")
else:
    # Proceed with generation
    generate_video(prompt)

Scenario 2: Invalid Image Input

import base64

# Validate image before sending
def validate_image(file_path):
    # Check file size
    file_size = os.path.getsize(file_path)
    if file_size > 10 * 1024 * 1024:  # 10 MB
        raise ValueError("Image too large. Max 10MB")
    
    # Check format
    valid_formats = ['.jpg', '.jpeg', '.png', '.webp']
    if not any(file_path.lower().endswith(fmt) for fmt in valid_formats):
        raise ValueError("Invalid format. Use JPEG, PNG, or WEBP")
    
    return True

try:
    validate_image("image.jpg")
    # Proceed with generation
except ValueError as e:
    print(f"Validation error: {e}")

Scenario 3: Handling Failed Generations

def check_generation(generation_id):
    response = requests.get(
        f"https://platform.runblob.io/v1/sora/generations/{generation_id}/",
        headers={"Authorization": f"Bearer {token}"}
    )
    
    data = response.json()
    
    if data["status"] == "failed":
        error = data["error_message"]
        
        # Handle specific errors
        if "photorealistic people" in error:
            print("Try with a different image without people")
        elif "policy" in error:
            print("Modify your prompt to comply with policies")
        else:
            print(f"Generation failed: {error}")
        
        return None
    
    return data
Always implement proper error handling in your application to provide good user experience and handle edge cases gracefully.