Documentation

Quick Start

  1. Create an account at tokenmeter.sh/login
  2. Copy your API key from Settings
  3. Add to your MCP client:
    {
      "mcpServers": {
        "tokenmeter": {
          "url": "https://mcp.tokenmeter.sh",
          "headers": {
            "Authorization": "Bearer tm_your_api_key"
          }
        }
      }
    }
  4. Start using AI. Token Meter tracks your spend automatically.

Alternative: Local Client

If your MCP client doesn't support remote URLs, use the local client:

TOKENMETER_API_KEY=tm_your_key npx @yawlabs/tokenmeter-mcp

Or add to Claude Code:

claude mcp add tokenmeter -e TOKENMETER_API_KEY=tm_your_key -- npx @yawlabs/tokenmeter-mcp

Gateway Setup (Pro+)

Route your LLM requests through Token Meter for smart routing and failover. Swap your provider base URL:

# Instead of:
OPENAI_BASE_URL=https://api.openai.com/v1

# Use:
OPENAI_BASE_URL=https://gateway.tokenmeter.sh/v1
OPENAI_API_KEY=tm_your_api_key

Token Meter translates requests to the correct provider format and handles routing, failover, and retries.

MCP Tools Reference

Free Tier

get_spend_summary

Total spend for today, this week, and this month by provider.

get_session_cost

Cost of the current conversation/session.

get_model_pricing

Per-token pricing for any model.

model: optional — model ID
provider: optional — provider name
get_budget_status

Current spend against configured budgets.

get_providers

List connected providers and their status.

Pro Tier ($19/mo)

get_spend_breakdown

Detailed spend filtered by provider, model, date range.

provider: optional
days: default: 7
get_cost_trend

Daily spend over time.

days: default: 14
get_top_models

Models ranked by spend or token volume.

sortBy: 'cost' or 'tokens'
days: default: 30
get_cost_estimate

Estimate cost for X tokens on given models.

models: array of model IDs
inputTokens: number
outputTokens: default: 500
compare_models

Side-by-side cost comparison.

inputTokens: number
outputTokens: number
callsPerDay: default: 100
set_budget_alert

Create spend threshold notification.

name: string
limit: dollars
period: 'daily'|'weekly'|'monthly'

Gateway Tier ($49/mo)

get_rate_limits

Rate limit status per provider and model.

get_routing_status

Provider health: healthy, degraded, or rate-limited.

set_fallback_chain

Define provider failover order.

chain: array of {provider, model}
set_model_alias

Map friendly name to provider/model.

alias: string
provider: string
model: string

Supported Providers

Anthropic
OpenAI
Google Gemini
Groq
DeepSeek
Mistral
Cohere
Ollama
Azure OpenAI
AWS Bedrock

Model Pricing

40+ models with per-token pricing (per 1M tokens). Updated within 24 hours of provider announcements.

ModelProviderInputOutputCache Read
Claude Opus 4.6Anthropic$5.00$25.00$0.50
Claude Sonnet 4.6Anthropic$3.00$15.00$0.30
Claude Sonnet 4Anthropic$3.00$15.00$0.30
Claude Haiku 4.5Anthropic$1.00$5.00$0.10
Claude Opus 4Anthropic$5.00$25.00$0.50
Claude 3 HaikuAnthropic$0.25$1.25$0.03
GPT-5.4OpenAI$2.50$15.00$0.25
GPT-5.4 MiniOpenAI$0.75$4.50$0.075
GPT-5.4 NanoOpenAI$0.20$1.25$0.02
GPT-4oOpenAI$2.50$10.00$1.25
GPT-4o MiniOpenAI$0.15$0.60$0.075
o3OpenAI$10.00$40.00$2.50
o4 MiniOpenAI$1.10$4.40$0.275
Gemini 3Google$2.00$12.00$0.20
Gemini 2.5 ProGoogle$1.25$10.00$0.31
Gemini 2.5 FlashGoogle$0.15$0.60$0.04
Gemini 2.0 FlashGoogle$0.10$0.40$0.025
Llama 4 Scout 17BGroq$0.11$0.18
Llama 3.3 70BGroq$0.59$0.79
Llama 3.1 8BGroq$0.05$0.08
Mixtral 8x7BGroq$0.24$0.24
Gemma2 9BGroq$0.20$0.20
DeepSeek Chat V3DeepSeek$0.27$1.10$0.07
DeepSeek Coder V3DeepSeek$0.27$1.10$0.07
DeepSeek Reasoner R1DeepSeek$0.55$2.19$0.14
Mistral LargeMistral$2.00$6.00
Mistral SmallMistral$0.10$0.30
CodestralMistral$0.30$0.90
Mistral NemoMistral$0.15$0.15
Command RCohere$0.15$0.60
Command R+Cohere$2.50$10.00
Command LightCohere$0.08$0.08
Claude 3.5 Sonnet v2Bedrock$3.00$15.00
Claude 3 HaikuBedrock$0.25$1.25
Nova ProBedrock$0.80$3.20
Nova LiteBedrock$0.06$0.24
Nova MicroBedrock$0.035$0.14
Llama 3.1 (Local)OllamaFreeFree
Mistral (Local)OllamaFreeFree
Code Llama (Local)OllamaFreeFree

Prices per 1M tokens. Ollama models run locally at zero cost. Azure OpenAI and AWS Bedrock host the same models as OpenAI and Anthropic respectively. Full registry including batch pricing, cache write rates, and context windows available via the get_model_pricing MCP tool.

Deployment Options

One-click via mcp.hosting

Deploy Token Meter as a hosted MCP server on mcp.hosting with auto-provisioned API keys and session proxy support for reliable stateful connections.

Private networks via tailscale-mcp

For teams running MCP servers on private infrastructure, tailscale-mcp provides secure access over your tailnet without exposing endpoints to the public internet.

Validate with mcp-compliance

Use mcp-compliance to verify your MCP server configuration meets protocol standards before deploying.

Reduce Token Waste

Token Meter shows you where your spend goes. ctxlint helps you cut it — lint your AI agent context files and MCP configs to trim unnecessary tokens before they reach the model.

Stay Updated

For weekly coverage of AI tooling, LLM pricing changes, and developer workflows, subscribe to Token Limit News.