DEV Community

HopBase
HopBase

Posted on Originally published at hop-base.com

Connect RAGFlow or Dify to Multiple LLMs with One API Key

To connect RAGFlow or Dify to multiple LLMs with one API key, use HopBase's native integrations: select the built-in HopBase model provider in RAGFlow (merged in infiniflow/ragflow PR #22001) or install the official hopbase/hopbase plugin from the Dify Marketplace (merged in langgenius/dify-plugins PR #3588), then paste one HopBase API key. Both integrations default to https://api.hop-base.com/v1 and validate or discover the exact model IDs scoped to your key via GET /v1/models; older self-hosted versions can still use a generic OpenAI-compatible provider with the same URL. Attach any number of non-overlapping model groups to that key to run DeepSeek, GPT, Claude, Gemini, Qwen, GLM and Kimi side by side, keep your existing embedding provider so you never re-index vectors, and issue one quota-capped key per knowledge-base app for clean cost attribution.

Two ways to connect: official integration first, OpenAI-compatible fallback

  • RAGFlow (built-in provider): infiniflow/ragflow PR #22001 (merged 2026-11-13) adds HopBase as a built-in model provider with dynamic model discovery via GET /v1/models and default URL https://api.hop-base.com/v1. If you run an older self-hosted RAGFlow build released before PR #22001, pick OpenAI-API-Compatible and enter https://api.hop-base.com/v1 manually.
  • Dify (official Marketplace plugin): install hopbase/hopbase from the Dify Marketplace (langgenius/dify-plugins PR #3588, merged 2026-11-01). The plugin verifies your key with a zero-cost GET /v1/models check, ships predefined chat models with streaming, tool calling and vision flags configured, and lets you add any custom chat model ID returned for your key.
  • Custom LangChain RAG pipelines: if your team builds retrieval pipelines in Python with LangChain, HopBase is listed in the official LangChain provider directory (langchain-ai/docs PR #7636) with streaming, tool calling, structured output and multimodal support over OpenAI-compatible and Anthropic-compatible base URLs.

Step 1: Create a key and confirm the model IDs

  1. In the HopBase console, create an API key and select every model group your knowledge base needs (there is no cap on the number of non-overlapping groups on a single key). The key can call only models belonging to those groups.
  2. Set a USD spend cap and an expiry date on the key, plus an optional IP allowlist set to the egress IP of your RAGFlow or Dify server.
  3. Query the models available to that key and copy the exact IDs — never guess names or strip suffixes:
curl https://api.hop-base.com/v1/models \
  -H "Authorization: Bearer sk-your-key"
Enter fullscreen mode Exit fullscreen mode

A misspelled model name, or a model outside the key's groups, returns HTTP 404 model_not_found.

Step 2: Configure RAGFlow

  1. Open Model providers under user settings, select the built-in HopBase provider, and paste sk-your-key (the default URL https://api.hop-base.com/v1 is prefilled).
  2. On older self-hosted RAGFlow releases that do not yet list HopBase, select OpenAI-API-Compatible, set Base URL to https://api.hop-base.com/v1 (including /v1), and set API Key to sk-your-key.
  3. Enable or add models using the exact IDs returned by /v1/models; enable vision only on models that accept image input, and enable tool calling only where supported.
  4. In System Model Settings, point the default chat model at your HopBase model. RAGFlow also requires a default embedding model — leave that on your existing embedding provider.

Step 3: Configure Dify

  1. As a workspace owner or admin, open the Dify Marketplace, search for HopBase (hopbase/hopbase), and install the official model provider plugin.
  2. Open HopBase under Model Providers and enter sk-your-key (leave the API endpoint at the default https://api.hop-base.com/v1). Saving runs GET /v1/models to verify the key without spending quota.
  3. Predefined models whose groups are attached to your key work immediately in knowledge-base apps and workflow LLM nodes. To use newer releases (such as gpt-6.2-sol, qwen4-max or kimi-k3.1-pro), add a custom model under the HopBase provider with the exact ID from /v1/models, set its context window from the model card, and enable vision only if the model reads images.

What about Claude?

A HopBase key that includes a Claude group works over both protocols: you can call Claude models (such as claude-sonnet-5-5 or claude-opus-5-5) directly through the OpenAI Chat Completions surface (https://api.hop-base.com/v1/chat/completions) inside RAGFlow's HopBase provider or Dify's hopbase/hopbase plugin, or configure a native Anthropic provider with Base URL https://api.hop-base.com (without /v1) using the same key when you want Anthropic-native adaptive thinking or explicit cache-control blocks.

Pick models by role

Role Example model IDs (confirm with /v1/models) Notes
Everyday retrieval Q&A deepseek-v4.1-flash-1017, qwen3.8-flash, gpt-6-luna Low per-query cost for high-volume RAG traffic
Complex reasoning / synthesis gpt-6.2-sol, qwen4-max, claude-sonnet-5-5 Best for multi-hop synthesis, policy comparison and agent nodes
Long documents (full contracts, manuals) kimi-k3.1-pro, glm-5.3-flash, deepseek-v4.1-flash-1017 All offer ~1M token context windows
Images and scanned pages glm-5.3-flash, deepseek-v4.1-flash-1017, gemini-3.8-flash Accept image URLs and base64; safe to enable vision
Images (base64 only) kimi-k3.1-pro, kimi-k3 Accept base64 images only; passing an image URL returns 400

Turn on vision only for models that read images. For example, deepseek-v4-pro-202606 is text-only: a request carrying an image returns 400 before reaching the model and is not billed.

Embeddings and rerank: keep your current provider

HopBase's public model catalog focuses on chat, reasoning and multimodal generation and does not include embedding models. Keep vectorizing and reranking with your current provider. Swapping an embedding model usually forces a full re-index, whereas swapping the chat model does not — routing only the generation layer through HopBase lets you upgrade or switch LLMs without touching existing vector stores.

One key per knowledge-base app, cost split per app

  1. One app, one key: issue separate keys for customer-support RAG, legal search and internal engineering docs. A leaked credential or runaway workflow loop can be revoked without disrupting other apps.
  2. Hard key spend caps: once a key reaches its USD spend limit, requests are rejected before execution (HTTP 402 insufficient_quota), protecting your account balance.
  3. Department budgets: service keys not tied to an individual member can be assigned directly to a department with a monthly quota that resets automatically on your chosen billing day (1st–28th).
  4. Export and reconcile: filter the console Usage page by key or department and export itemised USD CSV logs for line-by-line reconciliation of model, token counts and actual USD charge. Requests rejected before producing output are not billed.

For per-model parameter details, see One OpenAI-compatible key for DeepSeek, Qwen, GLM, Kimi and Doubao. Endpoint rules are in the Base URL docs, and additional client setups are in Third-party clients.

FAQ

Why does RAGFlow or Dify return 404 when I test a model?

Check three things: first, the model ID matches GET /v1/models character for character and your key includes that model's group; second, if you used a generic OpenAI-compatible provider, the Base URL ends in /v1 (the built-in RAGFlow HopBase provider and Dify hopbase/hopbase plugin set this automatically); third, if you configured a native Anthropic provider, its Base URL is https://api.hop-base.com without /v1.

Can Dify call Claude, GPT and DeepSeek with the same HopBase key?

Yes. Attach the corresponding groups when creating the key, enter that single key in the official hopbase/hopbase Dify plugin, and select DeepSeek, GPT or Claude models per workflow node; you can also add a native Anthropic provider pointed at https://api.hop-base.com with the same key.

Is our knowledge-base data retained or used to train models?

No. Prompts and outputs are used only to complete the request — never kept long-term as business data and never used to train models. Billing metadata (model, token counts, latency, status) is kept for invoices and audits; failed requests may be held briefly for troubleshooting and then deleted automatically, and all traffic is TLS-encrypted in transit.

Sign up for HopBase and issue the first multi-model key for your knowledge base

Top comments (0)