Documentation

Everything you need to integrate ModelWallet and start tracking your AI costs

⚡ Quick Start

Get up and running in less than 5 minutes. Choose your preferred language:

1. Install the SDK

pip install modelwallet

2. Initialize in your code

import modelwallet import openai # Initialize ModelWallet modelwallet.init( api_key="mw_your_api_key_here", team="engineering", project="chatbot-v2" ) # Use OpenAI as normal client = openai.OpenAI() response = client.chat.completions.create( model="gpt-4", messages=[{"role": "user", "content": "Hello!"}] ) # ModelWallet automatically tracks this call

3. View your dashboard

That's it! Your costs are now being tracked in real-time. Visit your dashboard at dashboard.modelwallet.tech

🏷️ Custom Metadata

Add custom tags to track costs by any dimension you need.

modelwallet.track( model="gpt-4", user_id="user_123", feature="summarization", environment="production", custom_tags={ "customer_id": "acme_corp", "workflow": "document_analysis" } )

💰 Enforcing Budgets

Check budget status before making expensive calls.

if modelwallet.check_budget("team-budget"): # Safe to proceed response = client.chat.completions.create(...) else: # Budget exceeded return "Budget limit reached"

📊 Cost Estimation

Estimate costs before making API calls.

estimated_cost = modelwallet.estimate( model="gpt-4", input_tokens=1000, output_tokens=500 ) print(f"Est. cost: ${estimated_cost}")

🔔 Webhook Alerts

Receive real-time alerts when budgets are exceeded.

modelwallet.webhook.configure( url="https://your-app.com/webhook", events=["budget.exceeded", "anomaly.detected", "quota.reached"] )

Integration Guides

🤖

OpenAI

Track GPT-4, GPT-3.5, and DALL-E costs automatically

View Guide →
🧠

Anthropic Claude

Monitor Claude API usage and costs in real-time

View Guide →
🎯

Cohere

Track Cohere embeddings and generation costs

View Guide →
🤗

Hugging Face

Monitor inference API and endpoint costs

View Guide →
⚙️

Custom Models

Track self-hosted and custom model costs

View Guide →
🔗

LangChain

Integrate with LangChain applications seamlessly

View Guide →

API Reference

GET /api/v1/costs

Retrieve cost data for a specific time period

GET
curl -X GET "https://api.modelwallet.tech/v1/costs?start_date=2026-01-01&end_date=2026-01-31" \ -H "Authorization: Bearer mw_your_api_key"

POST /api/v1/budgets

Create a new budget for a team or project

POST
curl -X POST "https://api.modelwallet.tech/v1/budgets" \ -H "Authorization: Bearer mw_your_api_key" \ -d '{ "name": "Q1 Team Budget", "amount": 5000, "period": "monthly", "team_id": "team_123" }'

GET /api/v1/analytics/breakdown

Get detailed cost breakdown by model, team, or project

GET
curl -X GET "https://api.modelwallet.tech/v1/analytics/breakdown?group_by=model" \ -H "Authorization: Bearer mw_your_api_key"

Best Practices

✅ Do's

  • ✓ Set up budgets for all teams and projects
  • ✓ Use custom tags for fine-grained tracking
  • ✓ Enable anomaly detection alerts
  • ✓ Review costs weekly to spot trends
  • ✓ Test different models to find cost-performance sweet spot
  • ✓ Set up webhooks for critical alerts

❌ Don'ts

  • ✗ Don't share API keys between environments
  • ✗ Don't ignore anomaly alerts
  • ✗ Don't set unrealistic budget limits
  • ✗ Don't forget to tag requests properly
  • ✗ Don't use production keys in development
  • ✗ Don't disable cost tracking in production

Need Help?

Our team is here to help you get the most out of ModelWallet