This guide covers migration to Picsart Creative APIs v1 at https://api.picsart.io/tools/1.0/upscale. Check which Let’s Enhance/Claid API your application actually uses before adapting it. The current Claid image-editing contract differs from the old HTTP v1-beta1 example in the retired guide.
Update authentication and input
Claid examples use a Bearer token and a JSON request containing input and operations. Picsart v1 uses X-Picsart-API-Key and multipart fields. Supply a binary file with image or a retrievable URL with image_url. Use one source; image_id is marked deprecated in the current reference. A Claid storage:// reference is not a public URL that Picsart can fetch.
curl --fail --request POST \ https://api.picsart.io/tools/1.0/upscale \ --header "X-Picsart-API-Key: $PICSART_API_KEY" \ --header "Accept: application/json" \ --form "image=@/path/to/input.jpg" \ --form "upscale_factor=2" \ --form "format=JPG"
Set the key securely in your environment. Let curl set the multipart boundary. This example follows the documented contract; test it with your own account and representative images before production use.
Map resize and enhancement settings
- Percentage dimensions: doubling both dimensions (200%) corresponds geometrically to a factor of 2. It does not promise the same visual processing.
- Allowed factors: the classic Upscale endpoint lists 2, 4, 6 and 8. Do not send an arbitrary integer such as 3 or 12. Other enhancement endpoints have their own contracts.
- Exact pixel dimensions: compute the scale required in each dimension, choose an allowed factor large enough for both, then resize or crop as needed. Check output limits before processing.
- Example: a 512 × 512 input at factor 2 becomes 1024 × 1024. It is not an exact 800 × 800 output; reaching that target requires a separate resize step.
- Enhancement mode: Claid
operations.restorations.upscalemodes such as photo or faces do not map directly to Picsartupscale_factor. Choose and test the appropriate Picsart service. - Output: map Claid
output.formatto an explicitly supported Picsartformat: JPG, PNG or WEBP for classic Upscale. Do not assume AVIF/TIFF output or a matching quality-percentage control.
Select an allowed factor
function chooseFactor(w, h, targetW, targetH) {
if (![w, h, targetW, targetH].every(n => Number.isFinite(n) && n > 0)) {
throw new Error("Dimensions must be positive numbers");
}
const required = Math.max(targetW / w, targetH / h);
if (required <= 1) return null; // Resize only; no upscale needed.
const factor = [2, 4, 6, 8].find(n => n >= required);
if (!factor) throw new Error("Target exceeds classic Upscale factors");
return factor;
}This calculation only chooses a factor. It does not validate the endpoint’s pixel/file limits, preserve a changed aspect ratio automatically, or guarantee image quality. Inspect detail and artifacts after processing.
Change response parsing
Claid’s temporary output URL appears under data.output.tmp_url in the documented response. Picsart v1 returns the output URL under data.url, alongside a result ID and status:
{"status":"success","data":{"id":"result-id.jpg","url":"https://cdn.picsart.io/example.jpg"}}The URL is illustrative. Validate HTTP status, JSON status and the URL field before downloading. Save the result to your own storage and check the download response; do not rely on temporary result hosting.
Test the complete migration
- Check input formats and limits on the exact endpoint, including transparency and large images.
- Handle authentication, credits, invalid parameters, rate limits and transient failures.
- Compare exact output dimensions, subject detail, text, faces, color and file size.
- Update downstream URL parsing, storage, internal documentation and operational monitoring before switching production traffic.
References: Claid image-editing contract and Choosing a Picsart upscale service.