Frametail

OpenRouter tracing

Wrap the OpenRouter SDK with Frametail to capture spans around chat and video generation calls.

Why integrate

The @openrouter/sdk wrapper records latency, inputs, outputs, and errors for OpenRouter chat and videoGeneration calls, exporting spans to Frametail when tracing is enabled.

Basic setup

import { FrametailClient } from 'frametail'
import { OpenRouter } from '@openrouter/sdk'

const frametail = new FrametailClient({
  apiKey: process.env.FRAMETAIL_API_KEY!,
  projectKey: process.env.FRAMETAIL_PROJECT_KEY!,
  enableTracing: true,
})

const openrouter = frametail.wrapOpenRouterClient(new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY! }))

await openrouter.videoGeneration.generate({
  videoGenerationRequest: {
    model: 'your-video-model',
    prompt: 'A short product demo clip',
  },
})

What is traced

AreaOperations
Chatchat.send (streaming and non-streaming)
VideovideoGeneration.generate, getGeneration, getVideoContent, listVideosModels

Spans include model id, operation name, and sanitized payloads. See the marketing overview for eval workflows (datasets and benchmarks).

Configuration

Set enableTracing: false only when you intentionally disable export (for example, in local-only tests). You can also call wrapOpenRouterClient from the standalone export in frametail if you manage exporters yourself. See the SDK reference for defaults.