PicVidPicVid Guide
API

Authentication and limits

API keys, the scope each tool needs, rate limits, monthly limits and safe retries.

Your API key

Send the key with every request:

Authorization: Bearer <your key>

A key belongs to one PicVid account. Every job it starts is that account's job, paid from its credits and its plan, exactly as if it were made in the app - and it shows in that account's My Creations.

Keys spend the credits of your Personal workspace, whichever workspace you have selected in the app. A key you created works while your plan includes the API: if the plan ends, the key is paused (403 API_NOT_IN_PLAN) and works again once you upgrade.

If a key leaks, revoke it at once on the API keys page - it stops working right away. A key issued to you by the PicVid team can be revoked there too, or by emailing [email protected].

Scopes: which tools a key may use

Each tool needs its own scope on the key. Reading jobs, uploads, the tool list and usage needs no scope.

EndpointScope
POST /images/generateimage:generate
POST /images/editimage:edit
POST /images/face-swapimage:face_swap
POST /images/face-editimage:face_edit
POST /images/clothesimage:clothes
POST /images/headshotimage:headshot
POST /images/upscaleimage:upscale
POST /images/retouchimage:retouch
POST /images/restoreimage:restore
POST /images/remove-backgroundimage:remove_background
POST /images/expandimage:expand
POST /images/to-textimage:to_text
POST /videos/generatevideo:generate
POST /videos/from-imagevideo:from_image
POST /videos/face-swapvideo:face_swap
POST /videos/talking-photovideo:talking_photo

GET /tools shows, for each tool, whether your key may use it (allowed). A tool also has to be in the account's plan - see Credits and plans.

Limits

  • Rate: 60 requests per minute per key unless agreed otherwise. Over it you get 429 RATE_LIMITED with a Retry-After header.
  • Monthly credits: a key can have a monthly credit limit (UTC). Once reached, new jobs get 429 MONTHLY_CREDIT_LIMIT_REACHED; see GET /usage.
  • Tasks at a time and highest resolution follow the account's plan, as in the app.

Safe retries: Idempotency-Key

A network error can leave you not knowing whether a job was started. Send an Idempotency-Key header (any unique string up to 255 characters, e.g. a UUID) when you start a job:

Idempotency-Key: 6f1d1c2e-4b1a-4f0e-9a43-2f1d5f6f3a10
  • Sending the same request again with the same key returns the same job (status 200 and the header Idempotency-Replayed: true) - it is never started or charged twice.
  • Using the same key with a different request is refused with 409 IDEMPOTENCY_KEY_REUSED.
Still need help? Contact support