This photo taken in Los Angeles on April 20, 2023, shows Elon Musk's blue tick next to his name on a smartphone. (PHOTO / AFP)

Twitter Inc has alleged that Microsoft Corp violated an agreement over using the social media company's data, according to a letter seen by Reuters on Thursday.

Twitter owner Elon Musk's lawyer leveled accusations of "unauthorized" usage of Twitter's data by Microsoft, including sharing data with government agencies without permission in some cases.

A Microsoft spokesperson said the company on Thursday heard from a law firm representing Twitter with some questions about its previous use of the free Twitter APIs

In the letter addressed to Microsoft CEO Satya Nadella, Musk's lawyer Alex Spiro asked the tech giant to conduct an audit of its use of Twitter's content. The letter was first reported by the New York Times.

READ MORE: Microsoft Teams back up for most users after global outage

Twitter did not immediately respond to a Reuters' request for comment.

As per Twitter's agreement, the social media company enforces rate limits on use of its application programming interface (API) for all developers.

"Despite these limitations, the Microsoft Apps accessed Twitter's APIs over 780 million times and retrieved over 26 billion tweets in 2022 alone", the letter said.

A Microsoft spokesperson said the company on Thursday heard from a law firm representing Twitter with some questions about its previous use of the free Twitter APIs.

"We will review these questions and respond appropriately. We look forward to continuing our long term partnership with the company," the spokesperson said.

Twitter's accusations come at a time when Elon Musk is at odds with Microsoft over its artificial intelligence platform.

READ MORE: Microsoft cloud outage hits users around the world

Musk said in April he will launch AI platform "TruthGPT" to challenge the offerings from Microsoft and Google.

He has criticized Microsoft-backed OpenAI, the firm behind chatbot sensation ChatGPT, of "training the AI to lie" and said OpenAI has now become a "closed source", "for-profit" organization that is "closely allied with Microsoft".

He has also accused Larry Page, co-founder of Google, of not taking AI safety seriously.