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

# Estimated cost missing in logs table with project-level providers

> [!NOTE]
>
> **Applies to:**
>
> * Plan - Any
> * Deployment - Any
> *
> * Use case - Logs table showing dashes in estimated cost column despite cost appearing in the trace metrics panel when using custom AI providers

## Summary

**Issue:** The `Estimated cost` column in the Logs table shows `–` for all rows, even though the trace metrics panel displays a cost value correctly.

**Cause:** The Logs table reads `metrics.estimated_cost` from the root span, which only populates when custom AI providers are registered at the **organization** level. Providers configured at the project level only are not used during root span cost rollup.

**Resolution:** Re-register your custom AI providers at the organization level under ** Settings** > [** Models**](https://www.braintrust.dev/app/~/configuration/models/organization).

## Resolution steps

### If you are using custom AI providers

#### Step 1: Confirm provider scope

Check where your custom providers are currently configured.

1. Go to ** Settings** > [** Models**](https://www.braintrust.dev/app/~/configuration/models/organization).
2. Compare the **Organization** and **Project** tabs, and note whether providers are listed only on the **Project** tab.

If they are project-level only, proceed to Step 2.

#### Step 2: Add providers at the organization level

For each custom provider configured only at the project level, create an organization-level provider with the same configuration and model pricing:

1. Go to ** Settings** > [** Models**](https://www.braintrust.dev/app/~/configuration/models/organization) and click  **Organization provider**.
2. Choose **Custom providers** >  **New**.
3. On the **Setup** tab, choose the **Provider format**, enter a **Name**, and configure the required credentials and endpoint.
4. Under **Models**, click  **Custom model**. Enter the exact model name logged in `metadata.model`.
5. Click the  settings icon beside the model and enter the same input and output cost values.
6. Click **Create**.

#### Step 3: Verify the fix

Reload the Logs table. The `Estimated cost` column should now populate for new and existing traces where token metrics are present.

### If providers are already at the org level

#### Step 1: Confirm root span token metrics

Run the following query to check whether the root span has `metrics.estimated_cost` populated:

```sql theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
SELECT
  id,
  root_span_id,
  metrics.estimated_cost,
  estimated_cost() AS cost_fn,
  metrics.prompt_tokens,
  metrics.completion_tokens,
  metadata.model,
  span_attributes.type
FROM project_logs('<YOUR_PROJECT_ID>', shape => 'summary')
WHERE root_span_id = '<YOUR_TRACE_ID>'
LIMIT 5
```

If `metrics.estimated_cost` is `null` but `cost_fn` returns a value, the root span rollup is not propagating from child spans.

#### Step 2: Check child LLM span costs

```sql theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
SELECT
  root_span_id,
  metadata.model,
  SUM(estimated_cost()) AS total_cost,
  SUM(metrics.prompt_tokens) AS prompt_tokens,
  SUM(metrics.completion_tokens) AS completion_tokens,
  COUNT(1) AS spans
FROM project_logs('<YOUR_PROJECT_ID>')
WHERE root_span_id = '<YOUR_TRACE_ID>'
  AND span_attributes.type = 'llm'
GROUP BY 1, 2
```

If child spans return cost but the root does not, contact Braintrust support with the project ID, root span IDs, and query results.

#### Step 3: Use a custom column as a workaround

While investigating, add a custom column using the `estimated_cost()` SQL function, which falls back to per-span token pricing when `metrics.estimated_cost` is null.


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