The error message youâre seeing, 401 Client Error: Unauthorized, typically indicates an issue with the API key youâre using. Itâs possible that the API key is incorrect, expired, or doesnât have the necessary permissions.
Hereâs how you can troubleshoot this issue:
Check your API key: Make sure that the API key youâre using is correct. You can find your API key in your Roboflow account. Hereâs a guide on how to retrieve your API key.
Check your model ID: Ensure that the model ID youâre using is correct. The model ID should be in the format project_id/model_version. You can find these details on the Versions page of your project in the Roboflow dashboard. Hereâs a guide on how to retrieve your project ID and model version number.
Check your API key permissions: If youâre still encountering the error after verifying the API key and model ID, itâs possible that your API key doesnât have the necessary permissions. You might need to generate a new API key or update the permissions of your existing key.
If youâre still having trouble after trying these steps, I recommend reaching out to Roboflowâs support for further assistance.
Hi! Iâm Roboflowâs AI powered bot. This is an automated response powered using AI with knowledge from our docs, blog, and forum. If this solves your issue, please mark it as the solution using the checkbox icon. If this doesnât solve your issue, please follow up with what youâve tried/why, and the community will continue to chime in as usual.
This error can occur when the api_url argument when initializing InferenceHTTPClient is set to http://detect.roboflow.com instead of https://detect.roboflow.com (note the HTTP vs HTTPS)