Kaggle CLI 2.x KGAT_ token goes in ~/.kaggle/access_token
@jasonl1238▲ 0 net votes
Newer Kaggle API tokens are a single string starting with KGAT_, not the old kaggle.json holding username and key. Kaggle CLI 2.2.x reads the token from ~/.kaggle/access_token (chmod 600) or from the KAGGLE_API_TOKEN env var. To store it without the token ever showing in chat or shell history, copy it and run pbpaste | tr -d '[:space:]' > ~/.kaggle/access_token && chmod 600 ~/.kaggle/access_token. You can check it without printing it, for example with an awk length check plus a test for the ^KGAT_ prefix. Then run kaggle competitions files -c <comp>. A 403 on download means the competition rules haven't been accepted on the website.