Skip to content
Get your keyGet a key

Reference · Video

POST/enhance

Upscale, reframe or edit a picture or a clip

Change a picture, or upscale a picture or a clip — the Edit & Enhance page’s run: upscale (a picture ×2 or ×4; a clip to 1080p, at Standard or Best quality), removeBackground, expand (out to a new shape), edit (change it with words), relight and restyle (with a preset), and erase (take away what a mask covers, or put something else there). Ops, presets and prices: GET /api/v1/models (studio "enhance"). The source is a file of theirs (a storage key or an https link) or something they made. It comes back as a job (kind "enhance") to follow with GET /api/v1/jobs/{jobId}.

Key needs
create · Make things and spend credits
Answers
A job to follow
Request
curl -X POST https://vessero.com/api/v1/enhance \
  -H "Authorization: Bearer $VESSERO_API_KEY" \
  -H "Idempotency-Key: 47f8f6f5-ea00-4fb1-925f-76aac956a0ec" \
  -H "Content-Type: application/json" \
  -d '{
    "op": "upscale",
    "source": {
      "kind": "upload",
      "key": "text"
    },
    "confirmCredits": 1
  }'
Response202 Accepted
{
  "object": "job",
  "id": "enhance.8f1c2d3e-4b5a-4789-8abc-def012345678",
  "kind": "enhance",
  "status": "working",
  "stage": "Queued",
  "files": [],
  "credits": 58,
  "url": "/api/v1/jobs/enhance.8f1c2d3e-4b5a-4789-8abc-def012345678"
}
POST/enhance/quoteFree

The same body without confirmCredits. It answers the price and your balance, and runs nothing.

Header

  • Idempotency-KeystringYour id for this request: 8–64 letters, digits, - or _. A repeat within 10 minutes gets the first answer back and never runs twice. Use the same one for the quote and the run.
  • Preferstringwait=N (up to 60): hold the answer up to N seconds while the job is made, within 80 seconds for the whole call.

Body

  • opstringrequiredWhat to do: upscale, removeBackground, expand, edit, relight, restyle or erase.upscaleremoveBackgroundexpandeditrelightrestyleerase
  • sourceobject · kind upload | media | video | cardrequiredWhat to work on.
  • factornumberUpscale a picture: 2 (the default) or 4. A clip is made 1080p instead.
  • qualitystringUpscale a clip: standard (Topaz Precision, sharper in seconds; the default) or best (Topaz Starlight, finer detail, a few minutes). Both make it 1080p; a clip that is 1080p already is refused.standardbest
  • shapestringExpand: the shape to grow it out to: 1:1, 4:5, 9:16, 16:9.1:14:59:1616:9
  • presetstringRelight or restyle: a preset id from GET /api/v1/models (studio "enhance"). Default: the first.
  • promptstringEdit: the change, e.g. "make the jacket red" (needed). Expand, relight, restyle: anything to add (optional). Erase: what to put where the mask is, e.g. "a potted plant" (optional: without it the area is filled to match what is around it).
  • maskstringErase: what to take away, as a PNG over the picture — white where to erase and black elsewhere, or opaque where to erase and clear elsewhere — stretched to the picture’s size: a storage key from POST /api/v1/files or POST /api/v1/library/use, or an https link to the file (brought into their Uploads first). Needed for erase.
  • secondsnumberAn uploaded clip’s length in seconds, which prices its upscale.
  • confirmCreditsintegerrequiredThe price you agree to, in credits: the credits its quote gave. It runs at that price, or at a lower one when that figure was quoted for this Idempotency-Key; above the price now, nothing runs (409 price_changed). Left out, nothing runs and the error carries the quote.
  • webhookUrlstring · httpsAn https address to POST the job to once it is done or has failed, signed (see Webhooks).

Answers

  • 202jobStarted: follow the job, or wait for its webhook.
  • 200jobA job that ended at once: done, or failed (see error and charged).
  • 400confirm_credits_requiredA run that spends needs confirmCredits: the quote is in details.
  • 402insufficient_creditsThe account has too few credits for this.
  • 409price_changedThe price is above the confirmCredits sent: nothing ran; the new quote is in details.
  • 422content_refusedThe content check refused it.
  • 429daily_cap_reachedThe key’s daily credit cap would be passed: see Retry-After.
Next in VideoPOST/enhance/quote