Documentation menu

API reference

Strip metadata

POST /v1/strip-metadata removes metadata from an image or a PDF without re-encoding it.

Endpoint

POST/v1/strip-metadata

Removes metadata from one image or PDF and returns the file as the response body. Nothing is stored. The format stays the same. The picture or the pages are not re-encoded, so there is no loss of quality.

In a job, the same operation is named strip_metadata, with an underscore.

What is removed

InputRemovedKept
ImageCamera and lens details, GPS location, timestamps, software, XMP, IPTC and embedded thumbnails.The pixels, the orientation tag and the colour profile. Without those two an image can display sideways or with shifted colours.
PDFDocument metadata such as title, author, creator software and dates. The file is then rewritten, so the old values cannot be recovered from it.The pages and their content.
BMP imageNothing. BMP files carry no metadata.The file is returned unchanged, with a warning in the result.

Any other kind of file is refused with unsupported_input. To remove tags from audio, use compress with audio.strip_metadata=true.

Request

Authenticate with Authorization: Bearer $SMOL_API_KEY. Send the file in one of two forms. The file can be up to 25 MB (26,214,400 bytes), or 10 MB with a test key.

Raw body

The request body is the bytes of the file. Options go in the query string. Give the file's name with ?filename= or with a Content-Disposition request header. If both are present, the query parameter is used.

raw body
POST /v1/strip-metadata?filename=photo.jpg HTTP/1.1
Host: api.smolmac.com
Authorization: Bearer $SMOL_API_KEY
Content-Length: 1614027

<the bytes of the file>
  • Any Content-Type other than multipart/form-data is treated as a raw body. The header's value is not used to detect the file type.
  • Send a Content-Length header. It is required with a test key. With a live key a body without it is accepted and streamed.

Multipart form

Send multipart/form-data with these parts:

PartRequiredContent
fileYesThe file. Its name is taken from the part unless ?filename= is given.
optionsNoA JSON object of options, as text. It has the same shape as options on a job, for example {"image":{"format":"avif","quality":60}}.

Options may also be given in the query string of a multipart request. Where an option appears in both places, the query string wins, field by field.

The file name

The name is optional for most files. It is used for two things: to tell apart formats that share a container or have no signature (see type detection), and to name the file that comes back. Only the last path component is used.

Options

This endpoint has no options of its own. The only query parameter it uses is filename. Options that belong to other endpoints, such as image.quality, and a preset, are checked and then ignored. A parameter that is not a known option is refused with invalid_options.

Response

Status 200. The body is the file without its metadata. The details are in the headers.

HeaderTypeDescription
Content-TypestringThe media type of the returned file, for example image/avif.
Content-LengthintegerThe size of the returned file in bytes.
Content-Dispositionstringattachment with a file name: the name you sent, with its extension replaced by the output format's. file is used when you sent no name.
Cache-ControlstringAlways no-store.
Smol-Request-IdstringThe id of this request. Quote it to support.
Smol-VersionstringThe version of the API that answered, for example 2026-10-01.
Smol-Original-SizeintegerBytes received.
Smol-Output-SizeintegerBytes returned.
Smol-Savings-PercentnumberThe share of the original size that was saved, with one decimal. Negative when the output is larger.
Smol-Output-FormatstringThe format of the returned file, for example avif.
Smol-Kept-Originalbooleantrue when nothing smaller could be made and your input is returned. See Kept original.
Smol-Billedbooleantrue when the request was charged. Always false with a test key and for kept-original results.
Smol-ResultJSONThe full result object as compact JSON on one line. Characters outside printable ASCII are replaced by ?.
RateLimit-LimitintegerThe size of your rate limit bucket.
RateLimit-RemainingintegerRequests left in the bucket.
RateLimit-ResetintegerSeconds until the bucket is full again. See Limits.
  • Smol-Kept-Original is always false on this endpoint.
  • The saving is usually small, because metadata is small. A PDF can come back slightly larger after it is rewritten. The result then has increased: true and a negative Smol-Savings-Percent.
  • A successful request with a live key is billed as one image, for an image and for a PDF of any length. See Billing.

Errors

An error has a JSON body in place of the file. See Errors for the format and for what to do about each code.

CodeStatusWhen
missing_file400The body is empty, or the multipart form has no file part.
invalid_options400An option is unknown or has a value that is not allowed. The options part is not valid JSON.
bad_request400The multipart body cannot be parsed. A test key sent a raw body without Content-Length. The preset named does not exist.
missing_key401No Authorization header.
invalid_key401The key is not a valid key.
revoked_key401The key has been revoked.
no_payment_method402A live key on an account with no plan.
payment_required402A live key on an account with an unpaid invoice.
spend_cap_reached402The account has reached its monthly spend cap.
test_mode_sample_required402A test key sent a file that is not a published sample.
account_suspended403The account is suspended.
ip_not_allowed403The key may not be used from this IP address.
feature_not_enabled403The output would be HEIC, and HEIC output is not enabled for the account. This covers image.format=heic, a convert target of heic, and a HEIC file compressed with image.format left at original.
file_too_large413The file is over 25 MB, or over 10 MB with a test key.
unsupported_input415The file type is not recognised, or this endpoint does not handle it.
use_async_job415The file is a video or an office document. These need a job.
limit_exceeded422The file is over a pixel, page, frame or length limit.
encrypted_pdf422The PDF needs a password to open.
processing_failed422The file could not be processed. It may be damaged.
rate_limited429Too many requests per second.
concurrency_limited429Too many direct requests in progress at once.
internal500Something went wrong on our side.
engine_busy503The service is at capacity for a moment.
timeout504Processing took longer than 120 seconds.

Examples

curl -X POST "https://api.smolmac.com/v1/strip-metadata" \
  -H "Authorization: Bearer $SMOL_API_KEY" \
  --data-binary @IMG_2041.jpg \
  -o IMG_2041.clean.jpg

Example response

200 OK
HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Length: 2436008
Content-Disposition: attachment; filename="IMG_2041.jpg"; filename*=UTF-8''IMG_2041.jpg
Cache-Control: no-store
Smol-Version: 2026-10-01
RateLimit-Limit: 40
RateLimit-Remaining: 39
RateLimit-Reset: 1
Smol-Request-Id: req_T6wYc1NdP8qJx3Lm0ZsF
Smol-Original-Size: 2481220
Smol-Output-Size: 2436008
Smol-Savings-Percent: 1.8
Smol-Output-Format: jpg
Smol-Kept-Original: false
Smol-Billed: true
Smol-Result: {"kind":"image","input_format":"jpg","output_format":"jpg","original_size":2481220,"output_size":2436008,"savings_percent":1.8,"kept_original":false,"increased":false,"width":4032,"height":3024,"pages":null,"duration_seconds":null,"video_codec":null,"warnings":[]}

<the bytes of the file>