Skip to main content
Initializing Veritrix takes a single function call. Import the trace module, call trace.init() with your project name before any agent code runs, and the SDK automatically instruments every LLM call, tool execution, and agent handoff from that point forward.

Quickstart

Call trace.init() once, as early as possible in your application — before any agent logic, LLM calls, or framework setup. Calling it more than once in the same process is a no-op after the first call.

Step-by-step setup

1

Import the trace module

Add the import at the top of your entry-point file.
2

Call trace.init()

Pass your project name as the first argument. The name must match the project you created in the Veritrix dashboard.
3

Run your agent

Start your agent as normal. No further changes are needed — Veritrix captures all activity automatically.

Parameter reference

name
str
required
The project or agent name as it appears in your Veritrix dashboard. Use a short, descriptive slug (e.g. "checkout-agent", "support-bot"). Names are case-sensitive.
api_key
str
Your Veritrix API key. If omitted, the SDK reads the VERITRIX_API_KEY environment variable. Passing the key directly is convenient during local development, but use the environment variable in production so credentials never appear in source code.
endpoint
str
A custom OpenTelemetry (OTel) exporter endpoint. Defaults to the Veritrix cloud ingest endpoint. Set this only if you are self-hosting an OTel collector or running Veritrix in an enterprise on-premises deployment.
debug
bool
default:"False"
When True, the SDK logs every span payload to stdout as it is emitted. Useful for local troubleshooting. Do not enable in production — it produces high-volume output and may expose sensitive prompt content.
Storing your API key in an environment variable keeps credentials out of your codebase and makes rotating keys easy.
With the variable set, you can call trace.init() without an explicit api_key argument:
In containerised deployments, inject VERITRIX_API_KEY as a secret environment variable through your orchestration platform (e.g. Kubernetes Secrets, Docker secrets, or your CI/CD provider’s secret store).

Full example with all parameters

Get your API key

If you do not yet have an API key, sign in to the Veritrix dashboard, go to Settings → API Keys, and create a new key. See the Installation page for a detailed walkthrough.