In September, Amazon said it would invest up to $4 billion in Anthropic, a San Francisco start-up working on artificial intelligence.

Soon after, an Amazon executive sent a private message to an executive at another company. He said Anthropic had won the deal because it agreed to build its A.I. using specialized computer chips designed by Amazon.

Amazon, he wrote, wanted to create a viable competitor to the chipmaker Nvidia, a key partner and kingmaker in the all-important field of artificial intelligence.

The boom in generative A.I. over the last year exposed just how dependent big tech companies had become on Nvidia. They cannot build chatbots and other A.I. systems without a special kind of chip that Nvidia has mastered over the past several years. They have spent billions of dollars on Nvidia’s systems, and the chipmaker has not kept up with the demand.

So Amazon and other giants of the industry — including Google, Meta and Microsoft — are building A.I. chips of their own. With these chips, the tech giants could control their own destiny. They could rein in costs, eliminate chip shortages and eventually sell access to their chips to businesses that use their cloud services.

While Nvidia sold 2.5 million chips last year, Google spent $2 billion to $3 billion building about a million of its own A.I. chips, said Pierre Ferragu, an analyst at New Street Research. Amazon spent $200 million on 100,000 chips last year, he estimated. Microsoft said it had begun testing its first A.I. chip.