Documentation menu
DocsGetting started

Introduction

Public packages for product LLM attribution and coding-agent spend collection.

View source

trAIce connects AI usage to the business dimensions that explain it: customer, user, feature, workflow, agent, and team. The public repository provides product-runtime SDKs, a direct HTTP contract, and local coding-agent collectors.

Choose a data path

Product usage and internal AI-tool usage are separate data streams. Choose the path that matches who initiated the spend.

PathUse it forDestinationStart here
Product SDKsLLM calls made by your application for customers or end users/api/v1/eventsProduct SDKs
Internal Spend collectorClaude Code and Codex usage by employees and teams/api/v1/internal-usageCollector overview
Ask trAIceSpend questions and explicitly confirmed Team actions/api/v1/ask or MCPAsk trAIce

Do not send employee coding-agent usage as a product event. Do not use customer identifiers as employee identifiers. Keeping the two paths separate preserves clear allocation and reporting.

Public packages

PackagePurposeRegistrySource
@traice/sdkTypeScript and Node.js product-runtime metering, adapters, analytics, and request guardrailsnpmpackages/sdk
traice-sdkPython product-runtime collection for OpenAI, Anthropic, LangChain, and LangGraphPyPIpackages/python
@traice/collectorLocal Claude Code and Codex telemetry collectionnpmpackages/collector
@traice/protocolShared public event types, validation, normalization, and redaction helpersnpmpackages/protocol

Product attribution model

Every product integration can attach the same dimensions:

tenantId is the primary dimension for customer-level AI contribution margin. Use the same stable customer identifier that your billing or revenue data uses.

Security and privacy

Store the trAIce API key in your secret manager and provide it through TRAICE_API_KEY. Provider keys remain in your infrastructure and are never sent to trAIce.

Product attribution does not require prompts or model outputs. The Python SDK never sends either. The TypeScript SDK sends them only when you explicitly pass prompt or output and your workspace is configured to accept samples. Collectors keep prompt capture off by default.

Next steps

  1. Create a workspace key and send a first event.
  2. Choose TypeScript and Node.js, Python, or HTTP and cURL.
  3. Use the API reference for signatures, event contracts, and source links.