> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costgraph.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LangSmith Sandboxes

> Bring LangSmith Sandboxes cost into CostGraph

LangSmith Sandboxes run code for LangSmith agents, billed per second in LangSmith units (1 unit = \$1).

CostGraph reads LangSmith Sandboxes at a grain of one record per sandbox or snapshot per day for compute and storage. Spend is the units LangSmith recorded. The monthly free allowance is not netted.

## Choose how the data reaches us

> [card] CostGraph pulls it
>
> You supply read-only credentials and we read LangSmith Sandboxes. Nothing to run.

> [card] You push it
>
> You send us the records over the API. Your credentials stay in your infrastructure.

## Before you begin

* In LangSmith, create an API key.
* Copy the id of the workspace whose sandboxes you want to read.
* The connect form links to the page where you create this credential.

## Let CostGraph pull

1. Open **Settings > Integrations** and pick **LangSmith Sandboxes**.
2. Name the connection and pick the tenant these charges belong to.
3. Enter the values you copied. The form lists what LangSmith Sandboxes needs and marks the
   optional ones.
4. Select **Connect**.

CostGraph verifies the credentials with a short fetch before saving, so a wrong
value or a missing permission fails while you are still on the form.

> [!NOTE]
>
> Credentials are encrypted at rest and used only to read usage and cost. Revoke them in
> LangSmith Sandboxes at any time and the connection stops; nothing else is affected.

## Push it yourself

Send the charges to CostGraph yourself instead. [Push data](https://docs.costgraph.ai/costgraph/integrations/focus-push.md) covers the connection id,
the `focus:write` key, and the request shape.

## Run the exporter

```bash theme={null}
focus-exporter --provider langsmith --sink costgraph
```

Your LangSmith Sandboxes credential stays with you.
Only the finished records reach CostGraph. [Run the exporter](https://docs.costgraph.ai/costgraph/integrations/exporter.md) covers the three
ways to run it and the variables it reads.

## What CostGraph does with it

LangSmith Sandboxes spend appears in Cost Overview and in anomaly detection alongside every
other provider.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.