API Free WeekHundreds of APIs are free to call this week.Browse free APIs

Face Swap

alibaba/face-swap

Face Swap replaces the face in a target image with the face from a source image, producing a realistic face-swapped result.

Base price
$0.01USD / run
Execution
async
Model type
image
Input fields
3

Try the model

Playground

Open playground
Input

PNG, JPEG, WebP, or GIF · 20 MiB maximum

The target image whose face will be replaced (URL or Base64-encoded string). Maximum file size is 50 MB.

PNG, JPEG, WebP, or GIF · 20 MiB maximum

The image containing the face to use as the source (URL or Base64-encoded string). Maximum file size is 50 MB.
Random seed. Omit for an auto-generated seed.
OutputReady

Your output will appear here

Complete the inputs, then click Run.

Model card

Specifications

Pricing

Base price
$0.01 / run

Context & modalities

Input
Schema-defined
Output
image

Capabilities

Chat
Not supported
Vision
Not supported
Reasoning
Not supported
Structured output
Not supported
Function calling
Not supported
Audio input
Not supported

Access

Provider
Alibaba
Model ID
alibaba/face-swap
Execution
async
Base URL
https://api.sandbase.ai
API
Unified Run API
Endpoint
/v1/run

API README

Face Swap

Face Swap replaces the face in a target image with the face from a source image. Precisely swaps facial features only — head shape and hairstyle are preserved. Priced at $0.013 per image.

Highlights

Face-only swap — Replaces the face while keeping the original head shape, hair, and body intact for a natural result.

Dual-image input — Provide a source face and a target image; the model handles seamless blending automatically.

High realism — Produces photorealistic results with consistent skin tone, lighting, and edge transitions.

Low cost — At $0.013 per image, suitable for high-volume portrait and creative workflows.

Pricing

MetricPrice
Per image$0.013

When to Use

✅ Good fit❌ Consider alternatives
Portrait retouching and casting previewsFull head replacement (use Head Swap)
Entertainment and creative contentStyle or background editing (use Qwen Image Edit Exp0622)
Product catalog face replacementVideo face swap
Gaming and avatar creationNew image generation from scratch (use Z-Image Exp0622)

Technical Specs

SpecValue
InputSource image (face) + target image (URL or Base64, max 50 MB each)
OutputFace-swapped image (PNG/JPEG)
Swapped regionFace only (head shape and hairstyle preserved)
ExecutionAsync (submit → poll for result)

Start building

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

Production API
Unified Run API endpoint
https://api.sandbase.ai/v1/run
Model ID
alibaba/face-swap
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
  -X POST "https://api.sandbase.ai/v1/run" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'SANDBASE_JSON'
{
  "model": "alibaba/face-swap"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
  status=$(printf '%s' "$result" | jq -r .status)
  case "$status" in completed|failed|timeout) break ;; esac
  sleep 2
  result=$(curl --fail-with-body --silent \
    -H "Authorization: Bearer $SANDBASE_API_KEY" \
    "https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"

Choose your model

Compare models

All image & video models
ModelTypeDefault priceReleased
Face SwapThis model
Alibaba
Image$0.01 / runJun 22, 2026
AlibabaImage$0.04 / runJul 21, 2026
AlibabaImage$0.04 / runJul 21, 2026
AlibabaImage$0.07 / runApr 1, 2026
AlibabaImage$0.03 / runApr 1, 2026
AlibabaImage$0.03 / runApr 1, 2026

Questions

FAQ

How do I call Alibaba Face Swap through SandBase?

Create a SandBase API key, then send requests with the model ID "alibaba/face-swap" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

Do I need a separate Alibaba account?

No. One SandBase API key and balance gives you access to Alibaba Face Swap and the other models in the catalog; you do not need to sign up with Alibaba separately.