Node.js
Installation
Basic usage
CallkindredTracer() once at startup. All HTTP requests from your process will be intercepted and logged.
Configuration
Set these environment variables:| Variable | Required | Description |
|---|---|---|
KINDRED_API_KEY | Yes | Your Kindred API key (from the web dashboard) |
KINDRED_API_URL | No | Kindred API base URL; defaults to https://api.usekindred.dev |
KINDRED_SESSION_ID | No | Session identifier; auto-generated UUID if not set |
KINDRED_AGENT_ID | No | Agent identifier |
KINDRED_RUN_ID | No | Run identifier |
Flushing logs
Before shutdown, flush any pending logs:Full Node example
Python
Installation
Basic usage
Callkindred_tracer() once at startup. All HTTP requests (including those from the OpenAI SDK) will be intercepted and logged.
Async usage
Same pattern with async:Configuration
Same environment variables as Node:| Variable | Required | Description |
|---|---|---|
KINDRED_API_KEY | Yes | Your Kindred API key (from the web dashboard) |
KINDRED_API_URL | No | Kindred API base URL; defaults to https://api.usekindred.dev |
KINDRED_SESSION_ID | No | Session identifier; auto-generated if not set |
KINDRED_AGENT_ID | No | Agent identifier |
KINDRED_RUN_ID | No | Run identifier |
Flushing logs
Before shutdown:Full Python example
How it works
- One-time init — Calling
kindredTracer()/kindred_tracer()sets global context and enables interception. - Auto-instrumentation — Node patches
https.request/http.request; Python patcheshttpx(used by OpenAI SDK v1+). - Request detection — Requests to known LLM hostnames are logged as agent (LLM); others as tool.
- Non-blocking export — Logs are batched and sent asynchronously so your agent is not slowed down.
Supported LLM providers
The tracer detects requests to:- OpenAI (
api.openai.com) - Anthropic (
api.anthropic.com) - Google Gemini (
generativelanguage.googleapis.com) - Cohere (
api.cohere.com) - Mistral (
api.mistral.ai)
Security
Sensitive headers are sanitized before logging:Authorizationx-api-keyapi-keyx-auth-tokencookie
Next steps
- Get your API key from the web dashboard and set
KINDRED_API_KEY. - When you want to test determinism, use the replay URL from the Reproducibility page.