This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Bare minimum example on website is wrong #44
Closed
IgorWounds
started this conversation in
General
Replies: 2 comments
-
Did you use your real API key ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Auth error comes from not using a real API key. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
The bare minimum example of querying the API via Python is not correct.
If you try the code below it will fail with an 401 Authorization error:
The example that should be shown instead is the one that features the addition of the
extra_headers
that allow this to work:Looking forward to having this fixed as it is easy for beginners to trip here.
This also resulted in libraries like
litellm
andmagentic
not properly supporting adding a custom header for Perplextiy to work with custom keys that aren't defined as environment variables.Beta Was this translation helpful? Give feedback.
All reactions