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

# Envoy AI Gateway

> Send Envoy AI Gateway's OpenTelemetry traces to Zespan, no Zespan SDK required.

> [!NOTE]
>
> Available via: **Envoy AI Gateway's OpenTelemetry tracing**. This is not a Zespan SDK wrapper, see [Send traces from any OTel-instrumented app](https://docs.zespan.com/sdk/otel-integration.md#send-traces-from-any-otel-instrumented-app-no-zespan-sdk) for how the endpoint works.

[Envoy AI Gateway](https://aigateway.envoyproxy.io) exports traces with OpenInference attribute names by default, configured with OpenTelemetry's standard environment variables. The vendor documents `AI_GATEWAY_TRACING_SEMCONV=gen_ai` to switch to the GenAI names instead; Zespan reads both.

## Setup

**1. Set the exporter destination**

Set `OTEL_EXPORTER_OTLP_ENDPOINT` for the gateway to `https://api.zespan.com` and add the header `x-api-key: zsp_...` (OpenTelemetry's `OTEL_EXPORTER_OTLP_HEADERS`). Confirm for your version that these standard variables apply, and which protocol it sends (JSON and protobuf are both accepted).

**2. Tell Zespan the source**

Set the resource attribute `zespan.gateway` to `envoy`, for example `OTEL_RESOURCE_ATTRIBUTES=zespan.gateway=envoy`. Without it the data is stored as plain OpenTelemetry: still readable, but its non-model spans are not marked as gateway spans.

**3. Verify**

Send one request, then open **Settings → Instrumentation → Gateway and OTLP data** and press **Refresh**. See [Instrumentation](https://docs.zespan.com/dashboard/instrumentation.md#gateway-and-otlp-data).

## What gets captured

| Field | Read from | Notes |
| - | - | - |
| Model | `llm.model_name` | OpenInference name, mapped by the compatibility mapping (on by default) |
| Token counts | `llm.token_count.*` | |
| Prompt and answer text | `llm.input_messages.*` and the output equivalent | Envoy exports the full request and response by default; the vendor documents `OPENINFERENCE_HIDE_INPUTS` and `OPENINFERENCE_HIDE_OUTPUTS` to turn this off. Whether Zespan stores any follows your project's capture setting |
| Session | `session.id`, which the vendor maps from the `agent-session-id` request header by default | |
| Cost | Zespan's own price table | |

> [!NOTE]
>
> Attribute names come from Envoy AI Gateway's published documentation and can change between versions. Use the **Gateway and OTLP data** card to see what actually arrives.

> [!NOTE]
>
> Gateway identity metadata is not stored. See [AI gateways](https://docs.zespan.com/sdk/otel-integration.md#ai-gateways) and [Security](https://docs.zespan.com/platform/security.md).

## Using the SDK too

Envoy AI Gateway does not document whether it continues an inbound `traceparent` or exports the provider's response id, so a call reported by both the SDK and this gateway may be counted twice. Use one of them for a given call. See [Using the SDK too](https://docs.zespan.com/sdk/otel-integration.md#using-the-sdk-too).

## Next steps

* [OTel integration](https://docs.zespan.com/sdk/otel-integration.md), the endpoint, limits and attributes Zespan reads
* [Instrumentation](https://docs.zespan.com/dashboard/instrumentation.md#gateway-and-otlp-data), check what arrived
* [Kong AI Gateway](https://docs.zespan.com/sdk/integrations/kong-ai-gateway.md), [Bifrost](https://docs.zespan.com/sdk/integrations/bifrost.md), other gateways


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