skills/use-ai-sdk/references/devtools.md
DevTools captures all AI SDK calls (generateText, streamText, ToolLoopAgent) to a local JSON file. This lets you inspect LLM requests, responses, tool calls, and multi-step interactions without manually logging.
Requires AI SDK 6. Install @ai-sdk/devtools using your project's package manager.
Wrap your model with the middleware:
import { wrapLanguageModel, gateway } from 'ai';
import { devToolsMiddleware } from '@ai-sdk/devtools';
const model = wrapLanguageModel({
model: gateway('anthropic/claude-sonnet-4.5'),
middleware: devToolsMiddleware(),
});
All runs and steps are saved to:
.devtools/generations.json
Read this file directly to inspect captured data:
cat .devtools/generations.json | jq
Or launch the web UI:
npx @ai-sdk/devtools
# Open http://localhost:4983