Configuration steps
Fill in the model info
Add a separate row for each model you want to use:
- Model type: LLM
- Model Name:
gpt-5.5(or another OpenPAI model ID) - API Key:
sk-XXXXXXXXXXXXXXXX - API Base / URL:
https://openp.ai/v1 - Model context length: per the chosen model (e.g.
gpt-5.5is 1000000) - Max tokens upper limit: as needed (e.g. 4096)
- Function Calling: enable (if the model supports it)
- Vision support: enable (if the model supports it)
Adding Embedding / Rerank
Dify’s RAG needs embedding and rerank models, also added via OpenAI-API-compatible:| Model type | Model name | Notes |
|---|---|---|
| Text Embedding | text-embedding-3-small | 1536 dimensions |
| Text Embedding | bge-m3 | 1024 dimensions |
| Rerank | rerank-multilingual-v3.0 | Cohere |
| Rerank | bge-reranker-v2-m3 | BAAI |
Rerank goes through OpenPAI’s
/v1/rerank endpoint. Choosing the Cohere or Jina provider type in Dify also routes correctly — set the Base URL to https://openp.ai/v1 as well.Use in workflows
After adding the models, create an app in Dify Studio:- Chat assistant → choose OpenPAI’s GPT/Claude/Gemini model.
- Workflow → add an LLM node and select OpenPAI as the model.
- Agent → combine with Tools and Function Calling.
- Knowledge base RAG → use OpenPAI for both embedding and rerank.
Multi-model strategy
Dify lets you choose a different model per node within one app. A typical combination:- Retrieval stage:
gpt-5.4-mini(low latency) - Complex reasoning:
claude-opus-4-8oro3-mini-high - Summarization:
gemini-3.1-flash-lite(fast + long context)