Documentation

Démarrage rapide

Nettoyez votre première vidéo avec l'API en trois appels.

Ce guide nettoie une vidéo en trois appels : envoi, création de la tâche, téléchargement du résultat.

1. Créez une clé d'API

Ouvrez API et webhooks dans le tableau de bord et cliquez sur Créer une clé. La clé commence par pxm_live_ et n'est affichée qu'une fois. Gardez-la dans une variable d'environnement :

export PIXAMAKE_API_KEY="pxm_live_..."

L'API demande l'offre Growth ou Scale.

2. Envoyez la vidéo

Si la vidéo est déjà en ligne, passez à l'étape 3 avec video_url. Sinon, demandez un emplacement d'envoi :

curl https://pixamake.ai/v1/uploads \
  -H "Authorization: Bearer $PIXAMAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"filename": "pub.mp4", "content_type": "video/mp4", "size_bytes": 4821331}'
{
  "id": "up_7Qm2rT9vXk3LpZ8aWn4c",
  "object": "upload",
  "upload_url": "https://...",
  "method": "PUT",
  "headers": { "Content-Type": "video/mp4" },
  "expires_at": "2026-10-04T13:00:00.000Z"
}

Envoyez ensuite le fichier sur upload_url avec le même Content-Type. La taille doit être exactement size_bytes.

curl -X PUT "$UPLOAD_URL" -H "Content-Type: video/mp4" --data-binary @pub.mp4

3. Créez la tâche

curl https://pixamake.ai/v1/jobs \
  -H "Authorization: Bearer $PIXAMAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"upload_id": "up_7Qm2rT9vXk3LpZ8aWn4c"}'

Ou directement depuis une URL publique :

curl https://pixamake.ai/v1/jobs \
  -H "Authorization: Bearer $PIXAMAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"video_url": "https://cdn.example.com/pub.mp4"}'

La réponse est une tâche avec status: "queued" et les crédits réservés.

4. Récupérez le résultat

Interrogez la tâche toutes les 5 à 10 secondes, ou configurez un webhook :

curl https://pixamake.ai/v1/jobs/job_3kT9xQ2vLm8RfZp1Wq7a \
  -H "Authorization: Bearer $PIXAMAKE_API_KEY"

Quand status vaut succeeded, téléchargez result.url. Le lien est valable une heure ; relisez la tâche pour en obtenir un nouveau.

Exemple complet (Node.js)

const BASE = "https://pixamake.ai";
const headers = { Authorization: `Bearer ${process.env.PIXAMAKE_API_KEY}`, "Content-Type": "application/json" };
 
const job = await fetch(`${BASE}/v1/jobs`, {
  method: "POST",
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({ video_url: "https://cdn.example.com/pub.mp4" }),
}).then((r) => r.json());
 
let current = job;
while (["queued", "analyzing", "processing"].includes(current.status)) {
  await new Promise((r) => setTimeout(r, 8000));
  current = await fetch(`${BASE}/v1/jobs/${job.id}`, { headers }).then((r) => r.json());
}
console.log(current.status, current.result?.url ?? current.error);

Exemple complet (Python)

import os, time, uuid, requests
 
BASE = "https://pixamake.ai"
H = {"Authorization": f"Bearer {os.environ['PIXAMAKE_API_KEY']}"}
 
job = requests.post(f"{BASE}/v1/jobs", headers={**H, "Idempotency-Key": str(uuid.uuid4())},
                    json={"video_url": "https://cdn.example.com/pub.mp4"}).json()
while job["status"] in ("queued", "analyzing", "processing"):
    time.sleep(8)
    job = requests.get(f"{BASE}/v1/jobs/{job['id']}", headers=H).json()
print(job["status"], (job.get("result") or {}).get("url"), job.get("error"))