mirror of
https://github.com/langchain-ai/langserve.git
synced 2026-07-16 09:34:30 -04:00
LangServe example for Configurable Chain - Auth from Header returns an error #182
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alankashkash on GitHub (May 19, 2024).
Running LangServe example for Configurable Chain - Auth from Header from https://github.com/langchain-ai/langserve/tree/main/examples/configurable_chain
returns an error:
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: placeholder. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}I verified that api key is provided correctly and api key itself is valid. While printing env variable it returns the correct api key.
The problem is with passing api key as a variable. I checked it with 2 models - OpenAI and Groq, and with passing as a header and in a standard way as a normal configurable. In all cases the same issue - "placeholder" value is passed by causing an error of an incorrect api key.