Amazon said today it would invest up to $4 billion in AI firm Anthropic, as the online retail giant steps into an AI race dominated by Microsoft, Google and OpenAI.

The success of OpenAI's ChatGPT, a chatbot released last year that is able to generate poems, essays and other works with just a short prompt, has led to billions being invested in the field.

Amazon had already announced it aimed to soup up its Alexa voice assistant with generative AI, which the firm said would allow users to have smoother conversations.

San Francisco-based Anthropic is seen as a leader in the field and has its own chatbot, Claude, a competitor to ChatGPT.

"We have tremendous respect for Anthropic's team and foundation models, and believe we can help improve many customer experiences, short and long-term, through our deeper collaboration," said Amazon CEO Andy Jassy.

The giant firms and wealthy investors of Silicon Valley have poured money into artificial intelligence as they seek to find a killer application to justify the interest.

ChatGPT's instant success threw much of the focus onto chatbots and sparked imitators and rivals, not least from Google with its Bard chatbot.

Chinese titans Tencent and Baidu have also launched bots they claim can rival ChatGPT.

As part of today's deal, Anthropic will use Amazon's chips to develop its next models.

The AI firm will also use Amazon's cloud services - the data centres that store and process data on a vast scale - for "mission critical workloads".

Amazon said it would take a "minority ownership position" in the AI firm, which has already raised more than $1 billion since it was set up in 2021.

The statement announcing the deal focuses on the benefits to clients of Amazon's cloud computing arm, Amazon Web Services (AWS).

It promises that "Claude", which is the name of the Anthropic's chatbot and its model, will "help customers of all sizes to develop new generative AI-powered applications to transform their organisations".

The deal intensifies competition between Amazon and Google, which had earlier opened its cloud services to Anthropic and invested $300m to acquire 10% of the company.

AI models require huge computing power so AI firms rely on data centres provided by the likes of AWS, Google Cloud and Microsoft Azure.

As tech giants push their own AI ambitions, they have been increasingly looking at tie-ins with smaller AI firms - Microsoft leading the way with a multibillion-dollar investment in OpenAI.