Integration · AI coding agents

Let your AI build your twin and videos

Paste one prompt into Lovable, Cursor, Claude Code or ChatGPT and add your API key. Your AI checks your allowance, requests a twin you approve, writes the script and makes the video.

How it works

  1. 1. Connect

    Create an API key in AutoPersonify → Integrations and give it to your AI tool as a server secret.

  2. 2. Check the allowance

    Your AI calls GET /me and tells you your plan, video minutes left and how many twins you can build.

  3. 3. Request the twin

    Your AI uploads photos (and an optional short video), states whose likeness it is, and asks you to approve. Nothing is built until you tap Approve.

  4. 4. Make the video

    Once the twin is ready, your AI writes the script from what it knows about your brand and makes the finished video.

The prompt to paste

Copy this into your AI tool. It tells the AI where the docs are, to keep your key secret, and how to handle every error.

Connect this app to my AutoPersonify account so you can turn people or characters into realistic video twins and make presenter videos with them.

## How this works
- You (the AI) help me build a twin of a person or character, then use that twin to make many videos over time.
- Every video you make is a draft until I, the human, watch it and approve it in this app. Never publish or place a video on the site automatically.

## What AutoPersonify is
AutoPersonify (https://autopersonify.com) is a UK AI video platform. It makes finished presenter videos from a script, using either a stock AI presenter or the user's own "digital twin", which is a realistic video likeness of a person or character with a voice. Accounts are billed by minutes of finished video. Videos made through the API use the account's normal plan allowance and also appear in the user's Projects. It cannot build a person from a written description alone: a twin needs at least one real photo (or a short video).

## Docs
- Human docs: https://autopersonify.com/developers.md
- OpenAPI spec: https://autopersonify.com/openapi.json
- Base URL: https://autopersonify.com/api/v1. Every request must send the header Authorization: Bearer <key>. Requests and responses are JSON.

## Endpoints
- GET /me: plan, video seconds used and remaining, twins_used, twins_allowed, can_use_twin_in_videos, upgrade_url
- GET /presenters: stock presenters
- GET /twins, GET /twins/{id}, POST /twins, DELETE /twins/{id}: the user's twins
- POST /uploads: returns a private upload_url for a photo (image/jpeg, png or webp, up to 50MB) or a video (video/mp4 or video/quicktime, up to 500MB). Always upload the original full-resolution files — never resize or compress them; the twin is built from the original file exactly as sent.
- POST /videos, GET /videos/{id}: make a video and check on it
- GET /voices: standard voices plus the user's own starred voices, with gender and preview details where available

## Do this, in order
1. Ask me for my AutoPersonify API key. I create it in AutoPersonify → Integrations → Developer API & AI agents → Step 2. It starts with ap_live_. Store it as a server-side secret named AUTOPERSONIFY_API_KEY. Never expose it to the browser or a mobile app. Make every call from server code.
2. Call GET /me and tell me my plan, the video minutes I have left, how many twins I've used out of my allowance, and whether my twins can be used in videos. If I'm short on any of these, show me the upgrade_url.
3. Build a webhook receiver: a public POST route in this app, for example /api/webhooks/autopersonify.
   - Read the raw request body.
   - Verify the X-AutoPersonify-Signature header. It must equal "sha256=" followed by HMAC-SHA256(secret, X-AutoPersonify-Timestamp + "." + raw body), as hex. Compare in constant time, and reject timestamps older than 5 minutes.
   - Handle these events: twin.awaiting_approval, twin.ready, twin.failed, twin.rejected, video.ready, video.failed.
   - IMPORTANT — order of operations: the signing secret does not exist yet. Do NOT ask me for AUTOPERSONIFY_WEBHOOK_SECRET at this stage. First give me the full public https URL of the webhook route and tell me: "Paste this into AutoPersonify → Integrations → Developer API & AI agents → Step 3 (Webhook address), then give me the signing secret it shows you."
   - Only after I paste the signing secret back to you, store it as AUTOPERSONIFY_WEBHOOK_SECRET. Until the webhook is set up, poll instead.
4. To build a twin:
   - First call GET /voices. For a photo twin, either show or play suitable choices and ask me to confirm the exact voice, or send voice_personality: a short description of the narrator I want (gender, accent, warmth, pace — for example "warm, authoritative British male narrator, calm pace"). AutoPersonify matches the closest catalogue voice from that description and I still see and approve the choice on the approval card. Keep the chosen voice_id; never silently guess.
   - For each photo, call POST /uploads {content_type}, then PUT the file to the upload_url it returns.
   - Then call POST /twins with { name, context, photos: [upload_ids], voice_id or voice_personality, likeness: { type: "original_character" | "real_person_consented", consent_by, statement } }. Photo twins need voice_id (exact id from GET /voices) or voice_personality (a short description of the narrator). Put the sharpest, evenly lit, front-facing photo with a neutral expression FIRST. Always include context: one sentence saying what the twin is for and which video you plan to make first (for example "Welcome video for the homepage"), so the owner can see what they are approving.
   - Optionally add one training video, passing its upload_id as "video". About 2 minutes of the person talking to camera gives the most realistic result.
   - Nothing happens until I trigger this step (for example a button in this app), because it uses my twin allowance.
   - The twin starts as "awaiting_approval" and I get an email. Tell me to open AutoPersonify → Your twin and tap Approve.
   - Show the twin's live status in this app (awaiting approval → building → ready / failed / rejected), updated from the webhooks, or by polling GET /twins/{id} every 30 seconds. Building usually takes a few minutes after approval. AutoPersonify only shows progress inside AutoPersonify, so this app must show its own status.
   - Before offering to make a video, check video seconds remaining from GET /me. Free plans include 3 minutes that work for any video, including twin videos. If no time is left, show the upgrade_url instead of calling POST /videos.
5. To make a video:
   - Write the script yourself, using what you know about my app, brand and audience.
   - Call POST /videos { twin_id or presenter_id, script, title, idempotency_key }. It returns 202 with status "rendering" and an id. Nothing is final until you see "ready".
   - While the video is being made, never leave me guessing. In this app show a clear, live production status wherever the video will appear (for example in the Twin Video Library and on the page that will use it): a status label plus live progress percentage from GET /videos/{id} (use its progress and human-readable stage fields — the same figures shown in the AutoPersonify dashboard), for example "Rendering — 45%…", alongside the title, a "Made with AutoPersonify" line, the script preview and how long it has been rendering (e.g. "1m 40s so far — usually 2–10 minutes"). Poll GET /videos/{id} every 10–15 seconds, or use the video.ready / video.failed webhooks. Refresh the status automatically; do not require me to reload the page.
   - On failure (video.failed or a failed poll), switch the status to "Failed", show the error's user_message, keep the video in the library with a Retry action, and tell me what went wrong — do not silently hide it.
   - When it is ready, immediately switch the status to "Needs review", show the video in the library player (play/pause, scrubbing, mute, full screen) ready for me to watch, and tell me it is ready to review — the first thing I should see is the finished video, not a form or a link.
   - Save the video id, not the link, because links expire after an hour. Fetch a fresh link from GET /videos/{id} whenever the video is played or thumbnailed.
6. Build a Twin Video Library page in this app (admin/owner only):
   - A dedicated admin page named after the twin (for example "Max Twin"), placed next to the app's brand or media settings. If the app already has a page for the twin's imagery, move it into this page.
   - Twin section: name, photo, voice and live status (awaiting approval, building, ready, failed).
   - Video library: one row or card per video with thumbnail, title, script, length, created date and status (Rendering with a live percentage while it is being made, Ready for review, Approved, Rejected, Live, Failed). Keep every version.
   - A proper player: play/pause, scrubbing, mute/volume and a full-screen view, with a poster thumbnail. While a video is rendering, show the progress status in its place; when it is ready, the player takes over immediately.
   - Actions: Approve, Reject (with an optional note), and Request changes (you write a new script and make a new version).
   - Only Approved videos can be placed on the site (for example the homepage hero). Show where each video is used.
   - Fetch a fresh link from GET /videos/{id} whenever a video is played. Optionally copy approved files into this app's own storage for permanent hosting.
   - Update statuses from the video.ready and video.failed webhooks, or by polling.
7. Errors come back as { error: { code, message, user_message, action, upgrade_url } }. Always show me user_message. If action is "upgrade", show an Upgrade button linking to upgrade_url. Retry 503s with backoff (5s, 20s, 60s), at most 3 times. Don't retry 401 or 402.

Example request: "Make Max (our AI agent) into a real-looking person with AutoPersonify's twin product using the photos in /public/max, then build a 30-second welcome video for the homepage and put it in the Max Twin page for my approval."

Worked example: Max from Gold Hunts

Gold Hunts has an AI agent called Max. Their team asks their AI: “Make Max into a real-looking person with AutoPersonify and build a 30-second welcome video for the homepage.” The AI reads the allowance (“You're on Free: 1 taster twin, 3 video minutes left”), uploads the sharpest front-facing portrait of Max first, marks the likeness as an original character owned by Gold Hunts, and asks the owner to approve. Once Max is ready, the AI writes a welcome script in the brand's voice and puts the finished video on the homepage.

Built-in safeguards

  • Every twin request says whose likeness it is and who agreed.
  • Nothing is built until the account owner approves it, by email link or in the app.
  • Keys are stored only as a secure fingerprint and can be revoked instantly.
  • Limits: 60 requests a minute, 10 new videos a minute and 3 twin requests an hour per key.
  • Videos use your normal plan minutes, with clear upgrade messages your AI can show.

Messages your AI can show

CodeMeaningWhat your app should do
invalid_api_keyThe key is missing, mistyped or unknown.Ask the user for a new key (AutoPersonify → Integrations → Developer API). Don't retry.
key_revokedThe key was revoked.Ask the user to create a new key. Don't retry.
allowance_exceededThe account has used its video minutes.Show user_message and a button to upgrade_url. Don't retry until they upgrade.
plan_requiredA paid plan is needed for this action.Show user_message and link to upgrade_url.
twin_not_readyThe twin is still building.Tell the user and refresh the picker later.
not_foundPresenter, twin or video doesn't exist (or was deleted).Refresh the picker list and ask the user to choose again.
invalid_requestMissing or invalid fields; see error.fields.Fix the request. Show field messages if the user typed them.
script_too_longScript exceeds the per-video character limit.Ask the user to shorten or split the script.
rate_limitedMore than 60 requests or 10 video creates per minute.Wait for the Retry-After header, then retry.
concurrency_limitToo many videos rendering at once.Wait for one to finish (Retry-After), then retry.
daily_limitDaily video limit reached.Tell the user to try again tomorrow. Don't retry today.
render_failedThe video couldn't be made (also appears as video.error when status is failed).Show user_message. Offer one manual retry; if it fails again suggest contacting support.
twin_limit_reachedThe plan has no room for another twin.Show user_message and link to upgrade_url.
consent_requiredPOST /twins is missing the likeness statement.Ask the user whose likeness it is and who agreed, then resend.
awaiting_owner_approvalThe twin is waiting for the account owner to approve it.Tell the user to open AutoPersonify → Your twin and tap Approve. Poll GET /twins/{id}.
photo_unusableA photo is missing, unreadable or the wrong type.Ask for a clear, front-facing JPG/PNG/WebP and upload again.
service_unavailableTemporary problem on our side.Retry with exponential backoff (e.g. 5s, 20s, 60s), at most 3 times, then show user_message.

Questions people ask

Can my AI build a twin without me?
No. Every twin requested through the API waits for the account owner to approve it, by email link or in the app. This stops a leaked key being used to copy someone's likeness.
Can a twin be built from a written description alone?
No. A twin is built from a real photo or a short video. If you only have a description, create a realistic portrait first and send that as the photo.
Do several photos make a 360-degree twin?
No. One sharp, front-facing, evenly lit photo builds the face. Extra photos are kept privately as references. A two-minute video of the person talking to camera gives the most realistic result.
What does it cost?
The API uses your normal plan. Free includes 3 video minutes and one taster twin with no card required. Paid plans start at £49 a month.
Which AI tools does it work with?
Any tool that can call a web API from server code, including Lovable, Cursor, Claude Code, ChatGPT and your own scripts.

Related: All integrations · Developer API · For agencies · Pricing

Start free, no card required

Create your account, make an API key and let your AI do the rest.

Get your API key