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

# REST API Overview

> Use Ragrails over HTTP.

The Ragrails REST API exposes the same pipeline as the SDK through HTTP. Use it when your application is not Python, when you want a service boundary around indexing and chat, or when clients need to upload documents directly.

```bash theme={null}
pip install "ragrails[server-qdrant]"
ragrails-api
```

The server starts on `http://127.0.0.1:8000`.

| Tool           | URL                                     |
| -------------- | --------------------------------------- |
| Swagger UI     | `http://127.0.0.1:8000/docs`            |
| ReDoc          | `http://127.0.0.1:8000/redoc`           |
| OpenAPI schema | `http://127.0.0.1:8000/v1/openapi.json` |
| Health check   | `GET /v1/health`                        |

## Workflows

| Workflow                       | Endpoint                    | Use it for                                               |
| ------------------------------ | --------------------------- | -------------------------------------------------------- |
| [Ingest](/usage/server/ingest) | `POST /v1/pipelines/ingest` | Extract, chunk, embed, and store content in one request. |
| [Query](/usage/server/query)   | `POST /v1/pipelines/query`  | Embed a search query and retrieve matching chunks.       |
| [Chat](/usage/server/chat)     | `POST /v1/chat`             | Retrieve context and generate a grounded answer.         |

## Pipeline

Start with the [pipeline overview](/usage/server/pipeline-overview), or call individual stages when you want to inspect or persist each intermediate JSON result.

| Stage                                  | Endpoints                                             | Details                                                                     |
| -------------------------------------- | ----------------------------------------------------- | --------------------------------------------------------------------------- |
| [Extraction](/usage/server/extraction) | `/v1/ingest/url`, `/v1/ingest/docs`, `/v1/ingest/api` | Turn websites, files, uploads, and API responses into normalized documents. |
| [Chunking](/usage/server/chunking)     | `/v1/chunk`                                           | Split documents into retrievable chunks.                                    |
| [Embedding](/usage/server/embedding)   | `/v1/embed`                                           | Generate vectors for chunks.                                                |
| [Storing](/usage/server/storing)       | `/v1/store`, `/v1/edit`, `/v1/delete`                 | Upsert, replace, and remove stored chunks.                                  |
| [Retrieval](/usage/server/retrieval)   | `/v1/retrieve`                                        | Search and optionally rerank stored chunks.                                 |
| [Chat](/usage/server/chat)             | `/v1/chat`, `/v1/chat/stream`                         | Run one-shot or streaming chat.                                             |

## Streaming

Streaming endpoints return `text/event-stream`:

| Endpoint                     | Streams                                                      |
| ---------------------------- | ------------------------------------------------------------ |
| `POST /v1/ingest/url/stream` | URL crawl progress and final scrape result                   |
| `POST /v1/chat/stream`       | Retrieval/generation progress, tokens, and final chat result |

## Server Extras

| Stack    | Install                                   |
| -------- | ----------------------------------------- |
| Qdrant   | `pip install "ragrails[server-qdrant]"`   |
| Pinecone | `pip install "ragrails[server-pinecone]"` |
| Weaviate | `pip install "ragrails[server-weaviate]"` |

Most request and response bodies are JSON. Document uploads use multipart form data. Use the OpenAPI schema when generating clients.
