Need Help on Intelligent Endpoint Selection for API Integration, Chatgpt 4 turbo + DALL E3

Hello fellas! I need your help.

I am building a web-application and integrating chatgpt 4-turbo + DALL E3. Programming language is php and frame work is laravel.

How can i get response from relevant API, Chatgpt 4 and Dall E3?

Like if i want to generate an image only, Dall E3 get it and gives me the response from my prompt. I don’t want Chatgpt 4 to response on this.

Or if i want to generate a text only, Chatgpt 4 turbo get it and gives me the response on that prompt. I don’t want Dall E3 to response on this.

In simple words, i just want to build a conversation like the OpenAI. I want both Chatgpt and Dall E3 to be merged/integrated in the same conversation but it should be intelligent enough to know which API should get the prompt and give the relevant response.

To clarify more, i want to put one input (prompt) and i have 2 end points (Chatgpt turbo 4 and Dall E3). How can i make the it know automatically which endpoint it should hit and get the response.