Quickstart

Send your first API request

Create an API key, verify the account, then submit a swap request with public HTTPS input URLs.

RESTBearer authJSON responses

Quickstart snippets

Verify key
curl -sS https://aifacesswap.com/api/v1/me \
  -H "Authorization: Bearer $AIFACESWAP_API_KEY"
Create swap
curl -sS -X POST https://aifacesswap.com/api/v1/swaps \
  -H "Authorization: Bearer $AIFACESWAP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "type": "image",
    "source_url": "https://example.com/face.jpg",
    "target_url": "https://example.com/target.jpg"
  }'

Server-side only. Keep API keys out of client bundles.

Your first swap in three steps

A short implementation path for new users. Deeper reference material lives on the dedicated pages instead of interrupting this flow.

  1. 01

    Create an API key

    Go to /dashboard/api-keys and create a key. The full key is shown once — copy it into AIFACESWAP_API_KEY and treat it like a password.

  2. 02

    Verify the key

    A free, 0-credit identity check returns your user id, tier, credits, and rate-limit snapshot.

    cURL
    curl -sS https://aifacesswap.com/api/v1/me \
      -H "Authorization: Bearer $AIFACESWAP_API_KEY"
  3. 03

    Create a swap

    Submit public HTTPS URLs. The response is a PublicSwap with status: "queued". Poll or register a webhook until the task is terminal.

    cURL
    curl -sS -X POST https://aifacesswap.com/api/v1/swaps \
      -H "Authorization: Bearer $AIFACESWAP_API_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{
        "type": "image",
        "source_url": "https://example.com/face.jpg",
        "target_url": "https://example.com/target.jpg"
      }'