Skip to main content

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

Use 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

Used by margovia.canRun(...) to check active budgets before running expensive work.

GuardrailCheckResult

TrackedProviderCallInput

Used by 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

Used by trackOpenAI(...) and trackAnthropic(...). The SDK preserves the response type returned by fn.

CustomerInput

Used by the customer(...) helper to build customerId, customerName, and customerPlan.
This produces: