PixMind Docs
API Guides

Tools API

Video cleanup, storyboard prompts, and text to speech using your API key.

Use https://aihub-admin.aimix.pro/api-platform/v1 with Authorization: Bearer YOUR_API_KEY. Video tools require the key's video permission; TTS requires audio permission. Existing unrestricted keys work without an extra permission setting. Website credits and API credits are separate.

ToolCreateQueryBilling unit
Subtitle / watermark removalPOST /video/remove-subtitles or /video/remove-watermarkReturned statusUrl30 seconds, rounded up
Video to promptsPOST /video-to-promptGET /tasks/{taskId}30 seconds, rounded up
Speech synthesisPOST /tts/synthesizeSynchronous result100 characters, rounded up

GET /tools returns the current configured API unit prices, limits, cleanupAvailability and ttsAvailability. Availability checks configuration and pricing, not live provider health. Unconfigured engines/providers are disabled in the Playground and return 503 before charging. GET /pricing remains available. Cleanup duration is probed on the server; a 31-second video uses two billing units. PRO prices depend on the selected rectangle's dimensions, or the entire video when no region is supplied. Microsoft TTS retains its existing zero-credit policy.

The JSON envelope is {code:1000,message,data} on success. Check both HTTP status and code. Common errors are 400 (input), 401 (key), 402 (API balance), 403 (permissions), 409 (idempotency conflict), 429 (limit), and 503 (missing service configuration).

For cleanup and TTS, send an optional Idempotency-Key (1–128 printable characters). The same owner, endpoint, key and parameters return the completed response for 24 hours. Different parameters or an incomplete/uncertain attempt return 409. Do not automatically retry a paid POST with a new key after a lost response. Video-to-prompt retains its existing submission behavior and does not support this new deduplication header.

For local video files, use temporary media uploads, PUT the file to the returned upload URL, and use fileUrl as videoUrl. Cleanup binds the source to the task; the existing media cleanup job handles terminal tasks and expired unused uploads.

Poll the returned path every 5–10 seconds until ready or failed. Cleanup task IDs are public avatar task IDs, mapped to the common task internally. They are scoped to the API key's user, application and tenant. Polling does not submit or bill a second job. Stop polling locally without cancelling the server task; resume using the same task ID.

// After checking the create response, poll the exact statusUrl on this origin.
const origin = "https://aihub-admin.aimix.pro";
const url = new URL(created.data.statusUrl, origin);
if (url.origin !== origin) throw new Error("Invalid status URL");
for (;;) {
  const response = await fetch(url, {headers: {Authorization: `Bearer ${process.env.PIXMIND_API_KEY}`}});
  const result = await response.json();
  if (!response.ok || result.code !== 1000) throw new Error(result.message);
  if (result.data.status === "failed") throw new Error(result.data.error?.message);
  if (result.data.status === "ready") { console.log(result.data); break; }
  await new Promise(resolve => setTimeout(resolve, 5000));
}
import os, time, requests

headers = {"Authorization": "Bearer " + os.environ["PIXMIND_API_KEY"]}
url = "https://aihub-admin.aimix.pro/api-platform/v1/video/cleanup/tasks/123"
for _ in range(1440):
    response = requests.get(url, headers=headers, timeout=30)
    response.raise_for_status()
    result = response.json()
    if result["code"] != 1000: raise RuntimeError(result["message"])
    task = result["data"]
    if task["status"] == "failed": raise RuntimeError(task["error"]["message"])
    if task["status"] == "ready":
        print(task)
        break
    time.sleep(5)