Skip to content

AI

AI chat

A streaming chat with tool calling and a five-step limit, gated by session and rate limits and wired to usage limits. Without an API key it answers with a clear 503 instead of breaking.

  • AI SDK

What you get

  • Streaming responses through streamText
  • Tool calling, with new tools added in one route
  • Gemini, OpenAI and Anthropic support
  • Per-plan metering through usage limits and credits
  • A protected chat page in the dashboard

Turn it on

  • GOOGLE_GENERATIVE_AI_API_KEY or another provider's key

Where it lives

  • app/api/ai/chat/route.ts
  • lib/ai.ts
  • features/ai/
  • components/ai-elements/