import os
os.environ[“ROBOFLOW_API_KEY”] = “my roboflow API key”
but when executing:
model = get_model(model_id=“my model id”)
i get:
inference.core.exceptions.RoboflowAPINotAuthorizedError: Unauthorized access to roboflow API - check API key. Visit Authentication | Roboflow Docs to learn how to retrieve one.
API keys are scoped to your workspace. Can you make sure that you are getting the api key from the workspace your model is? If that doesn’t work, instead of using an environment variable, try passing the API key to the get_model call
model = get_model(model_id="your model id", api_key="apikeyhere")