With Sandbox API key & secret, you should use the sandbox url like:
curl -X GET https://api-public.sandbox.exchange.coinbase.com/accounts -u "API_KEY:API_SECRET"