Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xcoder-es/media-cleaner-pro/llms.txt

Use this file to discover all available pages before exploring further.

MediaCleaner Pro embeds a JSON REST API directly in the binary. When you launch the application, the same process that runs the 10-stage deduplication pipeline also starts an Axum HTTP server on http://127.0.0.1:8080 by default. There is no separate daemon, container, or cloud service — every request is handled locally.

Base URL

http://{SERVER_HOST}:{SERVER_PORT}
Default: http://127.0.0.1:8080 Both SERVER_HOST and SERVER_PORT are configurable via the .env file in the same directory as the binary. See the Configuration section for all available variables.

OpenAPI Specification

The full OpenAPI 3.1 specification is auto-generated from the source code and served at runtime:
GET /api/openapi.json
You can paste that URL directly into tools like Swagger UI, Insomnia, or Scalar to get an interactive API explorer with request/response schemas for every endpoint.

Endpoints

Health Check

GET /health — Returns the service name and version string. Use this to verify the server is up before issuing pipeline commands.

Pipeline Status

GET /api/status — Returns the full StateResponse: stage list, processing stats, running/paused flags, and recent log messages.

Start Job

POST /api/start — Starts a new processing job. Accepts source directory, destination directory, and optional Hamming threshold override.

Pause / Resume / Cancel

POST /api/control — Sends a control action (pause, resume, or cancel) to the currently running job.

SSE Progress Stream

GET /api/progress — Server-Sent Events stream that emits a StateResponse every 500 ms. Connect once and receive live progress without polling.

Log Messages

GET /api/logs — Returns up to 1 000 recent log messages (timestamp, level, stage, message).

Browse Directories

GET /api/browse — Lists subdirectories under a given path along with the image count in each directory. Used by the embedded UI’s directory picker.

OpenAPI Spec

GET /api/openapi.json — Machine-readable OpenAPI 3.1 document describing all schemas and operations.

Endpoint Summary

MethodPathDescription
GET/healthHealth check — returns version
GET/api/statusCurrent pipeline state, stats, and logs
POST/api/startStart a processing job
POST/api/controlPause, resume, or cancel the running job
GET/api/progressSSE stream of StateResponse (every 500 ms)
GET/api/logsRecent log messages (up to 1 000)
GET/api/browseList subdirectories with image counts
GET/api/openapi.jsonOpenAPI 3.1 specification

Content Types

All request bodies and JSON responses use Content-Type: application/json. The single exception is the progress stream:
EndpointContent-Type
All othersapplication/json
GET /api/progresstext/event-stream
When posting a request body (e.g. POST /api/start), set the Content-Type: application/json header explicitly.

CORS

The server registers a tower-http CORS layer so that the embedded frontend — served from the same origin — can make requests freely. If you build a custom frontend or script running on a different port or origin, requests will succeed because the CORS policy is permissive by default.

Health Check Example

The simplest way to confirm the API is reachable is to hit /health:
curl http://127.0.0.1:8080/health
Expected response:
{
  "status": "ok",
  "service": "mediacleaner-pro",
  "version": "0.1.4-alpha"
}
The version field is embedded at compile time from the crate’s Cargo.toml and will reflect whichever release binary you are running.

Build docs developers (and LLMs) love