Skip to main content

Required

Set this in the backend app that calls your model provider:
MARGOVIA_API_KEY=mg_live_xxx
The API key authenticates events sent to Margovia. Keep it on the backend. Do not expose it in browser code. If MARGOVIA_API_KEY is missing, the SDK skips Margovia tracking. Installing the SDK alone sends nothing. When MARGOVIA_API_KEY is configured, the SDK sends events to Margovia Cloud at https://api.margovia.com unless MARGOVIA_BASE_URL overrides it.

Optional

MARGOVIA_BASE_URL=https://your-api.example.com
Set MARGOVIA_BASE_URL only if you self-host Margovia, run a compatible receiver, or test against a local API:
MARGOVIA_BASE_URL=http://localhost:4010
MARGOVIA_DEBUG=1
Enables debug logging for skipped or failed tracking operations. Use this when you are verifying an integration. Leave it off in normal production logs unless you are troubleshooting.

Provider keys

Provider API keys are not used by Margovia directly. They are used by your app and provider SDKs:
OPENAI_API_KEY=sk_xxx
ANTHROPIC_API_KEY=sk-ant-xxx