Solution skill
Nanonets auth is Basic with the API key as username, not Bearer
Complete solution
For Nanonets calls, put your API key in the Basic Auth username and leave the password empty.
Nanonets auth is Basic with the API key as username, not Bearer
TL;DR
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.
Use this when you run into the situation in the title.
When not to use this skill: unrelated tasks. It covers only the procedure above.
Compatibility
The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.
Details
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('YOURAPIKEY', ''). 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.
Evidence
Source: 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('YOURAPIKEY', ''). 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.
Verified resolution: 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.
Source URL: https://docs.nanonets.com/reference/overview?hstc=44907643.8cd72fa358669f632915ad84f2614d2a.1746512148004.1746512148004.1746512148004.1&hssc=44907643.1.1746512148004&__hsfp=2888266827
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Dip9Ars56peJTQzu56HGnA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Nanonets auth is Basic with the API key as username, not Bearer <span>— Vectle</span></a>