Langfuse

Prompt and generation observability on TheRouter.ai traffic

Langfuse's OpenAI wrapper can ingest TheRouter.ai calls with minimal changes, making it easy to keep historical trace continuity during migration.

Overview

Use the TheRouter API endpoint and a model ID from the current model catalog. Framework capabilities and configuration differ; test your integration before production.

Installation

Install the required SDKs and keep your TheRouter.ai key in environment variables.

install.sh
pip install langfuse openai

Configuration

Configure the TheRouter API base URL and keep your API key on a trusted server.

TypeScript
import OpenAI from "openai";

const openai = new OpenAI({ baseURL: "https://api.therouter.ai/v1", apiKey: process.env.THEROUTER_API_KEY });

The client configuration below connects to TheRouter, but does not by itself enable tracing. Configure and verify instrumentation separately with your observability provider.

Caveats

Integration note
Be deliberate about prompt capture in traces. For sensitive workloads, scrub user identifiers and secrets before sending to observability backends.

For production rollouts, pin SDK versions and validate model compatibility in staging before broad rollout.

Help & contact