No runs appear
Check these first:MARGOVIA_API_KEYis set in the backend process that calls the model provider- The SDK runs in backend code, not browser code
- The API key belongs to the Margovia project you are viewing
- Your provider call actually executes through the tracked client, wrapper, or provider helper
MARGOVIA_BASE_URLis not accidentally pointing at localhost in production
MARGOVIA_API_KEY, the SDK skips Margovia tracking and does not send events.
Runs stay running
Tracked clients, wrapped provider calls, provider helpers, andmargovia.track(...) complete or fail runs automatically.
Manual runs do not. If you call startRun(...), you must eventually call one of:
Runs appear but cost is zero
This usually means a run was created without a cost event. Common causes:- You used
margovia.track(...)around a raw OpenAI or Anthropic client - You called
startRun(...)andcomplete(...)but never calledrun.trackCost(...) - The provider response did not include usage fields
margovia.openai(client) or margovia.anthropic(client).
Bad:
anthropic is not wrapped, Margovia cannot read token usage.
Fix with the tracked client:
Customer margin is missing
Margin requires both cost and revenue context. Send customer attribution:customerId is sent, Margovia can group usage but cannot calculate margin until plan revenue is available.
Customer IDs look wrong
Margovia storescustomerId exactly as sent by your app.
If you send "1", the dashboard will show and group by "1". Prefer namespaced IDs:
customerName or dashboard aliases for display names. Do not change customerId just to make the UI prettier.
Costs look too low or too high
Check:- The provider response includes usage fields
- The model name matches Margovia pricing
- Cached input and reasoning token fields are being reported by the provider
- Manual
costUsdvalues are in USD, not cents
costUsd explicitly:
Local development hits the wrong API
WithMARGOVIA_API_KEY configured and no MARGOVIA_BASE_URL, the SDK sends to Margovia Cloud by default.
For a local API:
MARGOVIA_BASE_URL in production unless you intentionally use a custom API host.