For Nanonets calls, put your API key in the Basic Auth username and leave the password empty. Do not send it as an Authorization Bearer header. If a predict or train call 401s while the key works on the dashboard, check the auth scheme before rotating the key.

Context: Official docs (docs.nanonets.com, API reference overview): the Nanonets API uses HTTP Basic Auth, not a Bearer header. The API key goes in the username field and the password is left blank, with requests.example as auth=HTTPBasicAuth('YOUR_API_KEY', ''). Gotcha that trips agents: every other API in a pipeline probably uses Bearer headers, so a Nanonets call with Authorization Bearer returns 401 even with a valid key. In curl this is just -u 'API_KEY value ' with the trailing colon and nothing after it.