
Install the SDK, run one command, and your agent's traffic shows up in Amplitude about five minutes from now. You need a project with Agent Analytics enabled and its API key, and nothing else. Anonymous user and session IDs are fine.

This page is the fast path. To instrument production with full identity and privacy controls, go to [Set up Agent Analytics](/docs/amplitude-ai/agent-analytics/setup) and the [SDK reference](/docs/sdks/agent-analytics/sdk) instead.

## Install the SDK

{% tabs tabs="Node, Python" %}
{% tab name="Node" %}

```bash
npm install @amplitude/ai @amplitude/analytics-node
```

{% /tab %}
{% tab name="Python" %}

```bash
pip install amplitude-ai
```

{% /tab %}
{% /tabs %}

## Run the setup agent

Run this, paste the printed prompt into your coding assistant (Cursor, Claude Code, Windsurf, GitHub Copilot, or Codex), and approve the change it proposes.

{% tabs tabs="Node, Python" %}
{% tab name="Node" %}

```bash
npx amplitude-ai
```

{% /tab %}
{% tab name="Python" %}

```bash
amplitude-ai
```

{% /tab %}
{% /tabs %}

The agent finds every LLM call site and the session lifecycle, instruments them, and prints a dry-run report of the events and field fill rates before anything ships.

## Patch one line instead

No coding assistant handy? One call at startup monkey-patches supported provider clients (OpenAI, Anthropic, Gemini, and more), so the SDK tracks your existing LLM calls with no other code changes.

{% tabs tabs="Node, Python" %}
{% tab name="Node" %}

```typescript
import { AmplitudeAI, patch } from "@amplitude/ai";

const ai = new AmplitudeAI({ apiKey: process.env.AMPLITUDE_AI_API_KEY! });
patch({ amplitudeAI: ai });
```

{% /tab %}
{% tab name="Python" %}

```python
import os
from amplitude_ai import AmplitudeAI, patch

ai = AmplitudeAI(api_key=os.environ["AMPLITUDE_AI_API_KEY"])
patch(amplitude=ai)
```

{% /tab %}
{% /tabs %}

The patch captures basic `[Agent] AI Response` events only: enough to verify the pipeline works, not the end state.

## Watch the events arrive

Run the doctor to validate your environment variables, dependencies, and the event-pipeline connection:

```bash
npx amplitude-ai doctor
```

Then open your project's Live Events stream. `[Agent] AI Response` events appear with model, provider, latency, token, and cost fields populated. For the full verification checklist, go to [Verify your data](/docs/amplitude-ai/agent-analytics/setup#verify-your-data).

## Add IDs when you're ready

It's a ladder you climb over time, not a form you fill out on day one.

| Add        | What it unlocks                                          |
| ---------- | -------------------------------------------------------- |
| Nothing (patch only) | Basic LLM traces and aggregate call counts     |
| User ID    | Per-user analytics, cohorts, retention                   |
| Session ID | Multi-turn analysis, session enrichment, quality scores  |
| Agent ID   | Per-agent cost, latency, and quality dashboards          |

Placeholder IDs work: events still flow, sessions still enrich, and you can swap in real identity later without re-instrumenting. For the complete breakdown, go to [What you set and what you get](/docs/sdks/agent-analytics/sdk#what-you-set-and-what-you-get) in the SDK reference.
