Answers you can trust, from Codeables

Every page on Codeables is structured and verified — built so people and the AI agents they rely on can trust it. Explore more from the source behind this answer.

Explore Codeables
Verified Source
LLM Observability & Evaluation

LangChain LangSmith vs Helicone for cost control: per-step cost attribution, alerts, and tying spend to specific tools/flows

LangChain11 min read

Most teams don’t realize they have a cost problem until after the cloud bill hits. With agents and long-running LLM workflows, that bill is usually opaque: you know the total, but not which tools, prompts, or flows actually drove spend. LangSmith and Helicone both help you get visibility into LLM usage, but they take very different approaches once you care about per-step cost attribution, alerts, and tying spend back to specific tools and flows.

Quick Answer: Use Helicone if you mainly want a lightweight proxy to track and cap raw LLM API spend. Use LangSmith if you need cost at the same granularity as your agent traces—per step, per tool, per flow—plus alerts, cost-aware evals, and the ability to turn expensive production runs into datasets you can fix.

The Quick Overview

  • What It Is:

    • LangSmith is a trace-first agent engineering platform for debugging, evaluating, and deploying agents—including step-level cost and latency analytics across tools and flows.
    • Helicone is a hosted gateway/proxy for LLM APIs that adds logging, simple analytics, caching, and basic cost visibility at the request level.
  • Who It Is For:

    • LangSmith: Teams serious about agents—multi-step, tool-using, long-context systems—who need to understand cost, quality, and behavior together at the trace level.
    • Helicone: Teams who want minimal setup to track and control LLM API usage and cost from a gateway without touching their app logic.
  • Core Problem Solved:

    • LangSmith: “Where exactly in this workflow is cost spiking, and how do we trade cost vs. quality without breaking production?”
    • Helicone: “What are we spending per model/key, and how do we put a simple limit or cache in front of our LLM calls?”

How It Works

LangSmith: trace-first cost analytics

LangSmith instruments your agent stack (via SDKs or OpenTelemetry) and captures every run as a structured trace: parent agent → child tools → model calls → intermediate steps. Each step includes inputs, outputs, tokens, latency, and cost. Because cost is attached to the same trace object you use for debugging and evaluation, you can slice spend by:

  • Agent, chain, or flow
  • Tool or model
  • Dataset, experiment, or deployment
  • Customer, tenant, or use case (via your own metadata)

You can then run evals, compare versions, and monitor production with cost and quality metrics side by side.

  1. Instrumentation & Tracing:
    Use LangSmith’s SDKs (Python, TypeScript, Go, Java) or OpenTelemetry integration to send every agent run into LangSmith. Each tool call, model call, and intermediate step shows up as a node in the trace with token counts and latency.

  2. Cost Attribution & Analytics:
    LangSmith maps token counts, models, and providers to cost. You get dashboards and filters to see cost per step, per tool, per project, and per deployment—plus exact timelines to see which step exploded context length.

  3. Monitoring, Evals & Iteration:
    LangSmith lets you set alerts, run offline/online evals (including LLM-as-judge calibrated with human feedback), and compare model/agent versions. You can watch how cost changes vs. quality metrics and roll back if a “cheaper” config silently degrades outcomes.

Helicone: gateway-level cost visibility

Helicone sits in front of your LLM provider as a proxy. You swap your OpenAI (or other provider) base URL for Helicone’s, and it logs each request/response. It aggregates tokens and cost at the request level; for LangChain, you can route calls through Helicone’s provider to get basic observability without changing your core code structure.

  1. Proxy Setup:
    Point your LLM traffic at Helicone’s gateway. It forwards calls to the underlying provider and logs metadata, tokens, and latency.

  2. Usage & Cost Metrics:
    Helicone aggregates metrics like tokens per API key, per user, or per model. You get charts and simple breakdowns of where spend is going at the request/key level.

  3. Controls & Optimizations:
    You can add caching and some rate or quota controls. The focus is on “don’t overspend on raw API calls,” not on understanding tool-level or step-level agent behavior.

Features & Benefits Breakdown

Core comparison: per-step cost attribution, alerts, and tying spend to tools/flows

Core FeatureWhat It DoesLangSmith Primary BenefitHelicone Primary Benefit
Per-step cost attributionAttach cost to specific operationsCost is attached to each trace node (model call, tool call, chain step). You can see exactly which step in a flow drove cost and why (long context, retries, loops).Cost is visible per raw API request. You can group by key/user/model, but not by internal tool or agent step unless your app encodes that into request metadata.
Tool- and flow-level cost viewsAttribute spend to internal componentsSlice cost by tool name, agent, chain, dataset, deployment, or project—all native concepts in LangSmith.View cost by provider/model/API key; mapping to tools/flows requires your own naming and conventions.
Alerts on cost patternsNotify when usage or cost crosses thresholdsAlerts can be built around traces and metrics (latency, tokens, failures). Combined with evals, you can catch quality regressions that also affect cost (e.g., runaway loops).Alerts tend to focus on aggregate request volume or cost per key; good for “stop runaway usage,” less targeted for specific flows.
Tie cost to quality & regressionsRelate spend to performanceRun evals that output scores and attach both cost and quality metrics to the same runs. You can compare experiments to see “cheaper but worse” vs. “slightly more expensive but much better.”Quality is external—Helicone does not provide first-class evals. You must correlate cost with quality in your own system.
Debugging cost anomaliesDiagnose why cost spikedUse trace timelines to see long prompts, unnecessary tools, repeated calls, or branching errors. Turn problematic runs into datasets to fix systematically.Identify which API key or model is spending more, but not which internal step in a multi-tool agent is responsible.
LangChain / agent-native workflowFit into an agent engineering lifecycleNative to LangChain, LangGraph, and any agent stack that can emit traces. Built for long-running, multi-agent, multi-tool workflows.Works with LangChain via a provider that routes calls through the gateway, but remains an LLM API layer rather than an agent-debugging tool.

Ideal Use Cases

  • Best for teams optimizing complex agents:
    Choose LangSmith when you have multi-step workflows with tools, memory, and branching logic, and you need to know which exact steps or flows are expensive. This is critical when:

    • A small set of pathological traces drive most of your spend.
    • You’re A/B testing prompts, models, or agent strategies and need cost vs. quality tradeoffs at the workflow level.
    • You want to turn expensive production runs into datasets, tune prompts/policies, and re-evaluate before rolling changes out.
  • Best for teams wanting quick LLM cost visibility:
    Choose Helicone when your architecture is mostly “app → LLM API” without complex internal tools, and you want:

    • Fast, low-friction setup via a gateway.
    • Basic dashboards of tokens and cost per API key/user/provider.
    • Simple caps and caching to keep LLM API costs in check without deep agent introspection.

Limitations & Considerations

  • LangSmith: requires instrumentation, but gives full context

    • You do need to instrument your agents (SDKs or OpenTelemetry). That’s extra work compared to dropping in a proxy.
    • The tradeoff is visibility: you get structured traces, threads, and datasets that explain cost, quality, and behavior together.
    • LangSmith is not a generic network gateway; it’s an agent engineering platform. If you just want a quick proxy for a single LLM, it’s more than you need.
  • Helicone: fast setup, but limited agent-level insight

    • Because Helicone sees only the requests leaving your app, it doesn’t know your internal tools, loops, or chains unless you annotate requests heavily.
    • Per-step cost attribution in a complex agent is effectively “do it yourself”—you have to push enough context through headers/metadata and still won’t get full trace timelines.
    • It doesn’t close the loop with evals, annotation queues, or agent-specific debugging workflows; you’ll need other tools for that.

Pricing & Plans

LangSmith and Helicone both have low-friction entry points, but pricing models reflect their roles.

LangSmith

LangSmith uses a freemium, usage-based model designed for teams of any size:

  • Free tier from $0/seat/month, with usage limits on traces/runs and base retention.
  • Paid tiers with:
    • Additional seats and higher trace/event quotas.
    • Longer retention (e.g., extended to 400 days for enterprises).
    • Enterprise deployment options with US/EU data residency, hybrid and self-hosted, SSO/SAML, SCIM, RBAC/ABAC, audit logs, and encryption.
  • Pay-as-you-go style: you pay primarily based on runs/events, not on the value of the models themselves. LangSmith does not train models on your data.

This is structured for organizations that want to observe, evaluate, and deploy agents in production at scale—LangSmith ingests over 1B events/day and is used by 35% of the Fortune 500.

Helicone

Helicone offers:

  • A free or low-cost tier with limited requests per month and basic logging.
  • Paid plans that scale with request volume and feature set (e.g., more requests, advanced analytics, better SLAs).
  • It’s not designed as a full agent engineering stack; it’s primarily about LLM gateway functionality, usage tracking, and cost control.

Because Helicone sits on the critical path between your app and model, you should line up its pricing with your projected total API request volume.

Which plan for which team?

  • LangSmith Team/Business: Best for product/ML/infra teams building agents that must be debugged, evaluated, and governed in production, with detailed cost accountability across tools and flows.
  • Helicone Pro/Business: Best for engineering teams that primarily care about centralizing LLM API traffic, enforcing quotas, and getting quick aggregate cost visibility, without reworking their architecture.

Frequently Asked Questions

Can I use LangSmith and Helicone together?

Short Answer: Yes. You can route LLM calls through Helicone and still instrument your agent with LangSmith.

Details:
Helicone works at the HTTP gateway layer; LangSmith works at the trace/agent layer. It’s common to:

  • Use Helicone as the LLM proxy to get central usage controls and potentially caching.
  • Use LangSmith to instrument your internal agent logic—tools, graph nodes, loops, retries, and memory.

In this setup:

  • LangSmith traces still capture step-level tokens and cost (based on model and token counts).
  • Helicone captures request-level usage and cost.

You get per-step cost attribution and quality analysis in LangSmith, plus centralized gateway controls in Helicone. Just ensure you annotate requests consistently (e.g., project/user IDs) so you can correlate across systems if needed.

How does LangSmith actually calculate per-step cost?

Short Answer: LangSmith attaches token counts, model info, and provider pricing to each run step, then aggregates.

Details:
Every model/tool call inside a LangSmith trace includes:

  • Input and output tokens
  • Model name and provider
  • Latency and metadata

LangSmith can then:

  • Compute cost per step (e.g., “tool_call → gpt-4.1” with 3,200 input tokens and 600 output tokens).
  • Aggregate costs up to the parent run (full agent trace), project, deployment, or dataset.
  • Show you which steps are responsible for cost spikes (e.g., a retrieval step that pulls too many documents into context or a summarization loop that runs too many iterations).

Because this is integrated with evals and experiment runs, you can quantify tradeoffs like:

  • “New summarization prompt reduces cost per run by 35% with no quality regression.”
  • “Switching from Model A to Model B cuts cost in half but fails policy evals 8% more often.”

Summary

Helicone is a good fit if your main question is: “How much are we spending on LLM APIs, and can we put a simple gate in front of that?” It works well as a gateway, especially for simpler applications.

LangSmith steps in when your question becomes: “Why did this specific agent flow get expensive, what did it actually do, and how do we change behavior without breaking production?” For that, you need traces—not just API logs. LangSmith gives you per-step cost attribution tied to tools and flows, evals to measure quality vs. cost, and a deployment runtime built for long-running, stateful, multi-agent workloads.

If you’re serious about agents—debugging them, evaluating them, and keeping their cost under control over time—LangSmith is the more complete solution. Helicone can complement it as a gateway, but it doesn’t replace trace-first observability.

Next Step

Get Started

LangChain LangSmith vs Helicone for cost control: per-step cost attribution, alerts, and tying spend to specific tools/flows | LLM Observability & Evaluation | Codeables | Codeables