Cloud application programming interface (API) is a software intermediary that enables data exchange, business logic or functionality delivery between applications, infrastructures and IoT devices for supporting service oriented architecture. Currently, the number of cloud API in the Web is increasing and the number of cloud API with similar functionality is very large. Since quality of service (QoS) can well differentiate the performance of similar cloud API, QoS prediction has become the critical base for fast, personalized and high-quality cloud API selection and recommendation. However, contexts are used indirectly through context aware neighbors in most existing researches and the combined feature interactions are treated equally in previous factorization machine based methods, which together hinder the accurate QoS prediction. To address the above concerns, we first conduct data analysis on real-world QoS datasets and provide conclusive evidence to verify the necessity of incorporating contextual information and differentiating feature interaction. Then, we propose a context-aware QoS prediction approach via automatic feature interaction named CAFI. Contextual information of both user and cloud API sides are directly fed into CAFI through feature embedding. Moreover, the importance weights of feature interactions are learned by a generalized regularized dual averaging optimizer, so as to reward effective feature interaction and penalize noise feature interaction automatically. Lastly, final QoS prediction is obtained in an ensemble way by balancing the results of linear regression, automatic feature interaction and non-linear interaction. Extensive experiments on two public real-world QoS datasets demonstrate that CAFI can significantly improve QoS prediction accuracy. And the proposed CAFI approach is promising to encourage service providers provide high quality APIs and enable developer get desired cloud APIs quickly, thereby promoting the development of API economy.