Skip to main content

The two AI layers in KilatKoding

KilatKoding includes two different AI layers:
  • AI features for your product,
  • AI coding assistant configuration for your development workflow.

AI features for your product

Available routes

RoutePurpose
/api/ai/chatStreaming chat
/api/ai/generateOne-shot text generation

Core files

FilePurpose
lib/ai/provider.tsSelects the provider and model
lib/ai/middleware.tsHandles auth check, provider check, and usage limits
lib/ai/usage.tsTracks token usage and plan limits
hooks/use-ai-chat.tsClient hook for chat UI

Supported providers

ProviderRequired envDefault model as of March 19, 2026
OpenAIOPENAI_API_KEYgpt-4o
AnthropicANTHROPIC_API_KEYclaude-sonnet-4-20250514

Token limits by plan

PlanMonthly token limit
FREE0
BASIC10_000
PRO100_000
ULTIMATEUnlimited

AI request rate limits

PlanRequest limit
FREE10 requests per 5 minutes
BASIC20 requests per 5 minutes
PRO40 requests per 5 minutes
ULTIMATE80 requests per 5 minutes

How to disable AI

If your product does not need AI yet:
NEXT_PUBLIC_ENABLE_AI=false
This keeps the repository simpler to operate without deleting the AI files or routes.

AI tooling for developers

The repository also includes context files for several AI coding tools:
FileTool
AGENTS.mdGeneral agent guidance and repository workflow
CLAUDE.mdClaude Code
.github/copilot-instructions.mdGitHub Copilot
.cursorrulesCursor
.windsurfrulesWindsurf
These files exist to provide accurate context about the stack, structure, and working rules, so AI output is more relevant and less likely to suggest the wrong patterns.

When you should touch this area

  • you want to enable AI features for end users,
  • you want to change the default provider,
  • you want to adjust token limits by plan,
  • you want to update the instructions used by your team’s AI coding assistants.

When you can ignore this area

  • you do not need AI features in the product yet,
  • you are only changing branding, content, or marketing pages.
If you are focused on shipping the MVP quickly, AI can stay disabled at first. KilatKoding is still valuable even without turning the AI layer on.