Skip to main content

vantage-ai

LLM cost tracking and AI API monitoring SDK.

Track token usage, cost, latency and quality for OpenAI, Anthropic, Google and Mistral — with one line of code.

PyPI Python License: MIT

Install

pip install vantageaiops            # core only
pip install vantageaiops[openai]    # + OpenAI proxy
pip install vantageaiops[anthropic] # + Anthropic proxy
pip install vantageaiops[google]    # + Gemini proxy
pip install vantageaiops[all]       # everything

Quickstart

import vantage
from vantage.wrappers import create_openai_proxy
import openai

# 1. Init once (e.g. in app startup)
vantage.init(api_key="vnt_your_key")

# 2. Wrap your OpenAI client — zero other changes
client = create_openai_proxy(openai.OpenAI())

# 3. Use normally — every call is automatically tracked
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

Every call is logged to your VantageAI dashboard with:

  • Token counts (prompt + completion)
  • Cost in USD
  • Latency (ms)
  • Model and provider
  • Team / environment tags

Anthropic

import vantage
from vantage.wrappers import create_anthropic_proxy
import anthropic

vantage.init(api_key="vnt_your_key")
client = create_anthropic_proxy(anthropic.Anthropic())

response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}]
)

Manual tracking

import vantage

vantage.init(api_key="vnt_your_key")

vantage.track(
    model="gpt-4o",
    provider="openai",
    prompt_tokens=500,
    completion_tokens=120,
    total_cost_usd=0.0035,
    latency_ms=842,
    team="search",
    environment="production",
)

Agent / multi-step traces

import uuid, vantage

vantage.init(api_key="vnt_your_key")

trace_id = str(uuid.uuid4())

# Step 1 — root call
vantage.track(model="gpt-4o", ..., trace_id=trace_id, span_depth=0)

# Step 2 — sub-call
vantage.track(model="claude-3-5-sonnet-20241022", ..., trace_id=trace_id, span_depth=1)

Traces appear in the Agent Traces tab of your dashboard with per-span cost breakdown.

Configuration

vantage.init(
    api_key="vnt_your_key",
    org="acme",                  # auto-parsed from key if omitted
    team="platform",             # default team tag
    environment="production",    # default: "production"
    ingest_url="https://api.vantageaiops.com",
    flush_interval=2.0,          # seconds between auto-flush
    batch_size=50,               # events per HTTP request
    debug=False,
)

Links

Metadata

Release files for vantageaiops 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vantageaiops 0.3.1
File Size Uploaded
vantageaiops-0.3.1.tar.gz 42.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vantageaiops 0.3.1
File Interpreter ABI Platform
vantageaiops-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 70.6 kB

Release files / vantageaiops-0.3.1.tar.gz

Download URL vantageaiops-0.3.1.tar.gz
Size 42.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3dd2ecc528b09cb2d84dc0b59be0202fdd9857ef5bdec796cf9981281ec19a45
BLAKE2b-256 checksum
How to use checksums
626eecffc52c067dfb9d473df4e44b5adb7d090d112a9f02f82771ff23776532
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / vantageaiops-0.3.1-py3-none-any.whl

Download URL vantageaiops-0.3.1-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
781ab4c9153ef4accb804910e70b1524f1fef45ce5d7329fcf97c1695459024b
BLAKE2b-256 checksum
How to use checksums
e686f2154f20a5a2a9a9cbdd7070228183ad9290808a2beee929ad1b077e9248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page