Initialize the auditor singleton, patch clients or log events manually, and flush before shutdown.
Agent hint
Use when wiring AurexAuditor.getInstance / AurexAuditor(), patchAll, logEvent, flush, or shutdown.
In scope
Out of scope
from aurex_sdk import AurexAuditor, AurexConfig
auditor = AurexAuditor(AurexConfig(
api_key="aux_dev_yourkey",
project="my-project",
storage_mode="file",
ledger_path=".aurex/ledger.jsonl",
cloud_sync=True,
))
auditor.log_event(
model="gpt-4o-mini",
input_tokens=120,
output_tokens=40,
workflow_id="checkout_agent",
)
auditor.flush()
auditor.shutdown()import { AurexAuditor } from "aurex-sdk";
const auditor = AurexAuditor.getInstance({
apiKey: "aux_dev_yourkey",
project: "my-project",
ledgerPath: ".aurex/ledger.jsonl",
cloudSync: true,
});
auditor.logEvent({
model: "gpt-4o-mini",
inputTokens: 120,
outputTokens: 40,
workflowId: "checkout_agent",
});
await auditor.flushAndWait();
auditor.shutdown();from aurex_sdk import AurexAuditor auditor = AurexAuditor() auditor.patch_all() # auditor.patch_openai() # auditor.patch_anthropic()
import { AurexAuditor } from "aurex-sdk";
const auditor = AurexAuditor.getInstance();
auditor.patchAll();auditor.register_model_pricing("custom-llama-3", input_cost=0.15, output_cost=0.60)
auditor.register_model_pricing("local/*", input_cost=0.00, output_cost=0.00)auditor.registerModelPricing("custom-llama-3", 0.15, 0.60);
auditor.registerModelPricing("local/*", 0.00, 0.00);