Technological innovation is constantly reshaping the materiality and mechanics of smart-city initiatives. Recently, innovation in artificial intelligence (AI) in the shape of self-driving cars, robots and city brains, has been pushing the so-called smart city to morph into an autonomous urban creature which is largely unknown. In this emerging strand of smart urbanism, artificially intelligent entities are taking the management of urban services as well as urban governance out of the hands of humans, operating the city in an autonomous manner. This paper explores, in theory and practice, how the development of AI intersects with the development of the city. The contribution of the paper is threefold. First, the paper advances a theoretical framework to understand AI specifically in urban contexts. It develops the concept of urban artificial intelligence, capturing the main manifestations of AI in cities. Second, the paper examines the case of Masdar City, an Emirati urban experiment, to show how the genesis of urban artificial intelligences is part of a long-standing process of technological development and a politico-economic agenda which together are enabling the transition from automation to autonomy. Third, it proposes a research agenda to investigate what the paper terms the autonomous city.