Installation
Complete installation guide for all supported languages and frameworks.
Prerequisites
Before you begin, make sure you have:
- An OpenAI or Anthropic API key
- A project using OpenAI or Anthropic APIs
- 5 minutes to complete setup
Step 1: Create Your Account
Sign Up
Go to app.aispendtrack.com and create an account.
Sign up options:
- Google - One-click sign up
- Email - Traditional email/password
Get Your API Key
After signing up:
- Click your profile icon (top right)
- Navigate to Settings
- Copy your AiSpendTrack API Key
Your key will look like: ask_abc123def456...
Keep this key secret! Don’t commit it to version control.
Store Your Key Securely
Add to your .env file:
AISPENDTRACK_API_KEY=ask_your_key_hereAdd .env to your .gitignore:
.env
.env.localStep 2: Update Your Code
Choose your language/framework:
Node.js
Node.js / TypeScript
Install SDK:
npm install openai @anthropic-ai/sdkFor OpenAI:
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
baseURL: "https://proxy.aispendtrack.com/v1",
defaultHeaders: {
"x-aispendtrack-key": process.env.AISPENDTRACK_API_KEY
}
});For Anthropic:
import Anthropic from '@anthropic-ai/sdk';
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
baseURL: "https://proxy.aispendtrack.com/anthropic/v1",
defaultHeaders: {
"x-aispendtrack-key": process.env.AISPENDTRACK_API_KEY
}
});Step 3: Test Your Setup
Make a test API call:
Node.js
const completion = await openai.chat.completions.create({
model: "gpt-3.5-turbo",
messages: [
{ role: "user", content: "Say 'AiSpendTrack is working!'" }
]
});
console.log(completion.choices[0].message.content);Step 4: Verify in Dashboard
- Run your test code
- Go to app.aispendtrack.com
- Refresh the page
- You should see the API call appear within 10 seconds!
Success! You’re now tracking your AI costs in real-time.
Troubleshooting
Not seeing calls in dashboard?
- Wait 10-15 seconds - Logging is asynchronous
- Check your API key - Make sure it starts with
ask_ - Verify the baseURL - Must be exactly as shown above
- Check console for errors - Look for 401/429 status codes
Getting 401 Unauthorized?
Your AiSpendTrack API key is invalid or missing.
- Check the header name:
x-aispendtrack-key(all lowercase) - Check the value: Copy fresh from Settings page
- Check it’s in environment variables, not hardcoded
Getting 429 Rate Limit?
You’ve hit your monthly limit (10,000 calls for free tier).
Options:
- Wait until next month (resets on 1st)
- Upgrade to Pro for unlimited
Still stuck?
- 📧 Email: support@aispendtrack.com
- 💬 Live chat: Available in dashboard
- 🐛 Report bug: GitHub Issues
Next Steps
Last updated on