Overview
Laminar automatically calculates costs for LLM calls when the correct provider and model names are set. This page lists the supported providers and their corresponding model names that Laminar recognizes for cost calculation.Supported Providers
Laminar uses provider names consistent with OpenLLMetry standards. When manually instrumenting LLM calls, set thegen_ai.system
attribute to one of these values:
Provider | Provider Name | Example Model | Documentation |
---|---|---|---|
OpenAI | openai | gpt-4o , gpt-4o-2024-11-20 | platform.openai.com |
Anthropic | anthropic | claude-3-5-sonnet , claude-3-5-sonnet-20241022 | docs.anthropic.com |
Google Gemini | gemini , google-genai | models/gemini-1.5-pro | ai.google.dev |
Azure OpenAI | azure-openai | gpt-4o-mini , gpt-4o-mini-2024-07-18 | learn.microsoft.com |
AWS Bedrock | bedrock-anthropic | claude-3-5-sonnet-20241022-v2:0 | docs.aws.amazon.com |
Mistral AI | mistral | mistral-large-2407 | docs.mistral.ai |
Groq | groq | llama-3.1-70b-versatile | console.groq.com |
Missing a provider or can’t see cost information? Create an issue and we’ll add it.
Setting Provider Information
When manually instrumenting LLM calls, ensure you set the correct provider and model attributes:Model Name Formats
Different providers use different model name formats. Use the exact names as returned by the provider’s API:OpenAI
Anthropic
Google Gemini
Azure OpenAI
Custom Providers
For providers not listed above, you can still track usage by setting custom attributes:Cost Calculation
Laminar automatically calculates costs using:- Token counts (
gen_ai.usage.input_tokens
,gen_ai.usage.output_tokens
) - Model name (
gen_ai.response.model
) - Provider name (
gen_ai.system
)
Laminar also takes into account cached tokens to calculate cost for providers that support it, like OpenAI, Anthropic, and so on.
Viewing Costs
Costs appear in the Laminar UI on:- Trace details - Sum of all LLM calls within the trace
- LLM spans - Individual LLM call costs
- Analytics dashboard - Aggregated cost metrics by models