Tracks and analyzes LLM token usage and costs via Langfuse dashboards and metrics APIs.

Install

mkdir -p .claude/skills/langfuse-cost-tuning && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6585" && unzip -o skill.zip -d .claude/skills/langfuse-cost-tuning && rm skill.zip

Installs to .claude/skills/langfuse-cost-tuning

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Monitor and optimize LLM costs using Langfuse analytics and dashboards.
71 charsno explicit “when” trigger
Intermediate

Key capabilities

  • →Track LLM costs for supported models
  • →Analyze token usage patterns
  • →Implement budget-aware model routing
  • →Set up automated budget alerts
  • →Query costs programmatically via Metrics API
  • →Configure pricing for custom models

How it works

Langfuse automatically calculates costs for supported models when token usage is captured in generation and embedding observations. For custom models, pricing can be configured in the Langfuse UI.

Inputs & outputs

You give it
Langfuse generation or embedding observations with usage data
You get back
Calculated LLM costs and token usage metrics

When to use langfuse-cost-tuning

  • →Track total LLM API spending
  • →Identify high-cost prompts or models
  • →Set up automated budget alerts
  • →Analyze token usage patterns

About langfuse-cost-tuning

Provides mechanisms to audit LLM spending by capturing token usage metrics. It enables programmatic analysis through the Metrics API and helps implement budget-aware model routing and automated alerts.

Monitor and optimize LLM costs using Langfuse analytics and dashboards. Use when tracking LLM spending, identifying cost anomalies, or implementing cost controls for AI applications. Trigger with phrases like "langfuse costs", "LLM spending", "track AI costs", "langfuse token usage", "optimize LLM budget".

When not to use it

  • →When token usage is not captured in Langfuse tracing
  • →When LLM pricing models are not understood

Prerequisites

Langfuse tracing with token usage captured@langfuse/client installed for Metrics APIUnderstanding of LLM pricing models

Limitations

  • →Cost calculation requires token usage to be captured
  • →Model ID must be exact for correct cost calculation
  • →Custom models require pricing configuration in Langfuse UI

How it compares

This skill provides programmatic access and automated controls for LLM cost management, unlike manual cost tracking.

Compared to similar skills

langfuse-cost-tuning side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
langfuse-cost-tuning (this skill)14moNo flagsIntermediate
databuddy16moCautionIntermediate
analytics-pipeline19moNo flagsIntermediate
logging-best-practices09moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore →

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

You might also like

databuddy

databuddy-analytics

Integrate Databuddy analytics into applications using the SDK or REST API. Use when implementing analytics tracking, feature flags, custom events, Web Vitals, error tracking, LLM observability, or querying analytics data programmatically.

110

analytics-pipeline

dadbodgeoff

Real-time analytics with Redis counters, periodic PostgreSQL flush, and time-series aggregation. High-performance event tracking without database bottlenecks.

15

logging-best-practices

neondatabase

Logging best practices focused on wide events (canonical log lines) for powerful debugging and analytics

01

firecrawl-cost-tuning

jeremylongshore

Optimize FireCrawl costs through tier selection, sampling, and usage monitoring. Use when analyzing FireCrawl billing, reducing API costs, or implementing usage monitoring and budget alerts. Trigger with phrases like "firecrawl cost", "firecrawl billing", "reduce firecrawl costs", "firecrawl pricing", "firecrawl expensive", "firecrawl budget".

11

segment-cdp

davila7

Expert patterns for Segment Customer Data Platform including Analytics.js, server-side tracking, tracking plans with Protocols, identity resolution, destinations configuration, and data governance best practices. Use when: segment, analytics.js, customer data platform, cdp, tracking plan.

212

groq-cost-tuning

jeremylongshore

Optimize Groq costs through tier selection, sampling, and usage monitoring. Use when analyzing Groq billing, reducing API costs, or implementing usage monitoring and budget alerts. Trigger with phrases like "groq cost", "groq billing", "reduce groq costs", "groq pricing", "groq expensive", "groq budget".

12

Search skills

Search the agent skills registry