Skip to main content
New to Corsair? See API access, authentication, and error handling.

Account

status

account.status Read the API key’s credits: monthly and one-time quota, calls used, captions quota, plan. Pass siteUrl to also check that ShortPixel can reach that site. Risk: read
Input POST /v2/api-status.php. Plan, quota and credits used. siteUrl asks ShortPixel whether it can reach a site (DomainCheck). Output

Domains

add

domains.add Add a domain to the ShortPixel CDN and associate it with this key. Safe to repeat; a domain another account owns is refused. Risk: write
Input Associates a domain with this account so its CDN traffic uses the account’s credits. Output: object \| any[]

purgeCdn

domains.purgeCdn Purge every file of a domain owned by this key from the CDN cache and from ShortPixel storage. example.com and www.example.com are purged separately. Risk: destructive
Input Clears the CDN cache for the domain. Output: object \| any[]

purgeStorage

domains.purgeStorage Delete every file ShortPixel stores for a domain owned by this key. example.com and www.example.com are purged separately. Risk: destructive
Input Deletes every optimized copy ShortPixel stores for the domain. Output: object \| any[]

read

domains.read Read the CDN status of a domain: 2 OK, 1 credits almost used up, -1 used up, -2 used up a while ago, -3 unreachable, plus quota and whether an account owns it. Needs no key. Risk: read
Input GET no-cdn.shortpixel.ai/read-domain/{domain}. Needs no key. Status 2 OK, 1 almost out of credits, -1/-2 out of credits, -3 unreachable. Output

revoke

domains.revoke Remove this key’s association with a CDN domain. Only the owner’s key can do it. Risk: destructive
Input Removes that association. Output: object \| any[]

set

domains.set Associate an existing CDN domain that has no owner with this key. Does not create the domain. Risk: write
Input Output: object \| any[]

usage

domains.usage Read CDN traffic and credits used per day for a domain owned by this key, with the account’s quotas. Risk: read
Input CDN traffic and credits used by the domain, with daily breakdowns (UsedCDN and UsedCredits are [] or false when there is no usage yet). Output

Images

adaptive

images.adaptive Fetch an image through the Adaptive Images CDN with the given resize, crop, quality and format settings, and return it base64 with its size and type. Uses the domain’s CDN traffic and credits. Risk: read
Input Fetches that link and returns the optimized file. The first fetch of an image can return the original while ShortPixel optimizes it. Output

adaptiveUrl

images.adaptiveUrl Build an Adaptive Images CDN URL that resizes, crops, compresses and converts an image on the fly. Makes no request; the image domain must be associated with the account (domains.add). Risk: read
Input Builds a https://cdn.shortpixel.ai/<client>/<settings>/<image URL> link. Makes no request and costs nothing until someone opens the link. Output

checkUpload

images.checkUpload Check uploaded files that were still processing, by the OriginalURL images.upload returned. Only checks the status; pass the same settings as the upload. Risk: read
Input POST /v2/post-reducer.php with file_urls (the OriginalURL values images.upload returned). Does not upload anything again. Output: unknown

cleanup

images.cleanup Drop optimized results for up to 100 image URLs from ShortPixel, so the next optimize of the same URL starts fresh. The download URLs stop working. Risk: destructive
Input POST /v2/cleanup.php. Deletes ShortPixel’s stored optimized copies of the URLs, so the next optimize runs again and costs again. Output: object \| any[]

optimize

images.optimize Optimize up to 100 public image or PDF URLs (Reducer API): lossy, glossy or lossless, resize or AI smart crop, AI upscale, AI background removal, WebP/AVIF conversion. Spends one credit per image that shrinks by more than 5%; each extra WebP/AVIF copy (convertto +webp/+avif) and the AI options (upscale, background removal) use more credits. Status.Code 1 means still processing: call again with the same URLs; 2 means done, with download URLs and sizes. Risk: destructive
Input POST /v2/reducer.php with urllist (up to 100 URLs). wait (0-30 s) sets how long ShortPixel waits before answering; Status.Code 1 means still processing, so call again with the same URLs until it is 2. Download URLs in the result expire after about an hour.
Output: unknown

optimizeSync

images.optimizeSync Optimize one public image URL and return the optimized file itself, base64 (reducer-sync). Same settings and credit cost as images.optimize. Risk: destructive
Input POST /v2/reducer-sync.php. Waits for one image and returns the optimized file itself (base64), not URLs. includeData false returns only the type and size. Output

status

images.status Check whether ShortPixel has a result for an image URL sent to images.optimize (code 0 Not found when it has none). Risk: read
Input POST /v2/image-status.php. Code 0 means ShortPixel has no record of the URL, 2 means it is optimized. Output

upload

images.upload Upload up to 10 image files (base64) and optimize them (Post-Reducer API). Same settings and credit cost as images.optimize. A file still processing (code 1) returns a temporary OriginalURL: poll it with images.checkUpload instead of uploading again. Risk: destructive
Input POST /v2/post-reducer.php as multipart, up to 10 files given as base64. The answer’s OriginalURL is a temporary copy; poll it with images.checkUpload.
Output: unknown