Invalid response received: 401; project id required

I have just signed up and created a project. I would like to connect to ETH mainnet with web3j. I copied the endpoint provided in the project setting, which looks like:

However, when initializing web3j with the endpoint, I get the following error:

org.web3j.protocol.exceptions.ClientConnectionException: Invalid response received: 401; project id required

at org.web3j.protocol.http.HttpService.performIO(
at org.web3j.protocol.Service.send(
at org.web3j.protocol.core.Request.send(
at ste.w3.easywallet.Wallet.balance(
at ste.w3.easywallet.WalletTest.get_wallet_balance(


how should I format the endpoint?

many thanks in advance.

I figured it out: I created an ETH2 project instead of a Ethereum project…

Hi @sirste and welcome to our Infura community.

Thanks for letting us know. If you still have any questions please come back to us. We’re here to help.