openapi: 3.2.0 info: title: LiteLLM Rag API description: "Enterprise Edition \n\nProxy Server to call 100+ LLMs in the OpenAI format. [**Customize Swagger Docs**](https://docs.litellm.ai/docs/proxy/enterprise#swagger-docs---custom-routes--branding)\n\n\U0001F449 [```LiteLLM Admin Panel on /ui```](/ui). Create, Edit Keys with SSO. Having issues? Try [```Fallback Login```](/fallback/login)\n\n\U0001F4B8 [```LiteLLM Model Cost Map```](https://models.litellm.ai/).\n\n\U0001F50E [```LiteLLM Model Hub```](/ui/model_hub_table). See available models on the proxy. [**Docs**](https://docs.litellm.ai/docs/proxy/ai_hub)" version: 1.95.0 x-operator: institution x-provenance: method: probed source: https://llmproxy.uva.nl/openapi.json retrieved: '2026-08-19' note: Document is generated by the LiteLLM proxy software the University of Amsterdam self-hosts; the deployment, the key issuance and the host (llmproxy.uva.nl, UvA Azure) are the institution's. servers[] added by API Evangelist because the served document omits it; nothing else altered. servers: - url: https://llmproxy.uva.nl description: University of Amsterdam / Amsterdam University of Applied Sciences shared AI gateway tags: - name: rag paths: /rag/ingest: post: tags: - rag summary: Rag Ingest description: "RAG Ingest endpoint - all-in-one document ingestion pipeline.\n\nSupports form upload (for files) or JSON body (for URLs).\n\n## Form upload (for files):\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/ingest\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -F file=\"@document.pdf\" \\\n -F 'ingest_options={\"vector_store\": {\"custom_llm_provider\": \"openai\"}}'\n```\n\n## JSON body (for URLs):\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/ingest\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"file_url\": \"https://example.com/document.pdf\",\n \"ingest_options\": {\"vector_store\": {\"custom_llm_provider\": \"openai\"}}\n }'\n```\n\n## Bedrock:\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/ingest\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -F file=\"@document.pdf\" \\\n -F 'ingest_options={\"vector_store\": {\"custom_llm_provider\": \"bedrock\"}}'\n```" operationId: rag_ingest_rag_ingest_post responses: '200': description: Successful Response content: application/json: schema: {} security: - APIKeyHeader: [] /v1/rag/ingest: post: tags: - rag summary: Rag Ingest description: "RAG Ingest endpoint - all-in-one document ingestion pipeline.\n\nSupports form upload (for files) or JSON body (for URLs).\n\n## Form upload (for files):\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/ingest\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -F file=\"@document.pdf\" \\\n -F 'ingest_options={\"vector_store\": {\"custom_llm_provider\": \"openai\"}}'\n```\n\n## JSON body (for URLs):\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/ingest\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"file_url\": \"https://example.com/document.pdf\",\n \"ingest_options\": {\"vector_store\": {\"custom_llm_provider\": \"openai\"}}\n }'\n```\n\n## Bedrock:\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/ingest\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -F file=\"@document.pdf\" \\\n -F 'ingest_options={\"vector_store\": {\"custom_llm_provider\": \"bedrock\"}}'\n```" operationId: rag_ingest_v1_rag_ingest_post responses: '200': description: Successful Response content: application/json: schema: {} security: - APIKeyHeader: [] /rag/query: post: tags: - rag summary: Rag Query description: "RAG Query endpoint - search vector store, optionally rerank, and generate LLM response.\n\nThis endpoint:\n1. Extracts the query from the last user message\n2. Searches the vector store for relevant context\n3. Optionally reranks the results\n4. Generates an LLM response with the retrieved context\n\n## Example Request:\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/query\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini\",\n \"messages\": [{\"role\": \"user\", \"content\": \"What is LiteLLM?\"}],\n \"retrieval_config\": {\n \"vector_store_id\": \"vs_abc123\",\n \"custom_llm_provider\": \"openai\",\n \"top_k\": 5\n }\n }'\n```\n\n## With Reranking:\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/query\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini\",\n \"messages\": [{\"role\": \"user\", \"content\": \"What is LiteLLM?\"}],\n \"retrieval_config\": {\n \"vector_store_id\": \"vs_abc123\",\n \"custom_llm_provider\": \"openai\",\n \"top_k\": 10\n },\n \"rerank\": {\n \"enabled\": true,\n \"model\": \"cohere/rerank-english-v3.0\",\n \"top_n\": 3\n }\n }'\n```" operationId: rag_query_rag_query_post responses: '200': description: Successful Response content: application/json: schema: {} security: - APIKeyHeader: [] /v1/rag/query: post: tags: - rag summary: Rag Query description: "RAG Query endpoint - search vector store, optionally rerank, and generate LLM response.\n\nThis endpoint:\n1. Extracts the query from the last user message\n2. Searches the vector store for relevant context\n3. Optionally reranks the results\n4. Generates an LLM response with the retrieved context\n\n## Example Request:\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/query\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini\",\n \"messages\": [{\"role\": \"user\", \"content\": \"What is LiteLLM?\"}],\n \"retrieval_config\": {\n \"vector_store_id\": \"vs_abc123\",\n \"custom_llm_provider\": \"openai\",\n \"top_k\": 5\n }\n }'\n```\n\n## With Reranking:\n```bash\ncurl -X POST \"http://localhost:4000/v1/rag/query\" \\\n -H \"Authorization: Bearer sk-1234\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"gpt-4o-mini\",\n \"messages\": [{\"role\": \"user\", \"content\": \"What is LiteLLM?\"}],\n \"retrieval_config\": {\n \"vector_store_id\": \"vs_abc123\",\n \"custom_llm_provider\": \"openai\",\n \"top_k\": 10\n },\n \"rerank\": {\n \"enabled\": true,\n \"model\": \"cohere/rerank-english-v3.0\",\n \"top_n\": 3\n }\n }'\n```" operationId: rag_query_v1_rag_query_post responses: '200': description: Successful Response content: application/json: schema: {} security: - APIKeyHeader: [] components: securitySchemes: APIKeyHeader: type: apiKey description: Bearer token in: header name: x-litellm-api-key