Skip to main content
Vercel AI Gateway gives you one endpoint for models from many providers, with provider failover, BYOK, and spend tracking. You can send its traces to HoneyHive in two ways: The SDK route traces the apps you instrument, with full content. The drain covers every gateway request on your Vercel team without code changes. You can run both. Vercel’s gateway traces do not include prompt or completion content, so drain events in HoneyHive have empty inputs and outputs.

Quick Start

Point your OpenAI client at the gateway, then instrument as usual. OpenAIInstrumentor patches the SDK, so chat completions, tools, and token usage are traced regardless of the base_url.
AI Gateway exposes an OpenAI-compatible API at https://ai-gateway.vercel.sh/v1. HoneyHive traces the OpenAI SDK, not the gateway, so the OpenAI integration works unchanged. Model IDs use provider/model.
To see where to initialize the tracer for your environment, including AWS Lambda and long-running servers, see Tracer Initialization.
Last tested with honeyhive 1.6.0, openai 3.20.0, and openinference-instrumentation-openai 0.1.61 (September 2026).
Create an API key in the AI Gateway dashboard. On Vercel deployments, you can use the Vercel OIDC token instead. See Vercel’s authentication docs. The instrumentor captures:
  • Chat completions - Inputs, outputs, and token usage
  • Tool / function calls - Arguments and results for each tool invocation
  • Streaming responses - Streamed completions with aggregated tokens
  • Gateway response fields - The gateway returns generationId and usage.cost in each response, and they arrive in the event’s config
The same pattern works with any provider SDK that AI Gateway supports and HoneyHive instruments, such as the OpenAI and Anthropic SDKs. Point the SDK at the gateway (https://ai-gateway.vercel.sh/v1 for OpenAI, https://ai-gateway.vercel.sh for Anthropic) and call that SDK’s instrumentor. Raw fetch / curl calls are not autotraced. The AI Gateway drain captures those requests.

AI Gateway drain (no code)

The drain forwards a trace of every gateway request your Vercel team makes, from any app, with no code changes. It needs a Vercel team on the Pro or Enterprise plan. Vercel bills each delivered trace plus trace egress. See Vercel’s trace drain pricing.

Configure the drain

1

Create a HoneyHive ingestion key

Create an ingestion API key in Settings → Project → API Keys, on the Ingestion tab. The key sets which HoneyHive project receives the traces.
2

Add an AI Gateway drain

In the Vercel dashboard, go to Team Settings → Drains and click Add Drain. Select AI Gateway as the data type. A Traces drain sends your deployments’ request spans, not AI Gateway requests.
3

Point the custom endpoint at HoneyHive

Select Custom Endpoint and set:For US production, the endpoint is https://api.dp1.us.prod.honeyhive.ai/opentelemetry/v1/traces. Use the host shown in your HoneyHive dashboard.
4

Create the drain and send a request

Click Create Drain, then send any request through AI Gateway, for example with the Quick Start code.

What HoneyHive records

Each gateway request is one OpenTelemetry trace with service.name: ai-gateway. HoneyHive maps its spans to events: Gateway-specific attributes arrive in metadata with their original names. Useful ones:
  • vercel.ai_gateway.cost.total and vercel.ai_gateway.cost.currency - Request cost, as Vercel billed it. Vercel sends the cost as a decimal string, so it arrives in metadata as a string
  • vercel.ai_gateway.user.id and vercel.ai_gateway.tags - The user ID and tags you attached to the request
  • vercel.ai_gateway.generation.id - The generation ID in the AI Gateway dashboard
  • vercel.ai_gateway.credential.type - byok or system
  • vercel.ai_gateway.api_format - The API the client called: openai-compat for Chat Completions, openresponses-compat for the Responses API
  • vercel.ai_gateway.api_key.name and vercel.ai_gateway.environment - The AI Gateway key that made the request, and the Vercel environment
  • gen_ai.response.time_to_first_chunk - Time to first token, in seconds
  • vercel.ai_gateway.provider - The exact gateway provider slug (for example vertexAnthropic). config.provider holds the OTel provider name instead (for example aws.bedrock)
The drain sends no session attribute, so these events appear in the Events view, not the Sessions view. To find them, filter by service.name = ai-gateway. To see one gateway request, filter by the trace_id metadata field.

Troubleshooting

SDK traces not appearing

  1. Check the instrumentor - Call the instrumentor for your SDK with tracer_provider=tracer.provider before creating the client or making requests
  2. Confirm you use an instrumented SDK - Raw fetch / curl to the gateway is not autotraced. Check the base URL: https://ai-gateway.vercel.sh/v1 for OpenAI, https://ai-gateway.vercel.sh for Anthropic
  3. Check HH_INGESTION_API_KEY - Set it to an ingestion API key

Drain traces not appearing

  1. Data type - The drain must use the AI Gateway data type. A Traces drain forwards only vercel.serverless-runtime and vercel.edge-network spans
  2. Endpoint and header - The URL must end with /opentelemetry/v1/traces, and the header must be exactly Authorization: Bearer <HH_INGESTION_API_KEY>. A wrong key returns 401
  3. Project - The key sets the project. Check the project where you created the key

Resources