Hosted in Germany • GDPR-ready

How to Use the AnythingLLM REST API

Integrate private document chat into your app with the AnythingLLM REST API. Upload documents, manage workspaces, and query embeddings programmatically—all without vendor lock-in or per-token charges.

CCRMAAnalyticsAAutomationBBlogFForms
What is RAG?

The AnythingLLM REST API gives you RAG in 3 minutes

AnythingLLM is a full-stack Retrieval-Augmented Generation (RAG) platform. It chunks your documents, embeds them into a vector database, and retrieves the most relevant context when you ask a question. Then it sends that context plus your query to an LLM for an answer.

The REST API lets you automate this entire pipeline:

  • Upload documents to workspaces via /api/documents/upload
  • Query documents with /api/workspaces/{id}/chat
  • Manage users, LLM providers, and embeddings programmatically
  • Receive webhook notifications when documents are indexed

Why AnythingLLM API beats ChatGPT API for document chat

ChatGPT API charges $0.01-0.05 per request and sends your data to OpenAI servers. AnythingLLM runs on your infrastructure. Your documents stay private. You pay $40/month flat (on Opsily) regardless of query volume—no per-request billing.

You also get vendor flexibility: switch between Ollama (local), OpenAI, Anthropic, or HuggingFace without reindexing documents. ChatGPT locks you in.

Production deployments need managed hosting

Self-hosting AnythingLLM means managing backups, security patches, database optimization, and SSL certificates. Opsily handles all of this. Deploy on Opsily in 3 minutes. Get automatic updates, GDPR-compliant German data centers, daily encrypted backups, and SSL—included.

Get Started with the AnythingLLM API

From zero to live API in 3 minutes. No Docker, no DevOps required.

console.opsily.com/deploy
1
App
2
Region
3
Plan
4
Domain

Choose Your App

Select an app to get started.

1

Deploy AnythingLLM

Click Install on Opsily. We provision a managed instance with PostgreSQL, Milvus, and Ollama pre-configured. No setup. No waiting.

2

Get Your API Key

Log in. Go to Settings > API Keys. Generate a new key. Copy it. Use it in your requests: curl -H 'Authorization: Bearer YOUR_KEY' https://your-instance.opsily.com/api/...

3

Upload Documents

POST to /api/documents/upload with a PDF, text file, or web URL. AnythingLLM chunks it, embeds it into Milvus, and indexes it. Takes seconds for small documents.

4

Start Querying

POST to /api/workspaces/{id}/chat with your question. AnythingLLM retrieves context from your documents and returns the LLM's answer. Zero vendor lock-in.

API Examples

Python example: Chat with your documents

import requests

BASE_URL = "https://your-instance.opsily.com/api"
API_KEY = "sk_..."
WORKSPACE_ID = "workspace_123"

headers = {"Authorization": f"Bearer {API_KEY}"}

# Chat with documents
response = requests.post(
    f"{BASE_URL}/workspaces/{WORKSPACE_ID}/chat",
    headers=headers,
    json={"message": "Summarize our privacy policy"}
)

print(response.json()["response"])  # LLM's answer based on your documents

JavaScript example: Embed in your web app

const chatWithDocuments = async (question) => {
  const response = await fetch(
    `https://your-instance.opsily.com/api/workspaces/workspace_123/chat`,
    {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${API_KEY}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ message: question })
    }
  );
  const data = await response.json();
  return data.response;
};

Both examples use the same endpoints. Both work on Opsily managed hosting or self-hosted infrastructure. No vendor lock-in.

Why Managed Hosting for Your API

Self-hosting means ops burden. Opsily eliminates it.

Deploy in 3 minutes

No Docker, no Linux knowledge, no VPS shopping. Click Install. We set up AnythingLLM, PostgreSQL, Milvus, Ollama, SSL, and backups. While you're reading this, it's already live. Self-hosting takes 2-4 hours for experienced engineers. For non-technical founders, it's a week. Opsily removes that entire burden. You start querying documents immediately.

GDPR-compliant by default

Documents stay in German data centers. No US data transfer. No compliance paperwork. Your legal team sleeps better. Self-hosting means you're responsible for encryption, access logs, backups, and audit trails. One mistake means GDPR violations and fines. Opsily handles this end-to-end. We're GDPR-certified. You get compliance without the headache.

Automatic updates and patches

When AnythingLLM releases a security patch or new feature, we test it and deploy it to your instance with zero downtime. You never patch manually. You never debug failed upgrades. Self-hosting means you're on the hook for every update. Miss a security patch and you're liable. Opsily keeps you secure while you focus on your product.

Built for teams who need reliability

99.9%
Uptime SLA
Daily
Backups
0
Ops burden
3 min
Deploy time
App Catalog

Works Best With

AnythingLLM integrates with these apps on the same Opsily instance. No extra charges. No multi-server complexity.

AI & LLM Tools

Private AI document chat that works with any LLM, anywhere

AnythingLLM logo: a white stylized 'a' inside a light blue circle.
AnythingLLM

Managed AnythingLLM Pricing

All plans include AnythingLLM, Ollama, PostgreSQL, Milvus vector database, daily backups, SSL, automatic updates, and GDPR-compliant German hosting. No per-query fees. No per-document overage. No surprise bills.

Monthly
Annual

Loading pricing...

Your Data Is Secure

Enterprise-grade infrastructure for your documents.

GDPR Compliant

Documents stored in German data centers with full data sovereignty. No US data transfer. Complies with eIDAS and GDPR Article 32 encryption requirements.

Automatic SSL/TLS

HTTPS encryption on all connections. Certificates auto-renew. Your API keys and document queries are encrypted in transit. No man-in-the-middle attacks.

Daily Encrypted Backups

Automated daily snapshots of your database and documents. Stored geographically redundant. 7-day retention. Recoverable in minutes if disaster strikes.

Open Source Auditable

AnythingLLM is MIT-licensed open source. You can inspect the code. No hidden data collection. No telemetry. No vendor tracking. Full transparency.

Zero Vendor Lock-in

Export your documents and workspace settings anytime. Switch to self-hosting or another provider. Your data is yours. AnythingLLM uses standard formats: PostgreSQL, Milvus vector database, PDF/text files.

Questions About the AnythingLLM API

Everything you need to know about integrating document chat into your app.

Generate an API key from Settings > API Keys in your AnythingLLM instance. Pass it in the Authorization header: `Authorization: Bearer sk_your_api_key`. API keys have no expiration date but can be revoked anytime. Store keys securely—never commit them to GitHub. Use environment variables or secret managers (like .env files or HashiCorp Vault) in production.

Deploy AnythingLLM API Today

Get document chat live in 3 minutes. No credit card required. No ops required. Your documents stay private.