OpenAI API + Vol 4

Track per-client OpenAI API costs by changing one line in the Python SDK — just set base_url to Vol 4's proxy.

⏱ 5 min setup

If you're calling the OpenAI API directly for multiple clients, Vol 4 gives you per-client cost breakdowns with a single line change. Works with the official Python and Node SDKs.

Setup

Step 1
Install the OpenAI SDK
pip install openai (you probably already have this).
Step 2
Set the base URL
Pass base_url when creating the client. That's the only change.
Step 3
Add the client header
Use default_headers to tag every request to a client.
Step 4
Make API calls as usual
Your code doesn't change. Chat completions, embeddings, images — everything routes through Vol 4.
Step 5
See per-client costs
Dashboard shows cost, tokens, model, latency — broken down by client.

Code

from openai import OpenAI

client = OpenAI(
    api_key="sk-your-key",
    base_url="https://proxy.vol4.ai/v1",
    default_headers={
        "X-Vol4-Client": "haufe-group"
    }
)

response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello"}]
)

# That's it. One line changed. Costs tracked per client.

Why this matters

The OpenAI dashboard shows one aggregate number. Vol 4 splits it per client, per model, per day — so you can price accurately and catch margin problems before they cost you.

Start tracking in 5 minutes

Sign up for Vol 4, get your proxy URL, and see per-client costs on your first API call.

Get Early Access