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

# Confident AI

> Learn how to export LLM Gateway traces to Confident AI using OpenTelemetry integration.

This guide provides instructions for integrating [Confident AI](https://www.confident-ai.com/) with the TrueFoundry AI Gateway to export OpenTelemetry traces.

## What is Confident AI?

Confident AI is an AI observability and evaluation platform for LLM applications. Its Observatory ingests OTLP traces so you can monitor completions, debug agent workflows, run online evaluations, and analyze latency and cost alongside production traffic.

### Key capabilities

* **[LLM tracing & observability](https://www.confident-ai.com/docs/llm-tracing/quickstart)**: End-to-end traces for LLM calls, tools, and agent steps with inputs, outputs, and latency
* **[OpenTelemetry ingestion](https://www.confident-ai.com/docs/integrations/opentelemetry)**: Accepts OTLP/HTTP traces with API key authentication via the `x-confident-api-key` header
* **[Online evaluation](https://www.confident-ai.com/docs/llm-tracing/quickstart)**: Run DeepEval metrics on traces and spans as they are ingested

## Prerequisites

Before integrating Confident AI with TrueFoundry, ensure you have:

1. **TrueFoundry account**: Create a [TrueFoundry account](https://www.truefoundry.com/register) and follow our [Gateway Quick Start Guide](https://docs.truefoundry.com/gateway/quick-start)
2. **Confident AI account**: Sign up at [Confident AI](https://www.confident-ai.com/) and access your project dashboard
3. **Confident AI API key**: Create an API key from your Confident AI project settings — it is used to authenticate OTLP trace export

<Note>
  The TrueFoundry **OTEL Config** export sends **traces only** for the AI
  Gateway. It does not export OTEL metrics from this screen.
</Note>

## OTLP traces endpoint

Confident AI exposes a dedicated OTLP/HTTP traces endpoint. Use the URL for your region:

```
https://otel.confident-ai.com/v1/traces
```

For EU deployments:

```
https://eu.otel.confident-ai.com/v1/traces
```

Confident AI accepts **OTLP over HTTP only** — gRPC is not supported.

## Integration steps

TrueFoundry AI Gateway supports exporting OpenTelemetry traces to Confident AI over OTLP/HTTP so you can monitor LLM gateway traffic in the Confident AI Observatory.

<Steps>
  <Step title="Create a Confident AI API key">
    1. Log in to your [Confident AI dashboard](https://app.confident-ai.com/).
    2. Open your project and go to **Settings** → **API Keys** (or the API key section in your project settings).
    3. Create a new API key, copy it, and store it securely — you will use it in the `x-confident-api-key` header.

    <Tip>
      The API key is tied to your Confident AI project. Traces exported from TrueFoundry land in that project when you use this key.
    </Tip>
  </Step>

  <Step title="Configure OTEL export in TrueFoundry">
    1. Go to **AI Gateway** → **Controls** → **Settings** in the TrueFoundry dashboard.
    2. Scroll to **OTEL Config** and click the edit (pencil) control.
    3. Enable **Otel Traces Exporter Configuration**.
    4. Select **HTTP Configuration**.
    5. Set **Endpoint** to `https://otel.confident-ai.com/v1/traces` (or the EU endpoint if your project is in the EU region).
    6. Set **Encoding** to **Json**.

    <Frame>
      <img src="https://mintcdn.com/truefoundry/Alv09-TPx-CwFex0/images/ConfidentAIConfigure.png?fit=max&auto=format&n=Alv09-TPx-CwFex0&q=85&s=39a4e504f46f96f39513ccf8e260c08b" alt="TrueFoundry OTEL Traces Exporter Configuration for Confident AI with HTTP endpoint, Json encoding, Content-Type header, and x-confident-api-key" width="947" height="875" data-path="images/ConfidentAIConfigure.png" />
    </Frame>
  </Step>

  <Step title="Configure headers and save">
    Enable **Headers** and add:

    | Header                | Value                    |
    | --------------------- | ------------------------ |
    | `Content-Type`        | `application/json`       |
    | `x-confident-api-key` | `<Confident_AI_API_Key>` |

    Replace `<Confident_AI_API_Key>` with the key from Step 1. Click **Save** to apply the configuration.

    <Tip>
      Leave **Exclude Request Data** unchecked if you want Confident AI to receive LLM request and response payloads via the `tfy.input` and `tfy.output` span attributes.
    </Tip>
  </Step>

  <Step title="Verify the integration">
    1. Send a few requests through the TrueFoundry AI Gateway.
    2. In TrueFoundry, open **Monitor** to confirm gateway traffic is flowing.
    3. In Confident AI, go to **Observability** → **Traces**.
    4. Confirm new traces appear with latency, environment, and status details for your gateway requests.

    <Frame>
      <img src="https://mintcdn.com/truefoundry/Alv09-TPx-CwFex0/images/ConfidentAITesting.png?fit=max&auto=format&n=Alv09-TPx-CwFex0&q=85&s=4ed1020392782c957fce61407218cb47" alt="Confident AI Observability Traces dashboard showing gateway traces with latency and production environment" width="1917" height="982" data-path="images/ConfidentAITesting.png" />
    </Frame>
  </Step>
</Steps>

## Configuration reference

| Configuration       | Value                                                                                                       |
| ------------------- | ----------------------------------------------------------------------------------------------------------- |
| **Traces endpoint** | `https://otel.confident-ai.com/v1/traces` (US/default) or `https://eu.otel.confident-ai.com/v1/traces` (EU) |
| **Protocol**        | HTTP (OTLP)                                                                                                 |
| **Encoding**        | Json                                                                                                        |
| **Auth header**     | `x-confident-api-key: <Confident_AI_API_Key>`                                                               |
| **Content-Type**    | `application/json`                                                                                          |
