```ApiError Trace...
# timegpt
p
Copy code
ApiError                                  Traceback (most recent call last)
<ipython-input-7-01587ebdecfc> in <cell line: 5>()
      3     api_key = 'my_api_key_provided_by_nixtla'
      4 )
----> 5 fcst_df = nixtla_client.forecast(df, h=24, level=[80, 90])
15 frames
Copy code
/usr/local/lib/python3.10/dist-packages/nixtlats/client.py in model_params(self, request)
    248         except JSONDecodeError:
    249             raise ApiError(status_code=_response.status_code, body=_response.text)
--> 250         raise ApiError(status_code=_response.status_code, body=_response_json)
    251 
    252     def timegpt(self, *, request: SingleSeriesForecast) -> typing.Any:
ApiError: status_code: 401, body: {'status': 401, 'data': None, 'message': 'Invalid API key', 'details': 'Key not found, verify in https://dashboard.nixtla.io', 'code': 'A12', 'support': 'If you have questions or need support, please email ops@nixtla.io', 'requestID': 'WFL6GQ9NXA'} How to resolve this error?
m
Hello! It seems like you did not provide a valid API key. You need to replace the string
'my_api_key_provided_by_nixtla'
by the actual key that you can get at this link. I hope this helps!