Getting Started

Three ways to track costs. Pick what fits your workflow.

1

MCP Server

Cost tracking inside Claude Code, Cursor, or Cline. Local tools work without an account.

install + run

$ npx @f3d1/llmkit-mcp-server

add to your MCP config
{
  "mcpServers": {
    "llmkit": {
      "command": "npx",
      "args": ["@f3d1/llmkit-mcp-server"]
    }
  }
}

That's it. Ask your AI assistant "how much did this session cost?" and it'll use the local tools.See all 11 tools ->

2

Python SDK

One-line integration. Wraps any OpenAI-compatible SDK via httpx transport hooks. Zero migration.

install

$ pip install llmkit-sdk

usage

from openai import OpenAI

from llmkit import tracked

 

client = OpenAI(http_client=tracked())

 

# use client normally. costs tracked automatically.

res = client.chat.completions.create(

model="gpt-4o",

messages=[{ "role": "user", "content": "hello" }]

)

Works with OpenAI, Anthropic, Gemini, xAI, DeepSeek, Groq, Together, Fireworks, Mistral. Any SDK that accepts http_client.

3

TypeScript SDK

Full client with sessions, cost tracking, and streaming. Also available as a Vercel AI SDK provider.

install

$ npm install @f3d1/llmkit-sdk

usage

import { LLMKit } from '@f3d1/llmkit-sdk'

 

const kit = new LLMKit({ apiKey: process.env.LLMKIT_KEY })

const res = await kit.chat({

provider: 'openai',

model: 'gpt-4o',

messages: [{ role: 'user', content: 'hello' }]

})

 

console.log(res.content, res.cost)

4

CLI

Wrap any command. The CLI intercepts API calls, prints a cost summary when the process exits. Zero code changes.

wrap a command

$ npx @f3d1/llmkit-cli -- python my_agent.py

output

LLMKIT

 

$0.0847 total 12 requests 34.2s ~$8.96/hr

 

claude-sonnet-4-20250514 8 reqs $0.0623 ████████████████░░░░

gpt-4o-mini 4 reqs $0.0224 ██████░░░░░░░░░░░░░░

API Gateway (optional)

For budget enforcement and centralized logging. Create an account, get an API key, and route requests through the proxy.

1. Create an account

Sign up free and get an API key from the dashboard.

2. Set your provider keys

Add your Anthropic, OpenAI, or other provider API keys in Settings. Encrypted with AES-GCM.

3. Configure budgets

Set per-key limits (daily, weekly, monthly). Budget enforcement uses a reservation pattern: cost is estimated before the request, rejected if over limit.

Resources

MIT licensed. Built with Claude Code. Source on GitHub