Reduce image size API

Reduce image size API, ImageShrink connects the job to your own app: you send the file, poll the job and download the output. The endpoints run on the server; there is no browser in the loop.

Quick start

  1. Create a key in the Developer API section of your account; the plain-text key is shown only when it is created.
  2. Send the request to https://api.pixepi.com with the Authorization: Bearer <key> header.
  3. Poll the job in the response with GET https://api.pixepi.com/api/v1/jobs/{id}; once the status is done, download the output from the download_url.

Example request

curl -X POST "https://api.pixepi.com/api/v1/apps/gorsel-kucult/run" \
  -H "Authorization: Bearer $PIXEPI_KEY" \
  -F "[email protected]" \
  -F "options[quality]=82" \
  -F "options[format]=same"

curl -H "Authorization: Bearer $PIXEPI_KEY" "https://api.pixepi.com/api/v1/jobs/42"

This tool's endpoints

MethodPathWhat it does
POST/runRuns the tool, starts a job and returns the result.

Options

Options are sent as options[<field>]; a field left empty uses its default.

FieldValuesDefault
options[quality]
Quality
40–9582
options[max_side]
Long-edge limit (optional)
0–6000empty
options[format]
Output format
same · jpeg · webp · pngsame
options[auto_rotate]
Auto-correct phone orientation
enabled · disabledenabled

Shared endpoints

MethodPathWhat it does
GET/api/v1/appsAPI catalog
GET/api/v1/apps/gorsel-kucultTool contract
GET/api/v1/jobs/{id}Job status
GET/api/v1/jobs/{id}/downloadDownload the job output
GET/api/v1/usageUsage summary
GET/api/v1/openapi.jsonOpenAPI 3.1 document

Limits

  • At most 100 MB per file.
  • Batch: send the same file field more than once.
  • Quota and plan information is tied to your account; check the current state with GET /api/v1/usage.

Error codes

CodeMeaning
unauthorizedThe API key is missing or invalid.
forbiddenThis operation is not allowed with this key.
not_foundTool, job or record not found (404 also for cross-account access).
invalid_inputInput failed validation (missing or malformed field, invalid date, and so on).
invalid_requestThe request is malformed.
too_largeFile or body size exceeds the limit.
unsupported_mediaThe file type is not accepted.
not_supportedThis tool cannot run on this endpoint (stateful app).
not_readyThe job is not finished yet.
expiredThe output has expired.
no_outputThere is no output to download for the job.
invalid_pathInvalid output path.
quota_exceededQuota or rate limit exceeded.
rate_limitedToo many requests in a short time; wait a bit and try again.
csrfBrowser form verification failed (the external API uses keys).
conflictThe operation conflicts with the current state.
unavailableThe tool is temporarily closed.
internal_errorUnexpected server error.

Documents

Frequently asked questions

Where do I get an API key?

Create a key in the Developer API section of your account; the key is shown once, at the moment it is created.

How is a request sent?

The endpoints run at https://api.pixepi.com; every request includes the "Authorization: Bearer <key>" header.

Which files does the ImageShrink API accept?

Accepted types: JPG · JPEG · PNG · WEBP. The limit is 100 MB per file; the options are the same as on the tool page.

How do I read an error response?

The error body carries {ok:false, error, code, request_id} fields; code values are in the error codes table.