Respan
Trace and monitor your AI SDK application with Respan
Respan (formerly Keywords AI) is an LLM engineering platform for observability, evaluation, and gateway routing. Respan integrates with the AI SDK to provide:
- Tracing for each AI SDK call (input, output, token usage, cost, latency)
- Tool call and structured output capture
- Optional gateway routing across 250+ models behind a single endpoint
Setup
The AI SDK supports tracing via OpenTelemetry. With the VercelAIInstrumentor from @respan/instrumentation-vercel, traces are exported to Respan automatically.
Install
Configure environment variables
Get your API key from platform.respan.ai.
Initialize Respan
Create instrumentation.ts at the root of your Next.js project:
Then mark the SDK packages as server-external in next.config.ts:
Initialize Respan at the top of your handler or entry point:
Generate text with telemetry enabled
Spans appear in the Respan traces page with input, output, token usage, and cost.
Gateway routing (optional)
To use Respan as a unified gateway across providers, point your AI SDK provider at the Respan gateway with your RESPAN_API_KEY. For the OpenAI provider, use https://api.respan.ai/api as the base URL. Provider keys are managed in Respan; only the Respan key is needed at runtime.
The same gateway endpoint accepts Anthropic and Google models when used with their respective AI SDK providers (createAnthropic, createGoogleGenerativeAI) and the matching base path (/api/anthropic, /api/google/gemini).