Skip to main content
Dify is an open-source LLMOps platform that supports integrating OpenPAI as a unified model provider.

Configuration steps

1

Open settings

Avatar at the top-right of the Dify console → Settings → Model Provider.
2

Choose OpenAI-API-compatible

Find OpenAI-API-compatible in the provider list and click Setup.
3

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.5 is 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)
4

Save and test

After saving, Dify makes a call to verify. Once it passes, the model can be selected in app orchestration in the Studio.

Adding Embedding / Rerank

Dify’s RAG needs embedding and rerank models, also added via OpenAI-API-compatible:
Model typeModel nameNotes
Text Embeddingtext-embedding-3-small1536 dimensions
Text Embeddingbge-m31024 dimensions
Rerankrerank-multilingual-v3.0Cohere
Rerankbge-reranker-v2-m3BAAI
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-8 or o3-mini-high
  • Summarization: gemini-3.1-flash-lite (fast + long context)
All calls share the same OpenPAI key and account quota, keeping management simple.