---
title: "Process a document for RAG tuning"
method: POST
path: "/ragtune"
tags: ["Ragtune"]
---

# Process a document for RAG tuning

`POST /ragtune`

## Request

- Base URL: `https://apipie.ai`
- URL: `https://apipie.ai/ragtune`
- Auth: API key in header `Authorization`

Processes a document by extracting its content and generating embeddings to be used for RAG tuning.
Supported file types: **PDF**, **DOC**, **DOCX**, **TXT**, **CSV**, **XLS**, **XLSX**.

## Request body

- ProcessDocumentRequest
  - `collection_name` string
  - `url` string: URL of the document to process. Supported file types: PDF, DOC, DOCX, TXT, CSV, XLS, XLSX
  - `metatag` string: Optional metadata tag to associate with the document
  - `vector_provider` 'pinecone' | 'qdrant': Vector provider to use to store the collection

## Response `200`

Document processed and added to the specified collection

- ProcessDocumentResponse
  - `message` string
  - `result` object

## Other responses

- `400`: Collection or URL missing from the request
- `500`: Internal server error

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
