Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning » AI Answers

How do I convert the API provided by Dify to a format compatible with the OpenAI interface?

2024-12-16 2.6 K

Yes, I did. Dify For those of you who know Dify, you should know that while it's a great AI app, the APIs it provides are incompatible with Open AI, which makes it impossible for some apps to interface to Dify.

What can be done about it?

It is possible to utilize "transit APIs", the most famous of which would be One API: Multi-model API Management and Load Balancing, Distribution System It can aggregate different AI models together and then unify them into OpenAI APIs for distribution, but it doesn't support Dify's access so far, so although there is a way out, it can't solve the above problem.

 

At this time, a big shot, based on the One API to do the second opening, the project name is New APIThis project fully supports Dify, so we can finally play with the Dify API!

如何将Dify提供的API转换为兼容Open AI格式?-1

 

After a successful deployment we access it via IP + port:

  • After we check the Dify type, we have to enter the address of the Dify service. If your new-api service and dify are both deployed on a single machine via docker, then remember to enter the address of thehttp://host.docker.internal:你的端口号The screenshot is my example, so don't copy it as is. If you're not using the docker deployment method, you'll need to enter the dify service'shttp:// ip + 端口号 Ready to go;
  • Since we're accessing dify, all we need to do for model selection is enter the name of the custom model, e.g., dify, and then be sure to click the "Fill in" button at the end;
  • Whether it's a custom model or another model selected, it must be shown at position 3 in the screenshot, and not showing it means it's not configured;
  • Finish submitting, we can see a piece of data in the list of channels ~!

如何将Dify提供的API转换为兼容Open AI格式?-1

🍐 Duck & Pear AI Article Smart Writer
Selection → Writing → Publishing
Fully automated!
WordPress AI Writing Plugin
500+ content creators are using
🎯Intelligent Selection: Batch generation, say goodbye to exhaustion
🧠retrieval enhancement: networking + knowledge base with depth
Fully automated: Writing → Mapping → Publishing
💎Permanently free: Free version = Paid version, no limitations
🔥 Download the plugin for free now!
✅ Free forever · 🔓 100% Open Source · 🔒 Local storage of data

Recommended

Can't find AI tools? Try here!

Enter keywords.Accessibility to Bing SearchYou can find AI tools on this site quickly.

Top