Skip to content

Connect Dify to Gonka Broker

Dify is an open-source platform for building LLM apps: visual agents, workflows, and RAG. It reaches Gonka Broker through Dify’s OpenAI-compatible model layer, so your agents and workflows run on open-source models like MiniMax M2 and Kimi K2 with predictable USD pricing and no crypto.

Use the dedicated plugin (recommended)

The Gonka Broker model plugin in the Dify Marketplace adds Gonka Broker as a provider with the endpoint built in; you only supply your key and a model id, no base URL to configure.

  1. In Dify, open Plugins → Marketplace, search for Gonka Broker, and install it.
  2. Go to Settings → Model Provider → Gonka Broker and click Add Model.
  3. Fill in:
    • Model Name: a Gonka-supported model id, e.g. MiniMaxAI/MiniMax-M2.7
    • API Key: your gnk-prx-… key
    • Model context size: defaults to 131072; adjust to the model you use.
  4. Save. The model is now available across your apps, agents, and workflows.

The base URL (https://proxy.gonkabroker.com/v1) is built into the plugin; you never enter an endpoint.

This works on any Dify instance, no dedicated plugin required. Dify ships an OpenAI-API-compatible model provider that talks to any OpenAI-compatible endpoint.

  1. In Dify, open Plugins → Marketplace and install OpenAI-API-compatible (by langgenius) if it isn’t already present.
  2. Go to Settings → Model Provider → OpenAI-API-compatible and click Add Model.
  3. Fill in:
    • Model Name: a Gonka-supported model id, e.g. MiniMaxAI/MiniMax-M2.7
    • API Key: your gnk-prx-… key
    • API endpoint URL: https://proxy.gonkabroker.com/v1
    • Completion mode: Chat
    • Model context size: e.g. 131072
  4. Save. Add one entry per model you want to use.

Model Name must match a Gonka-supported model id (see Supported Models).

Dify’s knowledge bases (RAG) need an embedding model. Add Gonka Broker‘s BAAI/bge-m3 the same way you added the chat models (see Embeddings & RAG):

  1. In your model provider’s settings (Gonka Broker plugin or OpenAI-API-compatible), click Add Model and set Model Type to Text Embedding.
  2. Fill in:
    • Model Name: BAAI/bge-m3
    • API Key: your gnk-prx-… key
    • API endpoint URL: https://proxy.gonkabroker.com/v1 (OpenAI-API-compatible provider only; the plugin has it built in)
    • Model context size: 8192. Don’t leave the default: Dify truncates document chunks to this size silently.
  3. Save. When you create a Knowledge base, pick this model as its Embedding Model; documents and queries are then embedded through Gonka Broker.

Pick the embedding model before indexing documents: a knowledge base is tied to the embedding model it was indexed with.

Once the model is added, pick it in any Dify app (Chatflow, Workflow, Agent, or Chatbot) from the model selector. Tool calling and structured output work through the OpenAI-compatible transport, so agent nodes and function calls run unchanged. Because Gonka pricing is locked at top-up, token-hungry agent loops stay predictable.

Create a simple Chatbot app, select your Gonka model, and send a message. A reply confirms the connection. If the model doesn’t appear in the selector, re-open Settings → Model Provider and confirm the model was saved without an error.

  • 401 / invalid API key: wrong or paused key. Check it in your Gonka dashboard.
  • Model not found / unsupported: the Model Name must match a supported model id exactly.
  • Connection error (manual config): confirm the API endpoint URL is https://proxy.gonkabroker.com/v1 and Completion mode is Chat.
  • Knowledge-base answers miss content from long documents: the embedding model’s Model context size is too small, so chunks were silently truncated at indexing time. Set it to 8192 and re-index the knowledge base.