* U.S. stocks end slightly higher

* U.S. dollar up against the yen, at 38-year high

* Investors on alert for yen intervention

NEW YORK, June 26 (Reuters) - The U.S. dollar on Wednesday hit its highest level against the Japanese yen in nearly 38 years, and investor speculation was high that authorities in Japan could intervene to strengthen the country's currency, while major U.S. stock indexes climbed.

Japan's top currency diplomat, Masato Kanda, said authorities were "seriously concerned and on high alert" about the yen's rapid decline.

The U.S. dollar hit its strongest level since December 1986 against the yen, and it was last up 0.7% at 160.697 yen . The euro also surged against the yen, rising to 171.79, its highest level since September 1992. It was last up 0.3% at 171.625.

"The market seems to be front-running itself with respect to BOJ (Bank of Japan) policy," said Eugene Epstein, head of structuring for North America at Moneycorp in New Jersey.

The yen has been hammered as investors flocked to dollar-based assets to take advantage of U.S. interest rates which are 5.25% to 5.5%. That is much higher than Japanese rates, which have been raised this year to a range of zero to 0.1%.

The dollar index, which measures the greenback against a basket of currencies, gained 0.38% to 106.07, with the euro down 0.34% at $1.0677.

On Wall Street, shares of artificial intelligence chip leader Nvidia ended up 0.2%, and shares of Amazon Inc jumped 3.9%. The S&P 500 consumer discretionary index gained 2% on the day.

The Dow Jones Industrial Average rose 15.64 points, or 0.04%, to 39,127.80, the S&P 500 gained 8.60 points, or 0.16%, to 5,477.90 and the Nasdaq Composite gained 87.50 points, or 0.49%, to 17,805.16.

MSCI's gauge of stocks across the globe fell 0.04 points to 803.73.

European shares slipped, with investor focus among other things on French elections at the weekend. The STOXX 600 index fell 0.56%.

U.S. President Joe Biden and former President Donald Trump on Thursday head to the first of two debates ahead of their election rematch this November.

Investors also are seeking clues on U.S. inflation and how soon the Federal Reserve may begin to cut interest rates.

Fed officials have urged patience on rate cuts. Fed Governor Michelle Bowman this week reiterated her view that holding the policy rate steady "for some time" would probably be enough to bring inflation under control.

Investors await Friday's release of the U.S. personal consumption expenditures (PCE) price index, the Fed's preferred inflation measure. Economists polled by Reuters expect PCE annual growth to ease to 2.6% in May.

U.S. Treasury yields rose as inflation in other countries piced up.

Australian consumer inflation accelerated to a six-month high in May.

The yield on benchmark U.S. 10-year notes rose 9.1 basis points to 4.329%, from 4.238% late on Tuesday.

Brent crude futures climbed 24 cents to settle at $85.25 per barrel. U.S. West Texas Intermediate crude futures gained 7 cents to settle at $80.90 a barrel.

Gold prices slipped to their lowest in more than two weeks. Spot gold was down 0.8%, at $2,301.16 per ounce.

(Additional reporting by Gertrude Chavez-Dreyfuss in New York; and Samuel Indyk and Ankur Banerjee; Editing by Shri Navaratnam, Himani Sarkar, Alex Richardson, Gareth Jones and Alexander Smith)