# Payment Issues - Langchain/ Iterative Summarisation

**URL:** <https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774>\
**Category:** Beginners\
**Created:** [July 4, 2025, 10:22am UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774 "2025-07-04T10:22:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fyahdii](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fyahdii/32/50610_2.png) [@Fyahdii](https://discuss.huggingface.co/u/Fyahdii)\
**Post date:** [July 4, 2025, 10:22am UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/1 "2025-07-04T10:22:03Z")

</div>

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](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?

---

<div class="post-metadata">

**Author:** ![AD0021](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AD0021](https://discuss.huggingface.co/u/AD0021)\
**Post date:** [July 4, 2025, 3:34pm UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/2 "2025-07-04T15:34:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 4, 2025, 8:37pm UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/3 "2025-07-04T20:37:29Z")

</div>

For 402 error, refer this:

> [@Hugging Face Payment Error 402 & You've Exceeded Monthly Quota](https://discuss.huggingface.co/t/hugging-face-payment-error-402-youve-exceeded-monthly-quota/144968):
>
> Whenever I want generate a response from the api it shows payment error 402 and this link “[https://huggingface.co/api/inference-proxy/hf-inference/models/Qwen/QwQ-32B/v1/chat/completions](https://huggingface.co/api/inference-proxy/hf-inference/models/Qwen/QwQ-32B/v1/chat/completions)”. After tapping on the link it showing “Sorry, we can’t find the page you are looking for.” Also showing this promise error in console “You have exceeded your monthly included credits for Inference Providers. Subscribe to PRO to get 20x more monthly allowance.”, I haven’t use a bit. I create a new account for t…

---

<div class="post-metadata">

**Author:** ![Fyahdii](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fyahdii/32/50610_2.png) [@Fyahdii](https://discuss.huggingface.co/u/Fyahdii)\
**Post date:** [July 6, 2025, 9:07am UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/4 "2025-07-06T09:07:07Z")

</div>

Thank you for responding and for your help. I think I have been able to resolve this by generating a new token and using that one instead.

---

<div class="post-metadata">

**Author:** ![Fyahdii](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fyahdii/32/50610_2.png) [@Fyahdii](https://discuss.huggingface.co/u/Fyahdii)\
**Post date:** [July 6, 2025, 9:54am UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/5 "2025-07-06T09:54:15Z")

</div>

Nevermind the error came back again

---

<div class="post-metadata">

**Author:** ![Fyahdii](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fyahdii/32/50610_2.png) [@Fyahdii](https://discuss.huggingface.co/u/Fyahdii)\
**Post date:** [July 6, 2025, 11:05am UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/6 "2025-07-06T11:05:12Z")

</div>

Here is my code snippet: llm = HuggingFaceEndpoint(  
repo\_id=“Qwen/Qwen2.5-14B-Instruct-1M”,  
task=“text-generation”,  
max\_new\_tokens=20,  
do\_sample=False,  
repetition\_penalty=1.03,  
temperature=0.00  
)

chat = ChatHuggingFace(llm=llm, verbose=True)

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 6, 2025, 11:18am UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/7 "2025-07-06T11:18:07Z")

</div>

It seems that this may also occur due to permission settings on Hugging Face’s side?

> [@402 Client Error: Payment Required for url: https://router.huggingface.co/hf-inference/models/meta-llama/Llama-3.3-70B-Instruct/v1/chat/completions (Request ID: Root=1-67e420cf-1ec0ac2a3a3102965c52fe0f;8fe0d876-5406-4953-9fd4-e7b03cd17bb5)](https://discuss.huggingface.co/t/402-client-error-payment-required-for-url-https-router-huggingface-co-hf-inference-models-meta-llama-llama-3-3-70b-instruct-v1-chat-completions-request-id-root-1-67e420cf-1ec0ac2a3a3102965c52fe0f-8fe0d876-5406-4953-9fd4-e7b03cd17bb5/148414/3):
>
> Hi @TUSTResearcher Typically, this error message occurs if there isn’t a payment method on your account or your access token doesn’t have the right permissions. Let us know if you’re still having issues!

---

<div class="post-metadata">

**Author:** ![Fyahdii](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fyahdii/32/50610_2.png) [@Fyahdii](https://discuss.huggingface.co/u/Fyahdii)\
**Post date:** [July 6, 2025, 12:21pm UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/8 "2025-07-06T12:21:18Z")

</div>

Thanks for your help. Based on the linked post, the token I am using appears to have the correct permissions, and there is a payment method with an active subscription on the account, so I suspect it’s most likely something else. Do you know how I might check the permission settings?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 6, 2025, 12:23pm UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/9 "2025-07-06T12:23:56Z")

</div>

Hmm… I don’t know how to check that on the user side…  
It may be quicker to contact Hugging Face. @meganariley [billing@huggingface.co](mailto:billing@huggingface.co)

---

<div class="post-metadata">

**Author:** ![Fyahdii](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/fyahdii/32/50610_2.png) [@Fyahdii](https://discuss.huggingface.co/u/Fyahdii)\
**Post date:** [July 6, 2025, 12:46pm UTC](https://discuss.huggingface.co/t/payment-issues-langchain-iterative-summarisation/161774/10 "2025-07-06T12:46:29Z")

</div>

Thank you, will do so
