Skip to main content
Give us a star on GitHub!
The Keywords AI Tracing SDK for TypeScript/JavaScript provides comprehensive observability for your AI applications with automatic instrumentation for OpenAI, Anthropic, and other providers.

Installation

Node.js Requirement: This package requires Node.js 18 or later.

Configure credentials

Set up your environment variables:
.env
Initialize the SDK:

Trace a workflow and task

Use withWorkflow and withTask to create structured traces:

OpenAI Integration

Automatically instrument OpenAI SDK calls:

Agent and Tool Tracing

For agentic workflows, use withAgent and withTool:

Configuration Options

string
required
Your Keywords AI API key
string
default:"https://api.keywordsai.co"
Keywords AI API base URL
string
Name of your application for tracing identification
object
Modules to automatically instrument
boolean
default:false
If true, sends spans immediately instead of batching
string
default:"warn"
Logging level: "debug", "info", "warn", "error"

Next Steps