NVIDIA_API_KEY access

I’m trying to follow this guide and I keep getting the same error.
It says To get started, create a free account with the NVIDIA API catalog and follow these steps:

  1. Select any model.
  2. Choose Python, Get API Key .
  3. Save the generated key as NVIDIA_API_KEY.

From there, you should have access to the endpoints.

This is exactly what I do and I keep getting this error:

Exception: [401] Unauthorized
invalid response from UAM
Please check or regenerate your API key.

When I run the provided sample code:
from langchain_nvidia_ai_endpoints import ChatNVIDIA

client = ChatNVIDIA(
  model="meta/llama-3.1-405b-instruct",
  api_key=api_key, 
  temperature=0.2,
  top_p=0.7,
  max_tokens=1024,
)

for chunk in client.stream([{"role":"user","content":"Write a limerick about the wonders of GPU computing."}]): 
  print(chunk.content, end="")

Hi! Have you found a fix for this issue? Got the same problem and I can’t think of a solution

Please try generating a new API Key and using that.

what’s the the term of validity of the api key? I found that it often failed in another day.

1 Like

Generating new API key doen’t solve it

בתאריך יום ה׳, 9 בינו׳ 2025, 13:22, מאת Pengyiyu2012 via NVIDIA Developer Forums ‏<notifications@nvidia.discoursemail.com>:

any update on this new api key is throwing 403 after ~24 hours, is there any validity of a api key?

Sorry to hear this - have passed on your feedback to the team who are working to improve the experience.