> ## 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.

# Developers API

> Developer documentation for IntegrationCompressFunction and the website flow required to get an API key.

## Overview

SmartPNG Integration API is a synchronous image compression API designed for backend services, CMS plugins, and automation flows.

It exposes three endpoints:

| Endpoint    | Method | Purpose                                                            |
| ----------- | ------ | ------------------------------------------------------------------ |
| `/compress` | `POST` | Compress an uploaded image and return the optimized file as base64 |
| `/validate` | `POST` | Validate an API key and return the current credit balance          |
| `/health`   | `GET`  | Check service availability                                         |

## Quick facts

| Topic             | Value                                                  |
| ----------------- | ------------------------------------------------------ |
| Base URL          | `https://integration.smartpng.com/api`                 |
| Authentication    | `api_key` passed in the request body or multipart form |
| File size limit   | `10 MB` per file                                       |
| Supported formats | `PNG`, `JPEG`, `WebP`, `AVIF`                          |
| Credit usage      | `1` successful compression consumes `1` credit         |
| Free usage        | `500` free credits per account every month             |

## Typical flow

1. Create a SmartPNG account and generate an API key from the dashboard.
2. Call `POST /validate` to confirm the key and available credits.
3. Call `POST /compress` with `multipart/form-data`.
4. Decode the returned `compressed_data` field and write it back to a file or upload target.

## Website setup guides

* Follow [Get API Key](/guides/get-api-key) to see the exact `smartpng-vue` website flow.
* Follow [Send Your First Request](/guides/first-request) to validate a key and compress a file.

## API reference

* Start with [API Overview](/api-reference/introduction).
* Use the endpoint pages for request and response details:
  * [POST /compress](/api-reference/compress)
  * [POST /validate](/api-reference/validate)
  * [GET /health](/api-reference/health)
