NEW YORK (AP) — Artificial intelligence company Anthropic has agreed to pay $1.5 billion to settle a class-action lawsuit brought by book authors who say the company took pirated copies of their works to train its chatbot.

The settlement, if approved by a judge as soon as this week, could mark a turning point in legal battles between AI companies and the writers, visual artists and other creative professionals who accuse them of copyright infringement.

The company has agreed to pay authors or publishers about $3,000 for each of an estimated 500,000 books covered by the settlement.

“As best as we can tell, it’s the largest copyright recovery ever,” said Justin Nelson, a lawyer for the authors. “It is the first of its kind in the AI era.”

A trio of authors — thriller novelist Andrea Bartz and nonfiction writers Charles Graeber and Kirk Wallace Johnson — sued last year and now represent a broader group of writers and publishers whose books Anthropic downloaded to train its chatbot Claude.

A federal judge dealt the case a mixed ruling in June, finding that training artificial intelligence chatbots on copyrighted books wasn’t illegal but that Anthropic wrongfully acquired millions of books through pirate websites.

If Anthropic had not settled, legal analysts say losing the case after a scheduled December trial could have cost the San Francisco-based company even more money.

“We were looking at a strong possibility of multiple billions of dollars, enough to potentially cripple or even put Anthropic out of business,” said Thomas Long, a legal analyst for Wolters Kluwer.

The settlement could influence other disputes, including an ongoing lawsuit by authors and newspapers against OpenAI and its business partner Microsoft, and cases against Metaand Midjourney. Just as the Anthropic settlement terms were filed, another group of authors sued Apple last week in the same San Francisco federal court.

“This indicates that maybe for other cases, it’s possible for creators and AI companies to reach settlements without having to essentially go for broke in court,” said Long.

U.S. District Judge William Alsup of San Francisco was scheduled to review the settlement terms earlier this week.

Anthropic said in a statement that the settlement, if approved, “will resolve the plaintiffs’ remaining legacy claims.”

“We remain committed to developing safe AI systems that help people and organizations extend their capabilities, advance scientific discovery, and solve complex problems,” said Aparna Sridhar, the company’s deputy general counsel.

As part of the settlement, the company has also agreed to destroy the original book files it downloaded.

Books are known to be important sources of data — in essence, billions of words carefully strung together — that are needed to build the AI large language models behind chatbots such as Anthropic’s Claude and its rival, OpenAI’s ChatGPT.

Alsup’s June ruling found that Anthropic had downloaded more than 7 million digitized books that it “knew had been pirated.”

It started with nearly 200,000 from an online library called Books3, assembled by AI researchers outside of OpenAI to match the vast collections on which ChatGPT was trained.

Debut thriller novel “The Lost Night” by Bartz, a lead plaintiff in the case, was among those found in the dataset.

Anthropic later took at least 5 million copies from the pirate website Library Genesis, or LibGen, and at least 2 million copies from the Pirate Library Mirror, Alsup wrote.

The Authors Guild told its thousands of members last month that it expected “damages will be minimally $750 per work and could be much higher” if Anthropic was found at trial to have willfully infringed their copyrights.

The settlement’s higher award — approximately $3,000 per work — likely reflects a smaller pool of affected books, after taking out duplicates and those without copyright.