Getting Started

Quickstart — Get Started in 2 Minutes

Install the SDK, wrap your LLM client, and start tracking AI costs in under 2 minutes.

Install the SDK

Choose your language:

TypeScript / Node.js

npm install @aicostguard/sdk


Python

pip install aicostguard


Get Your API Key

  • Sign up for free (no credit card required)
  • Go to Dashboard → Settings → API Keys
  • Click Create Key and copy it
  • Wrap Your LLM Client

    TypeScript

    import { CostGuard } from '@aicostguard/sdk';
    
    
    import OpenAI from 'openai';
    
    
    
    
    
    const guard = new CostGuard({ apiKey: 'cg_your_key_here' });
    
    
    const openai = guard.wrap(new OpenAI());
    
    
    
    
    
    // Use openai exactly as before — costs are tracked automatically
    
    
    const chat = await openai.chat.completions.create({
    
    
      model: 'gpt-4o',
    
    
      messages: [{ role: 'user', content: 'Hello!' }],
    
    
    });
    
    
    

    Python

    from aicostguard import CostGuard
    
    
    from openai import OpenAI
    
    
    
    
    
    guard = CostGuard(api_key="cg_your_key_here")
    
    
    client = guard.wrap(OpenAI())
    
    
    
    
    
    response = client.chat.completions.create(
    
    
        model="gpt-4o",
    
    
        messages=[{"role": "user", "content": "Hello!"}]
    
    
    )
    
    
    

    View Your Dashboard

    Visit aicostguard.com/dashboard to see your costs in real time.

    Next Steps

  • TypeScript SDK docs — full configuration reference
  • Python SDK docs — full configuration reference
  • Set budget alerts — prevent bill shock
  • AI Cost Calculator — estimate costs across 52 models