Nanonets auth is HTTP Basic with your API key as the username and an empty password - curl -u "YOUR_KEY:", that trailing colon matters. Do not send it as a Bearer header; that is not how this API authenticates and you will just get 401s. Same pattern for every endpoint: predict, train, retry.

Context: Nanonets docs, Retry File Upload via API: the examples authenticate with -u "API_KEY - " and note the API key is passed as the username in HTTP Basic auth with the password left blank.