Closed ggjx22 closed 1 week ago
Can you check if you are getting the correct API key from env.
Hmm I'm not sure what's going on. I switch to a Mac workstation with the exact piece of code in my issue above and the parser is working.
I think it could be that env was not being picked correctly on your previous setup. Try printing it and check if it is getting correct API key or not.
Bumping this because I am getting the same issue here. Using a valid OpenAI key, initializing both in the environment as 'LLAMA_CLOUD_API_KEY', and passing it as a parameter to Llama Parse, but I get:
raise Exception(f"Failed to parse the PDF file: {response.text}")
Exception: Failed to parse the PDF file: {"detail":"Invalid authentication token"}
I am on Linux (Ubuntu), in a conda environment using Python 3.9. The call to openAI models works with this api key. In the tutorials, I also see the llama api key as looking like "llx...", whereas all of my keys from OpenAI start with "sk-...". Is there a different place to generate a llama key, or should a regular OpenAI key work?
Thanks for any info!
LlamaCloud keys are totally different from openai keys!
Llamacloud api keys are used to parse pdf files! You can generate one here: cloud.llamaindex.ai
HAH! I am not familiar with the llama environment yet, so I was following the generic llama-index "getting started" guide, and trying to use an OpenAI key (https://docs.llamaindex.ai/en/stable/getting_started/starter_example.html)
Thank you so much for the link anoopshrma
-Rani
Sure no worries. Happy to help! Feel free to post any issue 💪
I got same error, but I solved this.
When I set api_key={My OpenAI API key}
like the document said, I got an error.
Just change api_key={My Llama cloud API key}
. then the problem will be solved.
(But I don't know why either. Maybe the document is wrong?)
You can get Llama Cloud API key in here: https://cloud.llamaindex.ai/
Hello Team,
Really like your work on LlamaParse. The web app is working fine for PDF parsing but not the package. Even when a new cloud API key is used, I got the same error.