StartRunInput
customerId is your stable customer, workspace, organization, tenant, or billing customer key. Prefer namespaced values such as workspace_123, org_abc, or stripe_cus_123. Margovia stores this value exactly as sent.
TrackCostInput
completeRun only when a cost event is also the terminal event for the run. Tracked clients, provider helpers, and wrapped provider calls use this internally for one-call workflows. For multi-step workflows, complete the run after all steps finish.
TrackOutcomeInput
CompleteRunInput
FailRunInput
GuardrailCheckInput
margovia.canRun(...) to check active budgets before running expensive work.
GuardrailCheckResult
TrackedProviderCallInput
margovia.openai(client) and margovia.anthropic(client).
request is the real provider request. Margovia run fields, such as name, customerId, customerName, and outcome, live beside request.
TrackProviderInput
trackOpenAI(...) and trackAnthropic(...). The SDK preserves the response type returned by fn.
CustomerInput
customer(...) helper to build customerId, customerName, and customerPlan.