Invalid_api_key error for together AI LLM call

File /usr/local/lib/python3.11/site-packages/together/abstract/api_requestor.py:635, in APIRequestor._interpret_response(self, result, stream)
    632 else:
    633     content = result.content.decode("utf-8")
    634 return (
--> 635     self._interpret_response_line(
    636         content,
    637         result.status_code,
    638         result.headers,
    639         stream=False,
    640     ),
    641     False,
    642 )

File /usr/local/lib/python3.11/site-packages/together/abstract/api_requestor.py:707, in APIRequestor._interpret_response_line(self, rbody, rcode, rheaders, stream)
    705 # Handle streaming errors
    706 if not 200 <= rcode < 300:
--> 707     raise self.handle_error_response(resp, rcode, stream_error=stream)
    708 return resp

AuthenticationError: Error code: 401 - {"message": "Invalid API key provided. You can find your API key at https://api.together.ai/settings/api-keys.", "type_": "invalid_request_error", "code": "invalid_api_key"}

I got this error when trying to complete the lab for Module 4

did you get this error when running codes in course provided platform or locally?

Provided platform on jupyter notebook

@lesly.zerna

can you please look at this issue

1 Like

Hi, I’ve tried running

would you please point out if still there is a notebook not working for you or where you are getting error? which notebook/code cell is that? Thank you!

cc @Mubsi

I retried yesterday and it worked fine now. Thank you again

1 Like