Documentation

Everything you need to integrate InfraPrism and start tracking your AI costs.

Quick Start

terminal
# Install the SDK
pip install infraprism

# Set your API keys (or pass them directly)
export INFRAPRISM_API_KEY="ip-..."
export OPENAI_API_KEY="sk-..."
python
from infraprism import InfraPrismOpenAI

# Drop-in replacement for OpenAI client
client = InfraPrismOpenAI()

# Make a tracked API call with cost attribution
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}],
    entity_type="customer",   # customer | team | project | employee
    entity_id="acme-corp",    # Your internal identifier
    tags={"feature": "chat"}, # Optional metadata
)

# That's it! Cost is automatically calculated and attributed.
# Your prompt goes directly to OpenAI - we only see metadata.