# Introduction

realpng checks images and videos for signs of AI generation and optimizes them, over a REST API or an MCP server your agent can call.

## Check and optimize

**Check** tells you whether an image reads as AI, through `POST /audit` or the MCP tool `audit_image`. It answers in the same request with a verdict, a score and the three lanes it weighed: pixels, watermark and provenance. See [Check an image](/docs/guides/check-an-image).

**Optimize** re-renders and re-grains an image for posting, through `POST /optimize` or the MCP tool `process_image`. Nothing is cropped, an image over 2048 px on its long edge comes back at 2048, and you get back a PNG with an [optimization score](/docs/guides/optimize-an-image#read-the-optimization-score). An optimization runs as a job, so `POST /optimize` returns at once with its id, as [Optimize an image](/docs/guides/optimize-an-image) explains.

Both take videos too, as jobs you poll, and give back an MP4 with each frame's reading. See [Check and optimize a video](/docs/guides/check-and-optimize-a-video).

Both spend credits from your plan. [Credits and limits](/docs/credits-and-limits) lists what each costs.

## API or MCP

| Surface    | Use it when                                                                                                                                                                                                           |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| REST API   | Your own code, pipelines or automations call realpng. Only the API takes `callback_url` for optimizations and `detail=full` for a check's raw engine report.                                                          |
| MCP server | An agent such as Claude Code, Codex, Cursor or Claude Desktop calls realpng as tools while it works. An optimization waits inside the tool call and hands back an id to resume. See the [six tools](/docs/mcp/tools). |

Both need a paid plan and take the same [API key](/docs/authentication). They share one pool of credits and the same [rate limits](/docs/credits-and-limits#rate-limits). [Connect an agent](/docs/mcp) sets up the MCP server.

## Base URL

Every endpoint lives under https://realpng.com/api/v1. Request bodies and responses are JSON, apart from the optimized file itself. Every call needs an [API key](/docs/authentication), except downloading an optimized file.

The OpenAPI 3.1 spec is at https://realpng.com/api/v1/openapi.json and needs no key. Every error has one JSON shape with a stable code, listed in [Errors](/docs/errors).

## Build with an agent

Paste this prompt into your coding agent to start an integration.

```text
Add realpng to this project to check images for AI generation and optimize them.
Read https://realpng.com/docs/llms.txt before anything else, then follow https://realpng.com/docs/quickstart.md.
Read the API key from the REALPNG_API_KEY environment variable. Never write the key into code or logs.
```

Every page is also available as Markdown by appending `.md` to its URL, for example `/docs/quickstart.md`.

## Next steps

- [Quickstart](/docs/quickstart): Create a key and check your first image.

- [Connect an agent](/docs/mcp): Add the MCP server to Claude Code, Codex, Cursor or Claude Desktop.

- [API reference](/docs/api-reference/audit-image): Every endpoint, its fields and responses.
