# Set Up

Sentry AI Agent Monitoring helps you track and debug AI agent applications using our supported SDKs and integrations. Monitor your complete agent workflows from user interaction to final response, including tool calls, model interactions, and custom logic.

To start sending AI agent data to Sentry, make sure you've created a Sentry project for your AI-enabled repository and follow one of the guides below:

## [Supported SDKs](https://docs.sentry.io/.md#supported-sdks)

### [JavaScript - Vercel AI SDK](https://docs.sentry.io/.md#javascript---vercel-ai-sdk)

The Sentry JavaScript SDK supports AI agent monitoring through the Vercel AI integration, which works with Node.js and Bun runtimes. This integration automatically captures spans for your AI agent workflows using the AI SDK's built-in telemetry.

#### [Supported Platforms](https://docs.sentry.io/.md#supported-platforms)

* [![javascript.node icon](https://docs.sentry.io/_next/static/media/nodejs.79546009.svg)Node.js](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/vercelai.md)
* [![javascript.nextjs icon](https://docs.sentry.io/_next/static/media/nextjs.27669790.svg)Next.js](https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/integrations/vercelai.md)
* [![javascript.sveltekit icon](https://docs.sentry.io/_next/static/media/svelte.d8e9a29b.svg)SvelteKit](https://docs.sentry.io/platforms/javascript/guides/sveltekit/configuration/integrations/vercelai.md)
* [![javascript.nuxt icon](https://docs.sentry.io/_next/static/media/nuxt.90663273.svg)Nuxt](https://docs.sentry.io/platforms/javascript/guides/nuxt/configuration/integrations/vercelai.md)
* [![javascript.astro icon](https://docs.sentry.io/_next/static/media/astro.3cb960c2.svg)Astro](https://docs.sentry.io/platforms/javascript/guides/astro/configuration/integrations/vercelai.md)
* [![javascript.remix icon](https://docs.sentry.io/_next/static/media/remix.27fc09d0.svg)Remix](https://docs.sentry.io/platforms/javascript/guides/remix/configuration/integrations/vercelai.md)
* [![javascript.solidstart icon](https://docs.sentry.io/_next/static/media/solidstart.a4c37fbe.svg)SolidStart](https://docs.sentry.io/platforms/javascript/guides/solidstart/configuration/integrations/vercelai.md)
* [![javascript.express icon](https://docs.sentry.io/_next/static/media/express.ccf88a5c.svg)Express](https://docs.sentry.io/platforms/javascript/guides/express/configuration/integrations/vercelai.md)
* [![javascript.fastify icon](https://docs.sentry.io/_next/static/media/fastify.41f6ba73.svg)Fastify](https://docs.sentry.io/platforms/javascript/guides/fastify/configuration/integrations/vercelai.md)
* [![javascript.nestjs icon](https://docs.sentry.io/_next/static/media/nestjs.d9d27813.svg)Nest.js](https://docs.sentry.io/platforms/javascript/guides/nestjs/configuration/integrations/vercelai.md)
* [![javascript.hapi icon](https://docs.sentry.io/_next/static/media/hapi.e3b32f5e.svg)Hapi](https://docs.sentry.io/platforms/javascript/guides/hapi/configuration/integrations/vercelai.md)
* [![javascript.koa icon](https://docs.sentry.io/_next/static/media/koa.7d7a394d.svg)Koa](https://docs.sentry.io/platforms/javascript/guides/koa/configuration/integrations/vercelai.md)
* [![javascript.connect icon](https://docs.sentry.io/_next/static/media/connect.bfc1f584.svg)Connect](https://docs.sentry.io/platforms/javascript/guides/connect/configuration/integrations/vercelai.md)
* [![javascript.hono icon](https://docs.sentry.io/_next/static/media/hono.3f338aa8.svg)Hono](https://docs.sentry.io/platforms/javascript/guides/hono/configuration/integrations/vercelai.md)
* [![javascript.bun icon](https://docs.sentry.io/_next/static/media/bun.64e0abda.svg)Bun](https://docs.sentry.io/platforms/javascript/guides/bun/configuration/integrations/vercelai.md)
* [![javascript.aws-lambda icon](https://docs.sentry.io/_next/static/media/awslambda.4ae6e6f7.svg)AWS Lambda](https://docs.sentry.io/platforms/javascript/guides/aws-lambda/configuration/integrations/vercelai.md)
* [![javascript.azure-functions icon](https://docs.sentry.io/_next/static/media/azure-functions.0d829f41.svg)Azure Functions](https://docs.sentry.io/platforms/javascript/guides/azure-functions/configuration/integrations/vercelai.md)
* [![javascript.gcp-functions icon](https://docs.sentry.io/_next/static/media/gcp-functions.6492b2be.svg)Google Cloud Functions](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/integrations/vercelai.md)
* [![javascript.electron icon](https://docs.sentry.io/_next/static/media/electron.9dec18b9.svg)Electron](https://docs.sentry.io/platforms/javascript/guides/electron/configuration/integrations/vercelai.md)

#### [Quick Start with Vercel AI SDK](https://docs.sentry.io/.md#quick-start-with-vercel-ai-sdk)

For Next.js applications, the Vercel AI integration can only be added to `sentry.server.config.ts` (server-side configuration). It is not supported in edge configurations (`sentry.edge.config.ts`) or browser configurations (`instrumentation-client.ts`).

```javascript
import { Sentry } from "@sentry/node";

// Sentry init needs to be above everything else
Sentry.init({
  tracesSampleRate: 1.0,
  integrations: [
    Sentry.vercelAIIntegration({
      recordInputs: true,
      recordOutputs: true,
    }),
  ],
});

import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";

// Your AI agent function
async function aiAgent(userQuery) {
  const result = await generateText({
    model: openai("gpt-4o"),
    prompt: userQuery,
    experimental_telemetry: {
      isEnabled: true,
      functionId: "ai-agent-main",
    },
  });

  return result.text;
}
```

### [Python - OpenAI Agents](https://docs.sentry.io/.md#python---openai-agents)

The Sentry Python SDK supports OpenAI Agents SDK.

#### [Quick Start with OpenAI Agents](https://docs.sentry.io/.md#quick-start-with-openai-agents)

```python
import sentry_sdk
from sentry_sdk.integrations.openai_agents import OpenAIAgentsIntegration
import agents
from pydantic import BaseModel

sentry_sdk.init(
    dsn="YOUR_DSN",
    traces_sample_rate=1.0,
    send_default_pii=True,  # Include LLM inputs/outputs
    integrations=[
        OpenAIAgentsIntegration(),
    ],
)

# Create your AI agent
my_agent = agents.Agent(
    name="My Agent",
    instructions="You are a helpful assistant.",
    model="gpt-4o-mini",
)

# Your AI agent function
result = await agents.Runner.run(
    my_agent,
    input=user_query,
)
```

##### Don't see your platform?

We'll be adding AI agent integrations continuously. You can also instrument AI agents manually by following our [manual instrumentation guide](https://docs.sentry.io/platforms/python/tracing/instrumentation/custom-instrumentation/ai-agents-module.md).
