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

# RAG PDF Highlighter API — Overview and Getting Started

> The RAG PDF Highlighter REST API accepts a PDF URL and document chunks, then returns an annotated PDF. Base URL, auth, and request format explained.

The RAG PDF Highlighter API is a REST interface for the Callisto PDF Highlighter microservice (v0.1.1). You send it a publicly accessible PDF URL together with a list of text chunks from your RAG pipeline, and it returns a binary PDF with every chunk visually highlighted in place. This makes it straightforward to show end-users exactly which passages a retrieval system used to generate an answer.

## Base URL

Every request is made to the host where you have deployed your own instance of the service:

```
http://your-host:8000
```

Replace `your-host` with the hostname or IP address of your deployment. There is no shared cloud endpoint — you run the service yourself.

<Note>
  No API key or authentication is required. The service is designed to run inside a trusted network or behind your own authentication layer. Do not expose it to the public internet without adding an authentication proxy.
</Note>

## Content-Type

All requests that include a body must set the `Content-Type` header to `application/json`:

```
Content-Type: application/json
```

## Response Format

On success, the API returns a binary PDF file:

* **Content-Type:** `application/pdf`
* **Content-Disposition:** `attachment; filename="highlighted.pdf"`
* **Body:** raw PDF bytes

On failure, the API returns a JSON object with a single `detail` field describing the error:

```json theme={null}
{"detail": "Failed to download PDF: HTTP 404"}
```

See the [Errors](/api/errors) page for a full list of error codes and their causes.

## Endpoints

The API exposes two endpoints:

| Method | Path         | Description                                                  |
| ------ | ------------ | ------------------------------------------------------------ |
| GET    | `/`          | Health check — verify the service is running                 |
| POST   | `/highlight` | Highlight text chunks in a PDF and return the annotated file |

<CardGroup cols={2}>
  <Card title="GET /" icon="heart-pulse" href="/api/health-check">
    Verify your RAG PDF Highlighter instance is live and responding to requests.
  </Card>

  <Card title="POST /highlight" icon="highlighter" href="/api/highlight">
    Submit a PDF URL and document chunks to receive an annotated, highlighted PDF.
  </Card>
</CardGroup>
