langchain-ai / langsmith-sdk

LangSmith Client SDK Implementations
https://docs.smith.langchain.com/
MIT License
421 stars 80 forks source link

Issue: Authentication failed (401) for https://api.smith.langchain.com/runs/multipart #1201

Open leucir opened 2 weeks ago

leucir commented 2 weeks ago

Issue you'd like to raise.

When executing invoke() the following error happens:

Failed to multipart ingest runs: langsmith.utils.LangSmithAuthError: Authentication failed for https://api.smith.langchain.com/runs/multipart. HTTPError('401 Client Error: Unauthorized for url: https://api.smith.langchain.com/runs/multipart', '{"detail":"Using legacy API key. Please generate a new API key."}')trace=2ea67b21-18ee-4c72-9e2e-7630faf2c7a0,id=2ea67b21-18ee-4c72-9e2e-7630faf2c7a0; trace=2ea67b21-18ee-4c72-9e2e-7630faf2c7a0,id=8ec43343-85b0-4043-b2e4-497ceb25f898; trace=2ea67b21-18ee-4c72-9e2e-7630faf2c7a0,id=11243325-4863-4264-9bc8-ff469b9f113b

I've created at least 2 new API keys, but the error persists.

The following environment variables are set:

LANGSMITH_API_KEY="lsv2_pt_nonononononononon"
LANGSMITH_ENDPOINT="https://api.smith.langchain.com"
LANGCHAIN_TRACING_V2="true"
LANGCHAIN_PROJECT="project_bond_101"

To be precise, it worked once, and then failed after that first execution.

pip list | grep lang returns:

langchain                                0.3.7
langchain-community                      0.3.5
langchain-core                           0.3.15
langchain-openai                         0.2.5
langchain-text-splitters                 0.3.2
langgraph                                0.2.45
langgraph-checkpoint                     2.0.2
langgraph-checkpoint-sqlite              2.0.1
langgraph-sdk                            0.1.35
langsmith                                0.1.142

Suggestion:

No response

dansashalesser commented 5 days ago

I've had the same issue, generated several keys and still not working.

mingxuan-he commented 2 days ago

same issue here

sebj84 commented 2 days ago

Same for me

sebj84 commented 2 days ago

It's solved on my side. I had to renew my langsmith API key with no obvious reason (maybe a new feature because the option "service API" seems to be available). The new format of the key start with "lsv2_"