USA's Carmelo Anthony celebrates a score against Nigeria during a...

USA's Carmelo Anthony celebrates a score against Nigeria during a men's basketball game at the 2012 Summer Olympics in London on Aug. 2, 2012. Credit: AP

Carmelo Anthony has committed to play for the United States in hopes of winning an unprecedented third Olympic gold medal this summer in Rio de Janeiro.

Star players have been withdrawing their names from consideration for various reasons, but Anthony has accepted his invite, an NBA source confirmed.

Anthony tweeted “See you in RIO” on Thursday night, with a picture of him in a Team USA uniform.

Anthony would be the first four-time Olympian for men’s basketball and also would be the only men’s basketball player to win three gold medals if Team USA wins the tournament.

“Not too many people can say they played in four Olympics and have a chance to win three gold medals. Not too many people can say that,” Anthony said this past season. “To me, that’s the way I look at it and the way I approach the Olympics.”

The Knicks star played on the 2004 bronze medal-winning team and won gold in 2008 and 2012. Anthony said in March that the Knicks’ failure to reach the playoffs the last three seasons has him craving team success.

“I think from a morale standpoint, as a player, if you’ve been through the things that I’ve been through the past couple of years, you want to feel what that success feels like,” Anthony said. “You want that success.”

LeBron a no-go. LeBron James’ agent, Rich Paul, informed Team USA managing director Jerry Colangelo that James will not play in the Olympics, reported Thursday afternoon. Like Anthony, James has appeared in three Olympics and has won two golds and a bronze.

Oklahoma City’s Kevin Durant, Indiana’s Paul George, Golden State’s Draymond Green and Klay Thompson, Sacramento’s DeMarcus Cousins, Toronto’s Kyle Lowry and DeMar DeRozan, Chicago’s Jimmy Butler and the Los Angeles Clippers’ DeAndre Jordan also are committed to play for the two-time defending champions.

Chris Paul of the Los Angeles Clippers, Golden State’s Stephen Curry, Houston’s James Harden and Oklahoma City’s Russell Westbrook have withdrawn from playing for the U.S. national team this summer.