Running into basic access problem with new key created

I am trying to test out Langsmith by running it with a simple example, with a new key created with my personal account. I have double checked that I copy and pasted the key properly.

However, I keep on getting this error:

WARNING:langsmith.client:Failed to send compressed multipart ingest: langsmith.utils.LangSmithError: Failed to POST https://api.smith.langchain.com/runs/multipart in LangSmith API. HTTPError(‘403 Client Error: Forbidden for url: https://api.smith.langchain.com/runs/multipart’, ‘{“error”:“Forbidden”}\n’)

Hey Felix

To troubleshoot, could you try:

  1. If you’re using a venv, restarting the venv and printing it out with os.environ.get("LANGSMITH_API_KEY")
  2. If that doesn’t work, can you try pasting it directly into the client
1 Like

Hi @nhuang , my LangChain training participants sometimes hit this issue on newly created accounts and keys (personal key on the default workspace). Is there some security safeguard that kicks in somehow? I don’t hit this issue on my “older” key.

Related: Langchain_auth Client always return 403 even with valid Langsmith API key

Indirectly related (case of a service key) : LangSmith API Error: 403 Forbidden - org_scoped_key_requires_workspace

It seems that it might be related to picking the wrong region between eu and non-eu.

I figured out what was causing this.

If you create the setup manually, the project needs to be created first in the LangSmith dashboard, and only then should the API key be generated and used. If the project doesn’t already exist, LangSmith can return 403 / multipart ingest errors even when an API key is configured.

What worked for me:

  1. Manually create the project in the LangSmith UI

  2. Generate the API key after that

  3. Set LANGCHAIN_PROJECT to the created project name

  4. Run the code again

Once I followed this order, tracing and multipart ingest worked correctly. This requirement isn’t very obvious, so documenting it could help avoid confusion for new users.

1 Like