PicVidPicVid Guide
API

PicVid API

Use PicVid's image and video tools from your own application - overview and quick start.

The PicVid API gives your application the same tools as the PicVid app: Image Generator, Image Editor, Face Swap, Headshot, Upscale, Remove Background, Image to Video, Text to Video and more. Prices, plan rules and limits are exactly those of the app, and jobs are paid with the credits of the account that owns the API key.

  • Base URL: https://api.picvid.co/v1
  • Format: JSON in, JSON out, UTF-8.
  • How it works: upload your file, start a job, then check the job until it is done and download the result.

Getting a key

On a paid plan, create a key on the API keys page (account menu > API), in your Personal workspace: choose the tools it may use and, if you like, a monthly credit limit and an expiry date. The key is shown once - copy it then. Keep it secret: anyone who has it can spend your credits. See Authentication.

Quick start

1. Upload a photo - ask for an upload link, then PUT the file to it.

curl -X POST https://api.picvid.co/v1/uploads \
  -H "Authorization: Bearer $PICVID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "image", "mime_type": "image/jpeg", "size_bytes": 482133}'
{ "upload": { "id": "9f1c…", "upload_url": "https://…", "method": "PUT", "headers": { "Content-Type": "image/jpeg" }, "expires_in_seconds": 300 } }
curl -X PUT "$UPLOAD_URL" -H "Content-Type: image/jpeg" --data-binary @photo.jpg

2. Start a job - here, Remove Background:

curl -X POST https://api.picvid.co/v1/images/remove-background \
  -H "Authorization: Bearer $PICVID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"image_upload_id": "9f1c…"}'
{ "job": { "id": "0b6f…", "tool": "images/remove-background", "status": "queued", "credits": 20, "outputs": [] } }

3. Check the job until status is completed, then download job.outputs[0].download_url:

curl https://api.picvid.co/v1/jobs/0b6f… -H "Authorization: Bearer $PICVID_API_KEY"

The download link redirects to the file, so let your client follow redirects - with curl, add -L:

curl -L -o result.png "$DOWNLOAD_URL"

A complete example in Node.js (18 or later):

import { readFile } from "node:fs/promises";

const BASE = "https://api.picvid.co/v1";
const headers = { Authorization: `Bearer ${process.env.PICVID_API_KEY}`, "Content-Type": "application/json" };

async function api(method, path, body) {
  const res = await fetch(`${BASE}${path}`, { method, headers, body: body && JSON.stringify(body) });
  const data = await res.json();
  if (!res.ok) throw new Error(`${data.error}: ${data.message}`);
  return data;
}

async function removeBackground(file) {
  const bytes = await readFile(file);
  const { upload } = await api("POST", "/uploads", { type: "image", mime_type: "image/jpeg", size_bytes: bytes.length });
  await fetch(upload.upload_url, { method: "PUT", headers: upload.headers, body: bytes });

  let { job } = await api("POST", "/images/remove-background", { image_upload_id: upload.id });
  while (job.status === "queued" || job.status === "processing") {
    await new Promise((r) => setTimeout(r, 3000));
    ({ job } = await api("GET", `/jobs/${job.id}`));
  }
  if (job.status !== "completed") throw new Error(job.error.message);
  return job.outputs[0].download_url;
}

What's in this guide

Page
AuthenticationKeys, scopes, rate limits, safe retries
UploadsSending photos, videos and audio
Image toolsEvery /images/… endpoint
Video toolsEvery /videos/… endpoint
Jobs, tools and usageJob status and results, the tool list, your usage
ErrorsEvery error code and what to do
Still need help? Contact support