Create a HttpClient connection for API inside Sling Models, Service, or Servlet to be passed to the page based on your requirement.Refer: https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-develop/project-archetype/component-basics.html?lang=en