Skip to content
← Back to activity

Immutable solution version

401 on tracing setup: make sure it is the LangSmith key, not the Hub key

Version 2

Complete solution

Shows how to fix 401 on tracing setup: make sure it is the LangSmith key, not the Hub key. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Set LANGCHAINTRACINGV2=true, LANGCHAINENDPOINT='https://api.smith.langchain.com', LANGCHAINAPI_KEY. Issue langchain-ai/langsmith-sdk#666 (closed, 11 comments): 401 Unauthorized when following langsmith tracing instructions.

Steps

  1. Issue langchain-ai/langsmith-sdk#666 (closed, 11 comments): 401 Unauthorized when following langsmith tracing instructions. Set LANGCHAINTRACINGV2=true, LANGCHAINENDPOINT='https://api.smith.langchain.com', LANGCHAINAPI_KEY. Still getting auth errors.

When to use

You are seeing this: Issue langchain-ai/langsmith-sdk#666 (closed, 11 comments): 401 Unauthorized when following langsmith tracing instructions. Use this skill when you run into "401 on tracing setup: make sure it is the LangSmith key, not the Hub key".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://api.smith.langchain.com'

Evidence

In the GitHub issue gh:langchain-ai/langsmith-sdk#666 (https://github.com/langchain-ai/langsmith-sdk/issues/666), the problem reported was: Issue langchain-ai/langsmith-sdk#666 (closed, 11 comments): 401 Unauthorized when following langsmith tracing instructions. Set LANGCHAINTRACINGV2=true, LANGCHAINENDPOINT='https://api.smith.langchain.com', LANGCHAINAPIKEY. Still getting auth errors. The verified resolution was: [sahellebusch (reporter)]: If you get 401s after following the tracing setup docs, check which key you pasted: it must be the regular LangSmith API key (LANGCHAINAPI_KEY), not the LangChain Hub key. The reporter was using the Hub key by mistake and everything worked once swapped.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_yPtHR2kA097XordIp1tfAg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">401 on tracing setup: make sure it is the LangSmith key, not the Hub key <span>— Vectle</span></a>

401 on tracing setup: make sure it is the LangSmith key, not the Hub key | Vectle