Pricing Tables
NeuraMeter includes built-in pricing data for popular LLM models. Prices are used to calculate costMicrodollars automatically.
How It Works
import { getModelPricing, calculateCostMicrodollars } from '@neurameter/core';
const pricing = getModelPricing('openai', 'gpt-4o');
// { inputPricePerMToken: 2_500_000, outputPricePerMToken: 10_000_000, ... }
const cost = calculateCostMicrodollars(
{ inputTokens: 1000, outputTokens: 500 },
pricing
);
// 7500 microdollars = $0.0075Microdollar Arithmetic
All costs are stored as microdollars (integer arithmetic):
$1.00 = 1,000,000 microdollars
$0.01 = 10,000 microdollarsThis avoids floating-point rounding errors common with dollar amounts.
Model Matching
getModelPricing(provider, model) supports:
- Exact match —
'gpt-4o'matches'gpt-4o' - Prefix match —
'gpt-4o-mini-2024-07-18'matches'gpt-4o-mini'
OpenAI
| Model | Input ($/1M) | Output ($/1M) | Cached Input ($/1M) | Reasoning ($/1M) |
|---|---|---|---|---|
gpt-4o | $2.50 | $10.00 | $1.25 | — |
gpt-4o-mini | $0.15 | $0.60 | $0.075 | — |
gpt-4.1 | $2.00 | $8.00 | $0.50 | — |
gpt-4.1-mini | $0.40 | $1.60 | $0.10 | — |
o1 | $15.00 | $60.00 | $7.50 | $60.00 |
o3-mini | $1.10 | $4.40 | $0.55 | $4.40 |
Anthropic
| Model | Input ($/1M) | Output ($/1M) | Cached Input ($/1M) |
|---|---|---|---|
claude-sonnet-4 | $3.00 | $15.00 | $0.30 |
claude-haiku-4.5 | $0.80 | $4.00 | $0.08 |
claude-opus-4 | $15.00 | $75.00 | $1.50 |
| Model | Input ($/1M) | Output ($/1M) | Cached Input ($/1M) |
|---|---|---|---|
gemini-2.5-pro | $1.25 | $10.00 | $0.315 |
gemini-2.5-flash | $0.15 | $0.60 | $0.0375 |
gemini-2.0-flash | $0.10 | $0.40 | $0.025 |
gemini-1.5-pro | $1.25 | $5.00 | $0.315 |
gemini-1.5-flash | $0.075 | $0.30 | $0.01875 |
Groq
| Model | Input ($/1M) | Output ($/1M) |
|---|---|---|
llama-3.3-70b-versatile | $0.59 | $0.79 |
llama-3.1-8b-instant | $0.05 | $0.08 |
llama-3-70b | $0.59 | $0.79 |
mixtral-8x7b | $0.24 | $0.24 |
gemma2-9b-it | $0.20 | $0.20 |
Mistral
| Model | Input ($/1M) | Output ($/1M) |
|---|---|---|
mistral-large | $2.00 | $6.00 |
mistral-small | $0.20 | $0.60 |
codestral | $0.30 | $0.90 |
mistral-embed | $0.10 | — |
open-mistral-nemo | $0.15 | $0.15 |
Custom Pricing
If a model is not in the built-in tables, getModelPricing() returns undefined and costMicrodollars defaults to 0. You can calculate cost manually:
const pricing = getModelPricing('openai', 'my-custom-model');
if (!pricing) {
// Calculate manually
const customPricing = {
inputPricePerMToken: 1_000_000, // $1.00 per 1M tokens
outputPricePerMToken: 3_000_000, // $3.00 per 1M tokens
};
const cost = calculateCostMicrodollars(usage, customPricing);
}Updating Prices
Pricing data is bundled in the @neurameter/core package. To get updated prices, update the package:
npm update @neurameter/core