Skip to content
Takes about 3 minutes

Connect Dify to PromptUnit

Dify connects to PromptUnit through its OpenAI-API-compatible model provider. You add each model you want once, then use it in any app or workflow.

1

Get your PromptUnit key

Sign up free at PromptUnit (no credit card) and connect the AI provider key you already use, for example your OpenAI or OpenRouter key. Your requests keep running on that key.

Then open API Keys in your dashboard and copy your PromptUnit key. Connecting more than one app? Under Routing, + New routing gives each app its own key and settings.

2

Open the model provider

In Dify, open Settings, then Model Provider. Find OpenAI-API-compatible (if it isn't listed, install it from the Marketplace) and click Add Model.

3

Fill in the model

Model Type

LLM

Model Name

the exact model ID, for example gpt-6.1-sol

API Key

your PromptUnit key from Step 1

API endpoint URL (API Base URL in some versions)

the address for the provider whose key you connected (below)

Your OpenAI key

https://www.promptunit.ai/api/proxy/openai

Your OpenRouter (models from many providers) key

https://www.promptunit.ai/api/proxy/openrouter

Your Google Gemini key

https://www.promptunit.ai/api/proxy/google

Your Groq key

https://www.promptunit.ai/api/proxy/groq

Your DeepSeek key

https://www.promptunit.ai/api/proxy/deepseek

Set the context size and the maximum output tokens to your model's real limits (Dify's default of 4096 is low for current models). Save: Dify sends a short test request.

4

Use it in your app

In any app or workflow, choose the model in the LLM node. Repeat Step 3 for each model you want to use.

5

Watch the costs

Each request shows up on your PromptUnit dashboard with what it cost. PromptUnit checks every request and uses a cheaper model only when it would answer just as well; otherwise it uses the model you chose. Your first $5 of savings is free, no card needed.

If something doesn't look right

If saving the model fails, check that the endpoint URL ends at the provider name (for example /openai, with or without /v1), that the model name is spelled exactly as your provider writes it, and that the same provider's key is connected in PromptUnit.

Quick reference

The address you'll paste in, if you need it again:

https://www.promptunit.ai/api/proxy/openai