As the artificial intelligence (AI) arms race speeds up, it's becoming more common for large tech firms with sizable cash positions to make huge investments into various AI start-ups, hoping to take advantage of the next big innovation. Amazon (AMZN 3.43%) is doing exactly that with an investment of up to $4 billion in Anthropic, the company behind AI assistant Claude.

The deal announced in late September secures Amazon Web Services (AWS) as Anthropic's primary cloud provider and will boost AWS sales should Anthropic become the dominant player in its industry. But does this massive investment make Amazon a buy now?

AWS needs a growth jump start

Anthropic specializes in generative AI, which can be deployed, for instance, for customer service, as an AI assistant, or for help with coding. Essentially, Anthropic has a tool kit that helps its clients develop AI models that suit their needs. Anthropic rolled out AI assistant Claude in March.

With Anthropic's Amazon deal, anyone who utilizes Anthropic will also have some AWS usage, as Anthropic's data and models will be on the AWS platform. This will also make AWS a logical cloud provider for Anthropic clients, as the two will integrate nicely.

This investment may provide the kick start AWS needs, as it has recently struggled. In the second quarter, AWS grew only 12% year over year -- far slower than its two primary competitors, Alphabet's (NASDAQ: GOOG) (NASDAQ: GOOGL) Google Cloud and Microsoft's (NASDAQ: MSFT) Azure. Additionally, its profitability significantly slipped, as operating income was down 6%, dragging its operating margin down from 29% to 24%. Still, AWS is the largest cloud provider globally, controlling an estimated 32% market share.

With the cloud computing market estimated to grow to an incredible $2.4 trillion by 2030, from $678 billion in 2023, this is a critical area to be a market leader in.

While Amazon's Anthropic investment isn't a game-changing move, it certainly doesn't hurt the case, as Amazon isn't as AI-focused as its primary competitors are. Amazon's investment of up to $4 billion gives it a minority ownership stake in Anthropic and should help the company maintain AWS' competitiveness in the cloud computing buildout. But is the stock a buy now?

Amazon's profit margins are improving

While AWS is my favorite reason to invest in Amazon, it only made up 17% of Amazon's revenue in Q2. But it made up 70% of operating income, which shows how critical AWS is to Amazon's profitability picture. Overall, Amazon is moving from consumer goods to a tech-based business, which can be seen in its gross margin improvement over the past decade.

AMZN Gross Profit Margin Chart

AMZN Gross Profit Margin data by YCharts

As Amazon's gross margins improve, so does its potential to post a higher profit margin, although it hasn't done that lately. CEO Andy Jassy has been laser-focused on improving Amazon's efficiency. While he's not done yet, the strides he has made since assuming the CEO role have been impressive.

AMZN Profit Margin Chart

AMZN Profit Margin data by YCharts

As Amazon works to regain its impressive profitability figures reached in 2021, the market isn't convinced it can do it. Amazon's price-to-sales ratio is still hovering around 2016 levels when its gross margin wasn't nearly as high.

To me, this represents an incredible buying opportunity, as the stock should trade for a much higher valuation due to its gross margin improvements. Should Amazon regain its high profit margins and kick-start its AWS business, the stock should post incredible gains, as the market isn't pricing it for perfection.

This makes an excellent entry point for a long-term investment, as Amazon is positioning itself make AI gains.

CORRECTION: Amazon's investment in Anthropic is worth a maximum of $4 billion, but not necessarily $4 billion.