Pointing the LangSmith SDK and CLI at a non-US regional endpoint
Last updated: July 16, 2026
Symptom
Your LangSmith org is hosted in EU, APAC, or AWS US, but running the SDK or langsmith auth / langgraph auth fails or behaves as if the API key is invalid: auth errors, missing traces, or the wrong org context. The client is talking to the US endpoint, and the API key from your non-US org is not valid there.
Cause
LangSmith clients (Python SDK, JS SDK, and the CLI) pick the API endpoint in this order:
Explicit constructor or flag argument
LANGSMITH_ENDPOINTenvironment variableLANGCHAIN_ENDPOINT(legacy alias)A saved CLI profile's
api_urlBuilt-in default:
https://api.smith.langchain.com(GCP US)
There is no region auto-detection. An API key from a non-US org carries no region hint, so if you do not override the endpoint the client falls through to the US default and the key is rejected.
Data also does not cross regions. An org created at apac.smith.langchain.com only exists in APAC, so its keys only work against the APAC API.
Resolution
Generate the key in the regional UI, then point every environment where the SDK or CLI runs at that region's API URL.
1. Create the API key in the correct regional UI
Region | UI URL |
|---|---|
GCP US (default) |
|
GCP EU |
|
GCP APAC |
|
AWS US |
|
2. Set the endpoint and key in the environment
Export both variables wherever the SDK, langsmith auth, or langgraph auth runs. Example for APAC:
export LANGSMITH_ENDPOINT="https://apac.api.smith.langchain.com"
export LANGSMITH_API_KEY="<key from the APAC org>"Substitute the API URL for your region:
Region | API URL |
|---|---|
GCP US |
|
GCP EU |
|
GCP APAC |
|
AWS US |
|
These two variables are enough. With them set, langgraph auth and the SDKs authenticate against the correct region.
3. Optional: save the region in a CLI profile
To avoid setting LANGSMITH_ENDPOINT in every shell, save the regional URL in the CLI profile's api_url field. The CLI will then use that URL by default.