Docs/Platform Integrations/Dify

Dify

Protect your Dify AI applications with Trappr by connecting through Dify's OpenAI-compatible custom model provider. All LLM calls route through the Trappr Gateway with zero changes to your Dify apps or workflows.


How Dify model providers work

Dify is not a workflow automation tool — it's an LLM application builder. You build apps inside a Dify workspace: Chatbots that answer questions, Agents that use tools, Workflows that chain LLM nodes visually, and Text Generators for structured outputs. Each app runs on a configured model provider.

The critical difference from n8n or Make: the model provider is configured once at the workspace level — not per-workflow, not per-node. When you add Trappr as a custom provider and an app's model is switched to it, every LLM call that app makes — regardless of how many nodes or how complex the workflow — automatically routes through Trappr. You configure it once; all apps benefit.

Dify Workspace
Chatbot App
chat interface
Agent App
tool use + reasoning
Workflow App
visual LLM pipeline
Text Generator
structured output
─→
─→
─→
─→
Custom Provider
Settings → Model Provider
configured once
Trappr
all LLM calls
OpenAI
completion
Key insight: One configuration change — adding Trappr as the custom model provider — covers every app in the workspace. You don't touch individual apps, nodes, or workflows. Switch each app's model selection from OpenAI to Trappr Gateway and protection applies automatically.

Setup

1
Open Dify Settings → Model Provider

In your Dify workspace, go to Settings → Model Provider. Scroll to the bottom and click + Add Custom Provider (available in Dify Cloud and self-hosted).

2
Configure the Trappr provider

Fill in the following fields:

FieldValue
Provider nameTrappr Gateway
API endpoint URLhttps://gateway.trappr.net/v1
API keyYour Trappr Gateway key (cht_gw_*)
Model namegpt-4o (or any model you've configured in Trappr)

Click Save and Verify to confirm the connection works.

3
Switch your Dify apps to the Trappr provider

For each Dify app you want to protect, go to the app's Settings → Modeland switch the model provider from OpenAI to Trappr Gateway. Select the model name you configured.

4
Test the app and verify in Trappr

Send a test message in your Dify app. In the Trappr dashboard under Gateway → Logs, you should see the request appear with the model and token count.

You only need one Trappr custom provider. All Dify apps can share it — they're differentiated in Trappr by app ID, not by separate credentials.

Supported Dify app types

App typeSupportedNotes
ChatbotFullAll LLM calls routed through gateway
AgentFullTool calls logged separately
WorkflowFullEach LLM node uses the configured provider
Text GeneratorFullStandard completions API