Musk told a California jury on Wednesday that after learning in early 2023 that tech giant Microsoft had invested $10 billion in OpenAI, he texted Sam Altman, who he co-founded with Altman more than a decade ago, asking "what the hell is going on?" In the text message, he called the move a "bait-and-switch."

Musk made the remarks during a second straight day of testimony in his civil lawsuit against OpenAI. He tried to convince the jury that the defendants, including Microsoft, had "unjustly enriched themselves by hundreds of billions of dollars."

“Microsoft would only invest $10 billion if it was sure it would get a return — that’s a lot of money,” Musk said, explaining why he was so angry about the investment. OpenAI CEO Altman was also in the courtroom during Musk's testimony.

Under direct questioning from his lead attorney, Steven Morrow, Musk said he was concerned that Microsoft would effectively take control of artificial general intelligence (AGI) "started by a charity."

"Microsoft's motivations are very different from those of charity," Musk added.

"Microsoft's motivations are different than those of a charity," Musk added.

This is the second time Microsoft has invested in OpenAI. Microsoft first invested $1 billion in 2019.

When asked why Musk did not file any lawsuits in 2019, he said his understanding at the time was that there was a cap on profits. Musk, who left OpenAI in 2018, said he believed Microsoft "agreed to participate on a profit-capped basis."

The lawsuit, which later named Microsoft as a defendant, accused Altman and Brockman of straying from OpenAI's founding mission as a nonprofit dedicated to developing artificial intelligence for the public rather than private benefit.

Musk claimed in the lawsuit that he invested $38 million in seed capital over the years to support this mission, but was eventually "betrayed" by OpenAI, turning it into a "profit-oriented behemoth that paralyzed the market" and effectively became a "Microsoft subsidiary."

Microsoft's attorney, Russell Cohen, told the jury in opening statements on Tuesday that Microsoft "helps OpenAI pursue and advance its mission."

"Unlike Mr. Musk, Microsoft has never attempted to control OpenAI," Cohen said.

Asked in court Wednesday how Musk responded to the remarks, he said: "They were trying to hoodwink the jury."

During the month-long trial, the jury is expected to hear testimony from more technology heavyweights, including Altman, Brockman and Microsoft CEO Satya Nadella.

OpenAI has repeatedly blasted Musk’s lawsuit as “baseless.” In opening statements, William Savitt, lead attorney for OpenAI and Altman, told the jury that Musk sued the ChatGPT developer simply because he "failed to get what he wanted at OpenAI."

“The only thing Musk cares about is that he’s the boss,” Savitt said.

During questioning by Savitt on Wednesday, Musk accused the lawyer of trying to "deceive" him.

Musk told Savitt: "Your questions are not simple. Essentially, they are designed to deceive me. Any simple answer will mislead the jury."