BEIJING—Fresh data suggest China is moderating its appetite for investing in U.S. securities, a trend that could mean lower flows of cheap capital from Beijing and a possible rise in borrowing costs across the American economy.

An analysis of U.S. Treasury data suggests China, with $3.2 trillion in foreign-exchange reserves, has begun to rapidly diversify its currencies portfolio.

"It...