Show HN: AI Flight Recorder – record, replay, and track AI session costs AI Flight Recorder, an open-source developer tool for recording, replaying, and inspecting AI application sessions, has been released on GitHub. The tool captures prompts, streamed tokens, tool calls, latency, and cost, and provides a DevTools-style timeline with features such as streaming replay at speeds from 0.25× to 8×, cost analysis, and OpenTelemetry export. It includes one-line SDK wrappers for OpenAI, Anthropic, and Google Gemini, and supports Node.js 18+ with pnpm 10+. DevTools for AI Applications AI Flight Recorder is an open-source developer tool for recording, replaying, and inspecting every interaction in an AI application — prompts, streamed tokens, tool calls, latency, and cost — all in one place. Instead of piecing together console logs after the fact, you drop in a one-line SDK wrapper and get a full DevTools-style timeline you can pause, rewind, and hand off to a teammate as a .flight file. Session recording: capture every prompt, token, tool call, and completion as a structured event stream Streaming replay: watch a session play back in real time with speed controls 0.25×–8× Timeline & Waterfall: visualize the full request lifecycle including parallel tool calls and streaming latency Cost Analysis: break down token usage and estimated spend per session Search & Filter: filter events by type or keyword across the full timeline Provider Adapters: one-line wrappers for OpenAI, Anthropic, and Google Gemini streaming and non-streaming share a session as a portable file another developer can replay locally .flight Export/Import: Plugin System: hook into the recorder lifecycle with custom observers Transport System: plug in any storage backend in-memory, filesystem, your own API OpenTelemetry Export: convert any session to an OTLP trace payload for ingestion into Jaeger, Grafana Tempo, Honeycomb, or any OTel-compatible backend toOtlp from @ai-flight-recorder/sdk ai-flight-recorder/ ├── apps/ │ ├── devtools/ Next.js DevTools application │ ├── docs/ Starlight documentation site │ └── vscode/ VS Code extension — custom editor for .flight files ├── packages/ │ ├── core/ Domain model — events, session, recorder, replay engine │ ├── sdk/ Developer-facing API — FlightRecorder, adapters, plugins, transports │ ├── ui/ Shared React components future │ └── types/ Shared TypeScript types future ├── scripts/ │ └── smoke.ts SDK integration smoke test └── examples/ ├── nextjs-chat/ Full-stack chat app — OpenAI streaming + .flight export ├── node-anthropic/ Node.js example — Anthropic + FileTransport └── node-gemini/ Node.js example — Google Gemini + FileTransport - Node.js 18+ - pnpm 10+ pnpm install pnpm dev Open http://localhost:3000 http://localhost:3000 . The app loads with two demo sessions so you can explore the UI immediately — no API keys required. pnpm smoke Exercises recording, plugins, transport, serialization, and replay end-to-end. All 40 assertions should pass. js import { FlightRecorder } from "@ai-flight-recorder/sdk"; const fr = new FlightRecorder ; const session = fr.startSession { label: "my-chat" } ; fr.record { type: "prompt", model: "gpt-4o", prompt: "What is the capital of France?", } ; fr.record { type: "completion", response: "Paris.", finishReason: "stop", totalTokens: 18, } ; const ended = fr.endSession ; Drop-in wrappers that intercept the provider client and record every call automatically. OpenAI python import OpenAI from "openai"; import { FlightRecorder, wrapOpenAI } from "@ai-flight-recorder/sdk"; const fr = new FlightRecorder ; const openai = wrapOpenAI new OpenAI , fr.recorder ; fr.startSession { label: "chat" } ; const response = await openai.chat.completions.create { model: "gpt-4o", messages: { role: "user", content: "Hello" } , } ; fr.endSession ; Anthropic python import Anthropic from "@anthropic-ai/sdk"; import { FlightRecorder, wrapAnthropic } from "@ai-flight-recorder/sdk"; const fr = new FlightRecorder ; const client = wrapAnthropic new Anthropic , fr.recorder ; fr.startSession { label: "claude-chat" } ; const message = await client.messages.create { model: "claude-sonnet-4-5", max tokens: 1024, messages: { role: "user", content: "Hello" } , } ; fr.endSession ; Google Gemini js import { GoogleGenerativeAI } from "@google/generative-ai"; import { FlightRecorder, wrapGeminiModel } from "@ai-flight-recorder/sdk"; const fr = new FlightRecorder ; const genAI = new GoogleGenerativeAI process.env.GOOGLE API KEY ; const model = wrapGeminiModel genAI.getGenerativeModel { model: "gemini-1.5-pro" } , fr.recorder, ; fr.startSession { label: "gemini-chat" } ; const result = await model.generateContent "Hello" ; fr.endSession ; All three adapters support streaming. Wrap your existing client and all calls are recorded automatically. js import { FlightRecorder, ConsoleLogPlugin } from "@ai-flight-recorder/sdk"; const fr = new FlightRecorder { plugins: new ConsoleLogPlugin { logEvents: true, logSummary: true } , // Inline plugin { name: "my-plugin", onSessionStart: session = console.log "Started:", session.id , onEvent: event = myMetrics.record event , onSessionEnd: session = alerting.flush session , }, , } ; use is chainable and checks for duplicate names at registration time: fr.use pluginA .use pluginB ; js import { FlightRecorder, InMemoryTransport } from "@ai-flight-recorder/sdk"; const transport = new InMemoryTransport ; const fr = new FlightRecorder { transport } ; fr.startSession ; // ... record events ... fr.endSession ; // automatically saves to transport const sessions = transport.getAll ; Node.js filesystem transport: js import { FlightRecorder } from "@ai-flight-recorder/sdk"; import { FileTransport } from "@ai-flight-recorder/sdk/node"; const transport = new FileTransport "./recordings" ; const fr = new FlightRecorder { transport } ; fr.startSession { label: "my-session" } ; // ... record events ... fr.endSession ; // saves to ./recordings/