PurposeThe purpose of this paper is to analyze the optimal competition or cooperation decision between technology service platforms and governments in the context of fierce competition within urban agglomerations.Design/methodology/approachBased on the cooperation and competition game model, this study builds a two-level model for government and technology service platforms considering three cases: perfect competition, platform cooperation and government-led cooperation.FindingsBy analyzing the optimal strategies of the government and a platform in three cases, the research shows that choosing appropriate cooperation in a competitive situation is beneficial to both the government and the platform. Government-led cooperation is conducive to increasing social welfare. From the perspective of the platforms, if they actively seek cooperation, they can obtain higher subsidies and profits. The more intense the competition is, the higher the profits and social welfare generated from the platforms' active cooperation.Practical implicationsThe contribution of this study relates to the development of technology service platforms in urban agglomerations. As local governments and platforms continuously undertake decision-making processes, this study constructs quantitative models to analyze the advantages and disadvantages of competition and cooperation. It is worth noting that relying on government subsidies to maintain the sustainable development of technology service platforms is not a long-term solution. Government subsidies play a vital role in the initial development of technology service platforms. The analysis results are in line with Guo et al. (2016), Jung and Feng (2020) and Li (2021) conclusions. Furthermore, long-term government subsidies will make platforms dependent on these subsidies. These are the contributions to the scientific literature.Originality/valueInstead of focusing on vertical relationships, this study emphasizes the horizontal cooperation and competition relationship between platforms and local governments in an urban agglomeration. Thus, the vertical effects of government subsidies on platforms can be investigated. Another innovation is the social welfare policy goal, which is an important index for the development of urban agglomerations.