Exporting Self-Hosted LangSmith Usage Data

Last updated: March 5, 2026

Customers running self-hosted LangSmith can export usage telemetry and share it with the LangChain team for reporting and support purposes.

This guide walks through retrieving your customer information and exporting usage data to CSV files that can be provided to LangChain.


Prerequisites

Before exporting usage data, ensure the following requirements are met:

  • Helm chart version 0.11.4 or later

  • Access to your LangSmith API endpoint

  • Access to your LangSmith PostgreSQL database

  • curl installed

  • (Recommended) jq installed for parsing JSON responses


Step 1: Retrieve Customer Information

Before running the export scripts, you must retrieve your customer ID and customer name from the LangSmith API.

Run the following command:

curl https://<langsmith_url>/api/v1/info

If your deployment uses a subdomain or path prefix, use:

curl https://<langsmith_url>/<prefix>/api/v1/info

Example response:

{
"version": "0.11.4",
"license_expiration_time": "2026-08-18T19:14:34Z",
"customer_info": {
"customer_id": "<id>",
"customer_name": "<name>"
}
}

From this response, note the following values:

  • customer_id

  • customer_name

These values are required when running the export scripts.


Step 2: Parse the Response Using jq (Recommended)

You can automatically extract the required values using jq.

export LANGSMITH_URL="<your_langsmith_url>"

response=$(curl -s $LANGSMITH_URL/api/v1/info)

export CUSTOMER_ID=$(echo "$response" | jq -r '.customer_info.customer_id')
export CUSTOMER_NAME=$(echo "$response" | jq -r '.customer_info.customer_name')

echo "Customer ID: $CUSTOMER_ID"
echo "Customer Name: $CUSTOMER_NAME"

These environment variables can now be used in the export commands.


Step 3: Set Variables Manually (Alternative)

If jq is not available, run the API request and manually copy the values.

curl -s $LANGSMITH_URL/api/v1/info

Then set the variables:

export CUSTOMER_ID="<id>"
export CUSTOMER_NAME="<name>"

Step 4: Export Usage Data

The export scripts generate CSV files containing usage data. These files can be shared with the LangChain team.

Each export also assigns a backfill ID and timestamp to track the export.


Export LangSmith Trace Usage

Run the following command:

export LANGSMITH_URL="<your_langsmith_url>"

response=$(curl -s $LANGSMITH_URL/api/v1/info)

export CUSTOMER_ID=$(echo "$response" | jq -r '.customer_info.customer_id')
export CUSTOMER_NAME=$(echo "$response" | jq -r '.customer_info.customer_name')

sh run_support_query_pg.sh <postgres_url> \
--input support_queries/postgres/pg_usage_traces_backfill_export.sql \
--output ls_export.csv \
-v customer_id=$CUSTOMER_ID \
-v customer_name=$CUSTOMER_NAME

This command generates:

ls_export.csv

Export LangSmith Node Usage

To export node usage data:

sh run_support_query_pg.sh <postgres_url> \
--input support_queries/postgres/pg_usage_nodes_backfill_export.sql \
--output lgp_export.csv \
-v customer_id=$CUSTOMER_ID \
-v customer_name=$CUSTOMER_NAME

This command generates:

lgp_export.csv

Step 5: Share the Export with LangChain

After running the scripts, you will have two CSV files:

  • ls_export.csv

  • lgp_export.csv

Provide these files to your LangChain account representative or to our Support team for usage reporting and analysis.