Skip to main content
If you serve many end-users, tag each call with your user id. Orbitrage then breaks down cost, usage, and flow graphs per customer — inside one project. It’s your own data about your own users.

One user per process

import orbitrage
orbitrage.init(api_key, user_id=current_user.id)

A multi-tenant server

Set the user at the start of each request, then build the client.
import os, orbitrage
orbitrage.init(os.environ["ORBITRAGE_API_KEY"])

from fastapi import FastAPI, Request
from openai import OpenAI
app = FastAPI()

@app.post("/chat")
def chat(request: Request, body: dict):
    orbitrage.set_user(body["user_id"])     # tag this request's calls
    client = OpenAI()                        # construct AFTER set_user
    resp = client.chat.completions.create(
        model="grok-4-fast",
        messages=body["messages"],
    )
    return resp.choices[0].message.content
In Python, construct the OpenAI() client after set_user() — already-built clients keep their original headers. Node’s withAssociationProperties scopes the user to the block, so any client built inside it is tagged.

What you get

In the dashboard, filter any workflow by end-user to see:
  • spend and call volume per customer,
  • their per-run flow graph,
  • and churn / frustration signals in the Intelligence layer.
Set only x-orbitrage-end-user-id (what user_id does). Never send x-orbitrage-user-id — that’s the gateway’s account identity and returns 403.