OTC markets exhibit a core-periphery structure: 10-30 highly interconnected dealers account for a majority of interdealer trades and form the core of the interdealer network, while hundreds of sparsely connected dealers trade infrequently and form the periphery. I build a search-based model of endogenous network formation between dealers and propose that a core-periphery interdealer network arises from specialization. Dealers endogenously specialize in different clients with different trading needs. Some dealers attract clients who trade frequently (e.g., index funds); others attract clients with infrequent trading needs (e.g., pension funds). The dealers specializing in clients with frequent trading needs receive a larger volume of client orders, trade more with other dealers, and, as a result, form the core of the interdealer network. The dealers specializing in clients with infrequent trading needs form the periphery. I also show that accounting for client heterogeneity across dealers (a) challenges standard interpretations and measurements of bid-ask spreads and (b) helps reconcile conflicting evidence on bid-ask spreads and dealer centrality.