API Documentation

Integrate LeakifyHub's generation capabilities into your applications.

Authentication

All API requests require authentication using your Secret Key. The API uses Bearer token authentication.

Header
Authorization: Bearer sk_live_your_secret_key

Base URL

All API endpoints are accessed through our base URL with /api/v1 prefix.

Base URL
https://api.leakifyhub.fun/api/v1

Pricing

Pay-as-you-go pricing. Credits deducted on submission, refunded if job fails.

Video Generation

$0.20 - $0.30

per request (varies by style)

Photo Generation

$0.10

per request

Faceswap, Custom generation, Outfit Swap & Generator

$0.10

each per request (same rate as catalog photo)

Motion Transfer

$0.25 – $0.40/s

Standard $0.25/s · Premium $0.40/s · 4–30s

JOI (talking video)

$0.40 – $0.80

by duration — see GET /joi/config

Video enhance

+$0.15

optional, on the finished video — see Enhance

Extend (5 / 10 / 15s video)

1× / 2× / 3×

catalog video rate × duration — see GET /extend/styles

Style Chain (2–3 styles)

Σ clip rates

each clip is that style’s 5s rate × (seconds/5) — see GET /style-chain/styles

LeakifyHub Exclusive

$2 / $3 / $6

10s / 15s / 30s — see GET /jobs/styles exclusive-* rows

Sandbox Mode

Sandbox mode allows you to test the API without consuming real credits. Sandbox keys return example videos after a simulated 10-second processing delay, making it perfect for development, testing, and integration workflows.

Key Features

  • No credits charged - completely free for testing
  • Fixed 10-second processing delay to simulate real workflow
  • Returns one example video or photo (the same file for every style), encrypted like a production result
  • Separate statistics tracking for sandbox usage
  • Same authentication and response shape as production; includes POST /faceswap/jobs, POST /custom-generation/jobs, POST /outfit-swap/jobs, POST /motion-transfer/jobs, POST /generator/jobs, POST /joi/jobs, POST /extend/jobs, and POST /style-chain/jobs

Creating Sandbox Keys

To create a sandbox key, check the "Sandbox Key" option when creating a new API key in your dashboard. Sandbox keys use the sk_test_ prefix instead of sk_live_.

Example
Authorization: Bearer sk_test_your_sandbox_secret_key

Differences from Production

FeatureProductionSandbox
Credits ChargedYes (real cost)No (free)
Processing Time1-3 minutes (real)~10 seconds (simulated)
ResultsGenerated from your imageExample videos/photos
Rate Limit100 req/min (job generation), 300-600 req/min (other endpoints)300 req/min (job generation), 500-1000 req/min (other endpoints)

💡 Use Cases

  • Testing API integration before going live
  • Development and debugging workflows
  • Demonstrating API capabilities to clients
  • Building and testing webhook handlers
  • Validating error handling and edge cases

Available Styles

Styles define the generation type. Video styles generate animated content, photo styles produce static images.

Video Styles (type: "video")

Click a column header to sort. Default: newest release first.

Loading styles...

Photo Styles (type: "photo")

The Images column shows how many input URLs you send on POST /jobs/generate: Two means you must pass image_url and image_url_2 (same flag as requires_dual_image: true in GET /jobs/styles).

Click a column header to sort. Default: newest release first.

Loading styles...

Dual-input catalog styles vs faceswap

Only rows with Images: 2 in the table above need a second URL on POST /jobs/generate. In JSON from GET /jobs/styles, those are the photo entries with requires_dual_image: true.

There are no dual-input photo styles in the live catalog right now. Always rely on the Images column or requires_dual_image in GET /jobs/styles — do not guess from the style name alone.

Faceswap is separate: swap a face onto a target body via POST /faceswap/jobs (image_url + face_image_url). Do not use image_url_2 for faceswap.

Style Options Reference

Styles with options require either options.suboption (classic) or options.boolean_selections (boolean-mode). Valid values:

Loading options...

Faceswap

Replace the face on a target image with a face from a second image. Priced at $0.10 per job (same as catalog photo). Poll GET /jobs/{job_id} or use webhook_url like catalog jobs.

Custom generation

Image-to-image generation with a text prompt.model is standard or premium. Omitting it stays on standard, which appends the same face-and-body preservation suffix as before and waits in the photo queue.premium is LeakifyHub Premium: the prompt is applied as written, and the job starts immediately. $0.10 either way (same as catalog photo). Use GET /jobs/{job_id} for status and results.

Outfit Swap

Replace the outfit on a person photo. Three modes: describe the outfit, send an outfit image URL, or pick a preset. $0.10 per job (sandbox: free). The job starts immediately. Poll GET /jobs/{job_id} or send webhook_url.

Motion Transfer

Put a person from a photo into a video. Send the person photo and the motion video as HTTPS URLs.model is premium (default) or standard. Premium is $0.40 per second. Standard is $0.25 per second. The clip is 4 to 30 whole seconds. The default is the first 5 seconds ($2.00 Premium, $1.25 Standard). Sandbox is free. One video runs each minute. If that minute is busy, the job stays queued and the charge is kept until it finishes.

Generator

Text-to-image generation with dedicated Generator models. Call GET /generator/models first to discover available model_slug values. Priced at $0.10 per job (same as catalog photo; sandbox free). Poll GET /jobs/{job_id} or use webhook_url like other jobs.

LeakifyHub Exclusive

Longer videos with audio from one photo. Same POST /jobs/generate as other video styles. Look for id values starting with exclusive- on GET /jobs/styles. Each row includes durations: [10, 15, 30] and costs in USD. Default cost is the 30s price ($6.00).

  • One image only (image_url). No image_url_2. These styles have has_options: false — omit options, or send only generic video params such as resolution (ignored).
  • duration must be 10, 15, or 30. Omit it to use 30.
  • Price: 10s $2.00 · 15s $3.00 · 30s $6.00. Sandbox keys are not charged.
  • Optional enhance: true adds $0.15 and improves the finished video. See Enhance.
  • Not available on Extend (POST /extend/jobs) or Style Chain (POST /style-chain/jobs).
  • If a style is temporarily unavailable, generate returns 503 — retry later or pick another style.

Example

JSON
{
  "image_url": "https://example.com/photo.jpg",
  "style": "exclusive-doggy",
  "type": "video",
  "duration": 30,
  "webhook_url": "https://your.server/hook"
}

JOI (talking video)

Turn a reference photo into a slow, sensual talking video with a chosen voice, spoken language, and script. Call GET /joi/config first to discover valid voice_key, language_locale, preset_key, and duration pricing. Voices, presets, and sentences are variant-specific — fetch config again when you switch subject_variant. Poll GET /jobs/{job_id} or use webhook_url like other jobs. JOI job status includes subject_variant (female or male).

Extend (5 / 10 / 15s video)

Catalog WAN 2.2 videos at a chosen length. POST /jobs/generate stays a single ~5s clip. Use this product when you need 5, 10, or 15 seconds. Call GET /extend/styles first for valid style keys and USD prices. Poll GET /jobs/{job_id} or use webhook_url like other jobs. The webhook fires once, when the finished file is ready — 10s and 15s are one stitched job, not extra history items. LeakifyHub Exclusive styles (exclusive-*) are not extendable.

Style Chain (A then B, optional C)

One reference photo, then 2 or 3 catalog styles in order — one job, one finished file. This is not POST /jobs/generate (one style) and not POST /extend/jobs (same style, longer). Call GET /style-chain/styles first for valid keys and per-clip USD prices. Poll GET /jobs/{job_id} or use webhook_url. The webhook fires once, when the stitched video is ready. Exclusive and JOI styles are not chainable.

Prompt guidance

Optional short note that corrects one small visual detail on a catalog video style. The style stays the same. It cannot recreate a style or make a drastic change. There is no extra charge. Omit the field to generate the normal style.

  • POST /jobs/generate — set prompt_guidance on a type: "video" job. Max 240 characters.
  • POST /style-chain/jobs — set prompt_guidance on each clip that needs its own detail. A note applies only to that clip.
  • Not available for photo styles, LeakifyHub Exclusive, JOI, faceswap, custom generation, Extend, or Generator.
  • A note that cannot be used returns 400. If the detail cannot be added, the job is not created and returns 422. Too many guidance requests return 429.
  • GET /jobs/{job_id} does not return the note or the style prompt.

Video job

JSON
{
  "image_url": "https://example.com/image.jpg",
  "style": "blowjob-v2",
  "type": "video",
  "prompt_guidance": "enters from the left"
}

Style chain

JSON
{
  "image_url": "https://example.com/reference.jpg",
  "clips": [
    { "style": "kissing-pov", "duration": 5, "prompt_guidance": "enters from the left" },
    { "style": "cowgirl", "duration": 10, "prompt_guidance": "her mouth is open" }
  ]
}

Enhance

Optional quality upgrade for a finished video. The picture is improved to 1080p. Omit enhance to receive the normal video.

  • POST /jobs/generate — set enhance: true on a type: "video" job, including LeakifyHub Exclusive.
  • POST /extend/jobs and POST /style-chain/jobs — the same flag, once, on the finished file. It is not charged per clip.
  • Adds $0.15 to the job price. Sandbox keys ignore the flag and are not charged.
  • A photo job that sends the flag returns 400. If enhance is unavailable, the request returns 503 and nothing is charged.
  • Not available on faceswap, custom generation, outfit swap, motion transfer, JOI, Generator, or Voice.
  • While the upgrade runs, GET /jobs/{job_id} returns status: "enhancing" and result_url is null. Keep polling. The webhook fires once, when the upgraded file is ready.
  • If the upgrade fails, the original video is delivered and the $0.15 is returned. The job status is still completed.

Video job

JSON
{
  "image_url": "https://example.com/image.jpg",
  "style": "cumshot-facial",
  "type": "video",
  "enhance": true
}

Extend

JSON
{
  "image_url": "https://example.com/reference.jpg",
  "style": "missionary",
  "duration": 10,
  "enhance": true
}

Endpoints

RESTful endpoints for managing generation jobs. Jobs are processed asynchronously.

Usage & Statistics

Monitor your API usage, credits balance, and generation statistics. These endpoints use the same authentication as job endpoints (API keys or Bearer tokens).

API Keys Management

Create and manage your API keys. Important: These endpoints require website JWT authentication (not API key authentication). You must be logged into your account on the website to manage keys.

Authentication: API key management endpoints use website JWT tokens (from your website login), not API keys. Use your website session token with Authorization: Bearer <website_jwt_token>.

File Encryption & Decryption

All generated files are encrypted at rest before being stored on Supabase. Each user's files are encrypted with a unique key derived from their API secret, ensuring privacy and security.

How It Works

  1. You submit a job with your API_SECRET
  2. GPU worker derives a unique encryption key from your API secret using PBKDF2
  3. Generated file is encrypted with this derived key
  4. Encrypted file is uploaded to storage
  5. Job response includes encryption_metadata for decryption
  6. You derive the same key from your API secret and decrypt the file

Key Derivation

Your encryption key is derived from your API_SECRET using PBKDF2:

  • Algorithm: SHA-256
  • Salt: b'leakify_api_secret_salt_v1' (fixed)
  • Iterations: 100,000
  • Key Length: 32 bytes (256 bits)

Important: The same API secret always produces the same encryption key. You only need your API_SECRET to decrypt your files—no master key required!

Encryption Metadata

The job response includes encryption_metadata:

JSON
{
  "encrypted_key": "base64_encoded_encrypted_file_key",
  "iv": "base64_encoded_initialization_vector",
  "algorithm": "AES-256-GCM",
  "key_version": 1
}

encrypted_key: The file's encryption key, encrypted with your derived user key

iv: Initialization vector for file key encryption (fixed: b'file_key_iv_16b')

algorithm: Always "AES-256-GCM"

key_version: Version identifier (currently 1)

Decryption Process

  1. Download the encrypted file from result_url
  2. Derive your encryption key from your API_SECRET using PBKDF2
  3. Decrypt the file key from encryption_metadata.encrypted_key using your derived key
  4. Extract the IV (first 12 bytes) from the encrypted file
  5. Decrypt the file content using the decrypted file key and IV
  6. Save the decrypted file

⚠️ Security Best Practices

  • Never share your API secret—anyone with your secret can decrypt your files
  • Store your API secret securely (environment variables, secrets manager)
  • Never commit secrets to version control
  • If you lose your API secret, you cannot decrypt old files—generate a new key pair for future jobs

Complete Decryption Example

See the Code Examples section above for complete Python and JavaScript implementations that include decryption.

Webhooks

Receive real-time notifications when jobs complete. Include webhook_url in your request.

Webhook Payload

JSON
{
  "job_id": 12345,
  "status": "completed",
  "job_type": "video",
    "style": "cumshot-facial",
  "credits_cost": 0.4,
  "result_url": "https://storage.../signed-url",
  "result_expires_at": "2026-01-11T12:00:00Z",
  "encryption_metadata": {
    "encrypted_key": "base64_encoded_encrypted_file_key",
    "iv": "base64_encoded_iv",
    "algorithm": "AES-256-GCM",
    "key_version": 1
  }
}

Note: The webhook payload includes encryption_metadata for decrypting the file. The result_url is a signed URL that expires in 24 hours. A job with enhance: true sends this webhook once, after the upgrade finishes.

Code Examples

Complete examples in popular programming languages.

python
import requests
import base64
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers.aead import AESGCM

API_SECRET = "sk_live_your_secret_key"
BASE_URL = "https://api.leakifyhub.fun/api/v1"

def derive_user_key(api_secret: str) -> bytes:
    """Derive encryption key from API secret"""
    salt = b'leakify_api_secret_salt_v1'
    kdf = PBKDF2HMAC(
        algorithm=hashes.SHA256(),
        length=32,
        salt=salt,
        iterations=100000,
        backend=default_backend()
    )
    return kdf.derive(api_secret.encode('utf-8'))

def decrypt_file(encrypted_path: str, output_path: str, 
                 encryption_metadata: dict, api_secret: str):
    """Decrypt a file using API secret"""
    # Derive user key
    user_key = derive_user_key(api_secret)
    
    # Decrypt file key from metadata
    encrypted_file_key = base64.b64decode(encryption_metadata['encrypted_key'])
    aesgcm = AESGCM(user_key)
    file_key = aesgcm.decrypt(
        nonce=b'file_key_iv_16b',
        data=encrypted_file_key,
        associated_data=None
    )
    
    # Read and decrypt file
    with open(encrypted_path, 'rb') as f:
        file_data = f.read()
    
    file_iv = file_data[:12]
    ciphertext = file_data[12:]
    
    file_aesgcm = AESGCM(file_key)
    plaintext = file_aesgcm.decrypt(
        nonce=file_iv,
        data=ciphertext,
        associated_data=None
    )
    
    with open(output_path, 'wb') as f:
        f.write(plaintext)

# Submit a job
response = requests.post(
    f"{BASE_URL}/jobs/generate",
    headers={"Authorization": f"Bearer {API_SECRET}"},
    json={
        "image_url": "https://example.com/image.jpg",
        "style": "cumshot-facial",
        "type": "video"
    }
)
job = response.json()
print(f"Job ID: {job['job_id']}")

# Poll for completion
import time
while True:
    status = requests.get(
        f"{BASE_URL}/jobs/{job['job_id']}",
        headers={"Authorization": f"Bearer {API_SECRET}"}
    ).json()

    if status['status'] == 'queued':
        # Optional: queue_position and eta are approximate wait hints
        pos = status.get('queue_position')
        eta = status.get('eta') or {}
        wait_s = eta.get('estimated_wait_seconds')
        print(f"Queued at #{pos}, ~{wait_s}s until start")
    
    if status['status'] == 'completed':
        # Download encrypted file
        encrypted_data = requests.get(status['result_url']).content
        with open('encrypted.mp4.encrypted', 'wb') as f:
            f.write(encrypted_data)
        
        # Decrypt file
        decrypt_file(
            'encrypted.mp4.encrypted',
            'decrypted.mp4',
            status['encryption_metadata'],
            API_SECRET
        )
        print("File decrypted successfully!")
        break
    elif status['status'] == 'failed':
        print(f"Error: {status['error_message']}")
        break
    
    time.sleep(5)

Error Codes

Standard HTTP status codes with JSON error responses.

CodeDescription
401Invalid or missing API key
402Insufficient credits
403API access not approved
404Job not found
429Rate limit exceeded
500Internal server error
503Style or video enhance temporarily unavailable — retry later

API Access Application

Before using the API, you need to apply for API access through the website. These endpoints help you check your application status. Note: These endpoints use website JWT authentication, not API keys.

Getting Started: If you don't have API access yet, visit the API Application page on the website to submit your application. Once approved, you can create API keys and start using the API.

Rate Limits

Rate limiting protects our infrastructure. Limits vary by endpoint and API key type (production vs sandbox).

Production Keys (pk_live_/sk_live_)

EndpointRate Limit
POST /jobs/generate100 requests/minute
POST /faceswap/jobs100 requests/minute
POST /custom-generation/jobs100 requests/minute
POST /outfit-swap/jobs100 requests/minute
POST /motion-transfer/jobs300 requests/minute
POST /generator/jobs100 requests/minute
POST /joi/jobs100 requests/minute
POST /voice/jobs100 requests/minute
POST /extend/jobs100 requests/minute
POST /style-chain/jobs100 requests/minute
GET /jobs/{id}600 requests/minute
GET /jobs300 requests/minute
GET /usage/*300 requests/minute
Other endpoints300 requests/minute

Sandbox Keys (pk_test_/sk_test_)

EndpointRate Limit
POST /jobs/generate300 requests/minute
POST /faceswap/jobs300 requests/minute
POST /custom-generation/jobs300 requests/minute
POST /outfit-swap/jobs300 requests/minute
POST /motion-transfer/jobs300 requests/minute
POST /generator/jobs300 requests/minute
POST /joi/jobs300 requests/minute
POST /extend/jobs300 requests/minute
POST /style-chain/jobs300 requests/minute
GET /jobs/{id}1000 requests/minute
GET /jobs600 requests/minute
GET /usage/*500 requests/minute
Other endpoints1000 requests/minute

Rate limit headers included in all responses:

  • X-RateLimit-Limit - Max requests per minute for this endpoint
  • X-RateLimit-Remaining - Remaining requests in current window
  • X-RateLimit-Reset - Unix timestamp when the limit resets
  • Retry-After - Seconds to wait before retrying (only on 429 responses)