---
title: "AI"
description: "Observe Cloudflare Agents events and trace AI workloads across Eve, Better Agent, Vercel AI SDK, OpenAI, Anthropic, and fetch transports."
canonical_url: "https://www.blyp.dev/docs/ai"
markdown_url: "https://www.blyp.dev/docs/ai.md"
last_updated: "1970-01-01"
x_farming_labs_generated_preamble: true
---

# AI
URL: /docs/ai
LLM index: /llms.txt
Description: Observe Cloudflare Agents events and trace AI workloads across Eve, Better Agent, Vercel AI SDK, OpenAI, Anthropic, and fetch transports.

# AI

Blyp emits structured `ai_trace` records for model calls and agent turns, and `ai_agent_event` records for native Cloudflare Agents activity.

Supported entrypoints:

- `@blyp/core/ai/cloudflare` for native Cloudflare Agents events on Workers
- `@blyp/core/ai/eve` for durable Eve agent turn tracing
- `@blyp/core/ai/better-agent` for Better Agent app-level plugins and manual run trackers
- `@blyp/core/ai/vercel` for Vercel AI SDK middleware and model wrappers
- `@blyp/core/ai/openai` for direct OpenAI SDK instrumentation
- `@blyp/core/ai/anthropic` for direct Anthropic SDK instrumentation
- `@blyp/core/ai/fetch` for low-level transport tracing around `fetch`

## What gets emitted

The [Cloudflare Agents connector](/docs/ai/cloudflare) emits one `ai_agent_event` per selected native event, with agent identity, event type, timestamp, and safe technical attributes. Detailed payload capture is off by default. It does not capture model transcripts, token usage, or direct `env.AI.run()` calls.

Each traced AI call produces one normalized `ai_trace` record with:

- `provider`
- `model`
- `operation`
- token usage when the provider returns it
- `finishReason`
- timing data
- `msToFirstChunk` for streamed responses
- best-effort tool-call records and trace events

The goal is to make AI calls queryable with the same Blyp primitives used for request logs, structured logs, connectors, and database records.

## Request-scoped correlation

When an active request-scoped logger exists, AI traces inherit it automatically. That means the same request can carry:

- the server request log
- AI trace records
- structured logs
- connector-forwarded logs
- database-persisted rows

See [Request Tracing](/docs/working-with-blyp/request-tracing) for the `x-blyp-trace-id` lifecycle and how browser logs join the same trace.

The Cloudflare connector defaults to Workers console output. Pass a compatible request logger explicitly through its `logger` option when you need that logger's request context.

## Covered SDK paths

| Entry | Covered calls |
| --- | --- |
| `@blyp/core/ai/cloudflare` | Native Cloudflare Agents lifecycle, RPC, tools, schedules, workflows, MCP, recovery, and errors; emits individual event records |
| `@blyp/core/ai/eve` | Eve hooks, emitted as one aggregated trace per turn across workflow boundaries |
| `@blyp/core/ai/better-agent` | Better Agent run-level tracing through app plugins or manual tracker wiring |
| `@blyp/core/ai/vercel` | Vercel AI SDK `generateText()` and `streamText()` |
| `@blyp/core/ai/openai` | OpenAI `responses.create()` and `chat.completions.create()` |
| `@blyp/core/ai/anthropic` | Anthropic `messages.create()` |
| `@blyp/core/ai/fetch` | generic transport tracing for status, latency, request IDs, and optional JSON body inspection |

OpenRouter is supported through the OpenAI-compatible path by pointing the OpenAI client at the OpenRouter base URL.

## Read next

- [AI Tracing](/docs/ai/tracing)
- [Cloudflare Agents](/docs/ai/cloudflare)
- [Eve](/docs/ai/eve)
- [Better Agent](/docs/ai/better-agent)
- [Vercel AI SDK](/docs/ai/vercel-ai-sdk)
- [OpenAI SDK](/docs/ai/openai-sdk)
- [Anthropic SDK](/docs/ai/anthropic-sdk)
- [AI Privacy & Capture](/docs/ai/privacy-and-capture)
- [Request Tracing](/docs/working-with-blyp/request-tracing)

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
