Everything you need to integrate ModelWallet and start tracking your AI costs
Get up and running in less than 5 minutes. Choose your preferred language:
pip install modelwallet
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
That's it! Your costs are now being tracked in real-time. Visit your dashboard at dashboard.modelwallet.tech
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"
}
)
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"
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}")
Receive real-time alerts when budgets are exceeded.
modelwallet.webhook.configure(
url="https://your-app.com/webhook",
events=["budget.exceeded",
"anomaly.detected",
"quota.reached"]
)
Retrieve cost data for a specific time period
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"
Create a new budget for a team or project
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 detailed cost breakdown by model, team, or project
curl -X GET "https://api.modelwallet.tech/v1/analytics/breakdown?group_by=model" \
-H "Authorization: Bearer mw_your_api_key"
Our team is here to help you get the most out of ModelWallet