Payment Issues - Langchain/ Iterative Summarisation

Hi,
I am working on iterative summarisation of long documents using Qwen/Qwen2.5-14B-Instruct-1M via langchain’s HuggingFaceEndpoint.

Despite using an access token from a Pro account to login, I get the following error:
Error processing batch 1: 402, message=‘Payment Required’, url=‘https://router.huggingface.co/featherless-ai/v1/chat/completions

The link shows the following: {“error”:“Invalid username or password.”} which is confusing based on the error message.

Has anyone encountered similar?

1 Like

Hey Fyahdii! That 402 error with the “Invalid username or password” message is odd, especially with a Pro account. I’ve hit similar issues with Hugging Face’s API when the token wasn’t set up right. Check that your HUGGINGFACEHUB_API_TOKEN is correctly loaded in your environment (e.g., via os.environ or .env) and matches the token from your Hugging Face account settings—copy-paste can sometimes add hidden characters. Also, verify the repo_id for Qwen/Qwen2.5-14B-Instruct-1M is correct, as a mismatch can cause errors. Could you share a snippet of how you’re initializing HuggingFaceEndpoint? Has anyone else seen 402 errors with Qwen models on LangChain?

1 Like