LangSmith tracing configuration throws 405 Method Not Allowed error when connecting to EU endpoint

Having trouble with LangSmith tracing setup

I’m getting errors when trying to set up LangSmith for tracking my language model calls. The error messages mention connection issues and 405 errors from the European endpoint.

My setup process:

  1. Created a clean Python environment:
conda create --name langsmith_test python=3.11
conda activate langsmith_test
pip install langchain langchain-openai python-dotenv
  1. Set up environment variables in .env:
LANGCHAIN_TRACING_V2="true"
LANGCHAIN_ENDPOINT="https://eu.smith.langchain.com/"
LANGCHAIN_API_KEY="your_api_key_here"
LANGCHAIN_PROJECT="MyTestProject"
OPENAI_API_KEY="your_openai_key"
  1. Simple test script app.py:
from langchain_openai import ChatOpenAI
from dotenv import load_dotenv

load_dotenv(".env")

def main():
    chat_model = ChatOpenAI(model="gpt-3.5-turbo")
    response = chat_model.invoke("Hi there!")
    print(response)

if __name__ == "__main__":
    main()

Error output:

Failed to get info from https://eu.smith.langchain.com: JSONDecodeError('Expecting value: line 1 column 1 (char 0)')
Failed to batch ingest runs: LangSmithError("Failed to POST https://eu.smith.langchain.com/runs/batch in LangSmith API. HTTPError('405 Client Error: Method Not Allowed for url: https://eu.smith.langchain.com/runs/batch'...")

Any ideas what might be causing this connection issue? The API key should be valid and I’m using the correct EU endpoint URL.

yep, i had this error too! just gotta remove that trailing slash from the endpoint. update LANGCHAIN_ENDPOINT="https://eu.smith.langchain.com/" to LANGCHAIN_ENDPOINT="https://eu.smith.langchain.com" and it should work fine. hope that helps!

This usually means your environment config doesn’t match the actual endpoint. I hit the same thing switching between US and EU regions. The 405 error means the endpoint exists but won’t take POST requests at that path. Double-check you’re using the right base URL - EU endpoints sometimes route differently than US ones. Before you go down a debugging rabbit hole, just verify your project actually exists in EU. Log into eu.smith.langchain.com and make sure you can see your project there. I’ve seen projects created in one region not sync to others. Also try switching temporarily to the US endpoint (https://api.smith.langchain.com) with the same code. If it works, you know it’s an EU routing issue or regional permissions problem. That’s how I figured out if it was my config or a regional API bug.

check if ur missing the langsmith package. i hit the same weird issue - turns out i’d only installed langchain but forgot pip install langsmith. without it, tracing tries to work but fails in bizarre ways with exactly those errors ur seeing.

Quick debugging tip from someone who’s dealt with this exact mess before.

You’ve got two separate issues. The JSONDecodeError hits first when LangSmith tries to fetch project info, then the 405 comes after when it attempts the batch upload anyway.

Try this debug approach:

import requests
import os
from dotenv import load_dotenv

load_dotenv(".env")

api_key = os.getenv("LANGCHAIN_API_KEY")
headers = {"Authorization": f"Bearer {api_key}"}

# Test the info endpoint first
response = requests.get("https://eu.smith.langchain.com/info", headers=headers)
print(f"Status: {response.status_code}")
print(f"Response: {response.text}")

This’ll show you exactly what the EU endpoint is returning. I’ve seen cases where the EU endpoint was temporarily routing to the wrong service, returning HTML instead of JSON.

If you get a 200 with proper JSON, the trailing slash issue Tom mentioned is probably it. If you get 403 or weird HTML responses, your key isn’t configured for EU access.

Also check if your project name exists in the EU region. The error pattern suggests LangSmith can’t find your project metadata, so it fails gracefully but still tries to send traces.

Had the same issue last month - turned out to be an auth problem with the EU endpoint. Check if your API key is actually set up for the European region. I made mine through the US interface and it wouldn’t work with eu.smith.langchain.com. You’ll probably need to regenerate the key specifically for EU access. Try hitting the endpoint with curl first to test connectivity before running your Python script. A 405 error means the endpoint’s there but won’t accept your HTTP method - usually points to auth issues, not connection problems.

Been there with API monitoring - debugging endpoint issues is such a pain. Skip the LangSmith headaches and set up monitoring that actually works.

I use Latenode for this. Build a workflow that tracks LLM calls without connection drama. Set up automation to capture ChatOpenAI responses, dump data into Google Sheets or your database, get alerts when stuff breaks.

Best part? No vendor-specific endpoint nonsense. Create a webhook in Latenode that grabs your model outputs, processes however you want, stores traces your way. 10 minutes to set up, then forget about 405 errors and regional API garbage.

I’ve run this setup for months across different models - rock solid. Way better than wrestling with tracing service bugs.