Skip to content
RU

Dify

Connect Dify to Mixen — pay from your balance in roubles, with a catalog of 105+ models.

Dify is a platform for building LLM applications. Options: Dify Cloud or self-hosted via Docker Compose (requires Docker Compose 2.24.0+):

Terminal window
git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
docker compose up -d

Initial setup and admin account creation happen at http://localhost/install.

Mixen models connect through the OpenAI-API-compatible plugin:

  1. Open Integrations → Model Provider (in older Dify versions — Settings → Model Provider).
  2. In the Install model providers section, find the OpenAI-API-compatible plugin (or install it from the Marketplace).
  3. On the plugin card, click Add Model and fill in:
Model Type: LLM
Model Name: openai/gpt-5.6-sol
API Key: your-api-key
API Base URL: https://api.mixen.ai/v1

Leave Completion mode at Chat. A key starting with mxn-… is issued in the dashboard.

  1. Each model is added separately — repeat step 3 for other models from the catalog (Model Name = the model ID, character for character with the provider prefix).
  2. In Default Models (top-right corner of the page), set your model as the System Reasoning Model so apps without an explicit model choice run through Mixen.

Important: for every model type — LLMs and non-LLM types alike (Text embedding, Rerank, STT, TTS) — the base URL is the same, with /v1, as above. The plugin builds the path from the base address itself, appending only the endpoint name (/embeddings and so on); it never adds the /v1 version — an address without /v1 produces a broken path.

The short path to a working assistant:

  1. In Studio, click Create from Blank and choose the Chatbot type — a conversational app built from a model and a prompt. Next to it: Agent (the model decides which tools to call), Chatflow and Workflow (visual chains with LLM nodes), and Text Generator (a single text run).
  2. In the orchestration panel, select a Mixen model added through the plugin — the system will suggest picking a model that fits the task, and the Debug as Multiple Models mode compares up to four models at once. Once selected, the model’s parameters can be tuned — temperature and the other generation settings.
  3. Write the prompt instruction: role, answer format, constraints. The Generate button delegates the instruction draft to an LLM: describe the desired output in Ideal Output, and each generation is saved as its own version — a bad draft can be rolled back. Inside the prompt, type / to insert a variable (New Variable: short text, paragraph, number, checkbox, and other types) — users fill the values in the app’s interface.
  4. Test the dialog in the preview panel on the right and click Publish — the app becomes available by link and through the Dify API.

When the selected model has vision, multimodal toggles — Vision, Audio, Document — appear in the orchestration; Vision has Settings for resolution, upload method, and file limit. The Mixen catalog has models with capabilities.vision (see chat), so a Dify app can parse screenshots and photos straight off our balance.

The Agent app type fits when the model should decide which tools to call itself: our /v1/chat/completions supports tool calling (the call marker is finish_reason: "tool_calls", multi-round scenarios work) — details in the integrations overview.

Knowledge base (RAG) with Mixen embeddings

Section titled “Knowledge base (RAG) with Mixen embeddings”

A chatbot can be grounded on your documents: attach a knowledge base in the app settings and configure retrieval (Weighted Score or Rerank Model, Top K, score threshold). The base itself is created in the Knowledge section, and here is the important part: high-quality indexing runs on an embedding model, and Mixen can play that role.

The layout:

  1. Through the same OpenAI-API-compatible plugin, add an embedding model:
Model Type: Text Embedding
Model Name: text-embedding-3-small
API Key: your-api-key
API Base URL: https://api.mixen.ai/v1
  1. In Default Models, set it as the Embedding Model — this default indexes and retrieves knowledge base content across the workspace.
  2. Create a knowledge base and upload the documents. The creation step configures chunking and cleaning: chunk size and preprocessing — they decide which fragments reach the prompt. High Quality indexing builds a vector index (vector, full-text, and hybrid search); Economical saves tokens on 10 keywords per chunk but is less accurate.

text-embedding-3-small is a working embedding model from the catalog (1536 dimensions, ~2.7 ₽ per 1M input tokens); the full list of embeddings is in the catalog.

Things worth knowing in advance:

  • The index choice is nearly irreversible in one direction: a High Quality base cannot be downgraded to Economical; the reverse upgrade is available in the base settings.
  • Multimodal embedding models are marked with a Vision icon and search across text together with images — a base with such a model gets a Multimodal label.
  • For debugging the embeddings-plus-rerank-plus-answer chain on a clean API, see the separate RAG guide.
Task Model Price per 1M tokens
Bulk nodes: classification, extraction, drafts z-ai/glm-5.3-flash 8.4 ₽ input / 27.9 ₽ output
Final answers, long context, complex scenarios anthropic/claude-sonnet-5 213.9 / 1069.5 ₽

The app’s instruction is a stable prefix of every request, so it consistently hits the prompt cache: re-reading the same prefix within 5 minutes costs ~10% of the input price (for claude-sonnet-5 — 21.4 ₽ per 1M instead of 213.9 ₽, for glm-5.3-flash — 1.7 ₽), and every hit pushes the cache window forward. Keep the app instruction constant — rewording it mid-day resets the accumulated discount.

The price scale for high-volume apps: a request with 1,000 input and 200 output tokens on glm-5.3-flash costs about 0.014 ₽ — a chatbot serving thousands of dialogs stays cheap even without the cache.

Reasoning depth is set by the reasoning_effort parameter (values from off to max: off, low, medium, high, xhigh, max); the levels of a particular model are listed in GET /v1/modelscapabilities.reasoning_efforts. Reasoning spends the answer budget — extraction nodes usually do fine on a low depth.

Model ID
GPT-5.6 Sol openai/gpt-5.6-sol
Claude Opus 5 anthropic/claude-opus-5
GLM 5.3 z-ai/glm-5.3
DeepSeek V4 Pro deepseek/deepseek-v4-pro
Kimi K3 moonshotai/kimi-k3

Full list — in the catalog.

  • 401 / invalid key — the key was copied incompletely or isn’t an API key; issue a new one in the dashboard, it starts with mxn-.
  • “Model Name” doesn’t match the catalog — the ID is entered manually and must match character for character, including the provider prefix (openai/…, anthropic/…); check the catalog.
  • Embedding model doesn’t respond — check that the API Base URL includes /v1 (https://api.mixen.ai/v1) — the same for LLMs and Text Embedding (see the note above).
  • The app answers with a different model — check the model selection in the app’s orchestration and the System Reasoning Model default: apps and nodes without an explicit choice fall back to the workspace default.
  • The knowledge base finds nothing — check that the base was created with High Quality indexing and the retrieval settings in the app (Top K, threshold, Weighted Score versus Rerank Model).