Skip to main content
Create an Agent Traces API key under Business profile → Developers, then select Connect SDK in the app. Agent-tracing keys are distinct from Merchant API and Agent Wallet keys.

Install and initialize

The HTTPS collector uses OTLP/HTTP. A custom endpoint without http:// or https:// is treated as gRPC by the Python SDK.

Environment configuration

Prefer apiKey / api_key over constructing an Authorization header yourself. When custom headers are required, send the collector key as Authorization: Bearer <key>.

JavaScript tracing

Use function wrappers for explicit trace hierarchy:
TypeScript class decorators are also supported:

ESM and Next.js

Require-based automatic instrumentation cannot see normal ESM imports. Pass imported provider modules explicitly:
instrumentModules supports the providers exposed by the installed SDK, including OpenAI, Anthropic, Cohere, Bedrock, Google Vertex AI, Pinecone, Together, LangChain, LlamaIndex, ChromaDB, Qdrant, and MCP.

Python tracing

Decorators support synchronous and asynchronous functions:
Keep decorators on the application boundary that has a useful business name. Provider instrumentation records nested model calls, token use, and supported tool or streaming behavior.

Configuration reference

Both SDKs can export through custom OpenTelemetry exporters and processors. JavaScript additionally exposes conversation tracking, association properties, explicit provider modules, batching controls, and custom model pricing. Python additionally accepts samplers, resource attributes, instrument allow/block sets, and span post-processing.

Custom exporter

If your organization already operates an OpenTelemetry pipeline, pass its exporter instead of the Anyway collector exporter. Authentication and delivery then follow that exporter and collector configuration; Dashboard only receives spans that ultimately reach Anyway’s collector.

Data safety

  • Keep the Agent Traces API key in environment or secret storage.
  • Decide whether prompt and completion content may be captured before production.
  • Never record payment credentials, Agent Wallet Keys, identity documents, or payout details.
  • Use stable pseudonymous IDs in association properties instead of customer email or legal identity.
  • Apply redaction before values enter SDK attributes or model/tool spans.
Disabling prompt capture in your own spans does not automatically redact arguments recorded by third-party provider instrumentation. Test the emitted trace payload with non-sensitive data before enabling production export.