> ## Documentation Index
> Fetch the complete documentation index at: https://docs.smartpng.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Overview

> Authentication, limits, and response behavior for IntegrationCompressFunction.

## Base URL

```text theme={null}
https://integration.smartpng.com/api
```

## Authentication

This API does not use bearer tokens or custom headers.

Pass the API key in the request payload:

* `POST /compress`: include `api_key` as a multipart form field
* `POST /validate`: include `api_key` in the JSON body
* `GET /health`: no authentication required

## Compression model

* Processing is synchronous
* The compressed file is returned in the response as base64
* `1` successful compression consumes `1` credit
* Failed requests do not produce a successful compression result

## Interactive reference

Each endpoint page uses Mintlify's OpenAPI playground:

* Request examples appear in the right panel with language tabs
* The available languages are `curl`, `python`, `javascript`, `php`, `java`, and `csharp`
* Request fields are prefilled from the OpenAPI examples where possible
* Responses are grouped by status codes such as `200`, `400`, and `401`
* Requests can be sent directly from the page

## Limits

| Limit              | Value                                                 |
| ------------------ | ----------------------------------------------------- |
| Max file size      | `10 MB`                                               |
| Allowed MIME types | `image/png`, `image/jpeg`, `image/webp`, `image/avif` |

## Common error codes

| Status code | Meaning                                            |
| ----------- | -------------------------------------------------- |
| `400`       | Invalid request payload or unsupported file format |
| `401`       | Invalid API key                                    |
| `413`       | File exceeds the maximum size                      |
| `429`       | No credits remaining                               |
| `500`       | Internal server error                              |

## Endpoint list

| Method | Path        | Description                          |
| ------ | ----------- | ------------------------------------ |
| `POST` | `/compress` | Compress a single uploaded image     |
| `POST` | `/validate` | Validate an API key and read credits |
| `GET`  | `/health`   | Check service health                 |
