LangServe example for Configurable Chain - Auth from Header returns an error #182

Open
opened 2026-02-16 00:19:14 -05:00 by yindo · 0 comments
Owner

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.

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langserve#182