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

# Vercel AI SDK, AI Gateway and Agents Telemetry

> Send traces of AI model calls, tool calls and agent turns from Vercel to Bronto: OpenTelemetry from the Vercel AI SDK and eve, and the AI Gateway trace drain with tokens, cost and provider attempts.

AI features on Vercel produce telemetry in three places:

| Source | What it records | How it reaches Bronto |
| - | - | - |
| Your code (Vercel AI SDK, [eve](https://eve.dev) agents) | Agent turns, model calls, tool calls, tokens, with [GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) | [OpenTelemetry from code](/integrations/vercel-otel.md) |
| AI Gateway | One trace per model request: routing, each provider attempt, tokens, cache use, cost | AI Gateway trace drain |
| Vercel Agent Runs | eve sessions, turns, messages and tool calls, in Vercel's dashboard and CLI | Stays in Vercel (30-day retention in beta) |

## Recommended method

[**OpenTelemetry from code**](/integrations/vercel-otel.md). eve has OpenTelemetry built in; add Bronto as a destination in `agent/instrumentation/`. Spans carry attributes such as `gen_ai.provider.name`, `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.cache_read.input_tokens` and `gen_ai.tool.name`. Each agent turn is one trace; tool calls to other services can continue it (see [Tracing into other services](/integrations/vercel-tracing.md)). With Vercel AI SDK 7, add `@ai-sdk/otel` and call `registerTelemetry(new OpenTelemetry())` once in `instrumentation.ts`, next to `registerOTel`; every Vercel AI SDK call is then traced and exported through `@vercel/otel`. See [Vercel AI SDK](/integrations/vercel-ai-sdk.md) for the setup, the attributes and how to record AI Gateway cost.

## Alternatives

### AI Gateway trace drain

AI Gateway produces an OpenTelemetry trace for every request it handles (`service.name: ai-gateway`). A trace drain forwards those traces to Bronto:

1. In Vercel, open **Team Settings → Drains → Add Drain** and choose AI Gateway traces as the data.
2. Set the destination to `https://ingestion.eu.bronto.io/v1/traces` (or `.us.`), format **Protobuf**, with the header `x-bronto-api-key: <YOUR_API_KEY>`.
3. Choose the projects whose AI Gateway requests you want.

What you get, per request:

| Span | What it shows |
| - | - |
| `chat <model>` (root) | The whole request: model, tokens, cache use, cost (`vercel.ai_gateway.cost.total`), status |
| `vercel.ai_gateway.routing` | Model resolution and provider order |
| `vercel.ai_gateway.model_attempt <model>` | One per model attempt, when fallbacks run |
| `<model> (<provider>)` | One per upstream provider call, so failovers show every attempt |

Things to know:

* **It continues your trace.** When the request comes from instrumented code (for example an eve agent), the gateway's spans carry the caller's trace ID. The gateway's root span refers to a parent that isn't exported, so it shows as a second root within the same trace.
* **It's a separate drain type.** The dashboard creates it with the schema `ai_gateway` (version `otelv1`), which Vercel's REST API docs don't list. A regular `trace` drain doesn't deliver AI Gateway traces.
* **Traces arrive with a delay.** In testing, the first traces took several minutes; after that, volume matched the requests.
* **No prompts or completions.** The traces carry metadata only.
* **Cost:** $0.05 per 1,000 traces plus $0.50 per GB, with no Pro allowance.
* In testing, creating the drain in the dashboard also delivered one test trace (an `openai/gpt-4o` request with `vercel.project.id: test-project-id`). Filter it out if you count requests.

### Vercel Agent Runs

`vercel agent-runs list` and `vercel agent-runs trace <run-id>` show eve sessions without Observability Plus. Agent Runs is billed at always-on tracing rates and keeps 30 days of data during the beta. It shows the agent side only; calls to services outside Vercel appear as tool calls without their internals.

See [Ingesting Vercel Data into Bronto](/integrations/vercel.md) for the full mapping.

## References

* [AI Gateway trace drains](https://vercel.com/docs/ai-gateway/observability-and-spend/trace-drains)
* [eve OpenTelemetry](https://eve.dev/docs/observability/otel)
* [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/)


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