---
title: "Local API"
url: https://phatdev.net/en/docs/pixgamma/api
lang: en
updated: 2026-10-22
alternate:
  vi: https://phatdev.net/docs/pixgamma/api
markdown: https://phatdev.net/en/docs/pixgamma/api.md
---

# Local API

Part of the doc set: [PixGamma](https://phatdev.net/en/docs/pixgamma.md)

> pixgamma serve, endpoints, /v1/upscale parameters and response format.

PixGamma serves an HTTP API **on the Mac only** (default `127.0.0.1:8765`) for scripts, websites, apps and other tools. Turn it on in the app (the **API cục bộ** switch at the bottom left) or run:

```bash
pixgamma serve --port 8765
```

## Endpoints

| Endpoint | Does |
|---|---|
| `GET /health` | Status and version |
| `GET /v1/models` | Installed models |
| `POST /v1/analyze` | Send an image, get Auto's suggested settings |
| `POST /v1/upscale` | Send an image, get the upscaled image |

Images are sent as a binary request body (`--data-binary`).

```bash
curl --data-binary @photo.jpg \
  "http://127.0.0.1:8765/v1/upscale?mode=std&scale=2&format=jpg" -o photo-2x.jpg
```

## `/v1/upscale` parameters

| Parameter | Values |
|---|---|
| `mode` | `auto`, `standard`, `fidelity`, `art`, `lowres`, `recover` |
| `scale` or `width` / `height` | Output size |
| `denoise`, `sharpen`, `compression`, `detail`, `texture`, `contrast`, `dehalo` | 0–100 |
| `face`, `face_style`, `face_fidelity` | Face restoration, `realistic` or `creative`, identity strength |
| `creativity`, `resemblance`, `prompt` | Recover |
| `text`, `color` | `0` disables text protection, color preservation |
| `device` | `gpu`, `all`, `ane`, `cpu` |
| `format`, `quality` | `png`, `jpg`, `tiff`, `heic`; JPEG/HEIC quality |

## Response

- By default the image itself, with the JSON report in the `X-PixGamma-Report` header.
- Send `Accept: application/json` to get JSON with the report and a base64 image.

```bash
curl -s -H "Accept: application/json" --data-binary @photo.jpg \
  "http://127.0.0.1:8765/v1/upscale?scale=4" | jq '.report.passes, .report.seconds'
```

The API listens on `127.0.0.1` only and has no authentication; to reach it from other machines, put it behind an authenticating reverse proxy.
