DocsBlogPricingPluginsDemo
Get Codapult

Build your SaaS. Launch your MVP.

Get Codapult

Product

  • Pricing
  • Architecture
  • Modules
  • AI platform
  • Plugins

Developers

  • MCP
  • CLI
  • Documentation
  • Launch your SaaS
  • Build a B2B SaaS

Resources

  • Blog
  • FAQ

Connect

  • Contact
  • GitHub

Compare

  • SaaS template comparison
  • Codapult vs Supastarter
  • Codapult vs Makerkit
  • Codapult vs ShipFast
  • Codapult vs SaaSBold
  • Codapult vs Gravity
  • Codapult vs Nextbase
  • Codapult vs BuilderKit

Featured on

Codapult on LaunchNestCodapult on LaunchNestbetterlaunch.cobetterlaunch.coFeatured on LaunchBuffFeatured on LaunchBuffCodapult on PeerPushCodapult on PeerPushFeatured on LaunchItFeatured on LaunchIt
© 2026 Codapult·All rights reserved·Privacy Policy·Terms of Service
Built-in AI · Team-ready SaaS · One-time purchase
All articles

Getting Started

  • Introduction
  • Quick Start
  • Your First 30 Minutes
  • Project Structure
  • License and Permitted Use
  • Starter Profiles and Recipes
  • Product Recipes

Configuration

  • Environment Variables
  • App Configuration
  • Which Modules Should I Enable?
  • Provider Matrix
  • Capability Coverage

Authentication

  • Authentication
  • OAuth Providers
  • Two-Factor & Passwordless
  • Enterprise SSO (SAML)

Database

  • Database
  • Database and Provider Guide
  • Database Migrations

Teams

  • Teams & Organizations
  • Permissions & RBAC
  • SCIM Provisioning

Deployment

  • Deployment
  • Enterprise E2E Evidence
  • Enterprise Production Readiness
  • Deployment, Backup, and Restore Runbook
  • Troubleshooting

Payments

  • Payments & Billing
  • Stripe Setup
  • LemonSqueezy Setup
  • Polar Setup
  • Payment Webhooks

Api

  • API Layer
  • tRPC
  • GraphQL

Ai

  • AI Features
  • AI Runtime Architecture and Evals
  • Streaming Chat
  • RAG and Semantic Search
  • Quotas and Memory

Email

  • Email
  • Email Templates

Infrastructure

  • Infrastructure
  • Self-Hosting
  • File Storage
  • Docker
  • Background Jobs
  • Terraform & Pulumi
  • Kubernetes

Ui

  • UI & Theming

I18n

  • Internationalization

Content Management

  • Content Management

Admin

  • Admin Panel

Security

  • Security
  • Data Retention Policy

Monitoring

  • Analytics & Monitoring

Modules

  • Module Architecture
  • Waitlist
  • Welcome Page
  • Audit Log
  • White-Labeling
  • Workflow Automation
  • A/B Testing
  • Referrals
  • GDPR Export and Deletion
  • Promotions
  • Outgoing Webhooks

Plugins

  • Product plugins
  • CRM Plugin
  • Helpdesk Plugin
  • Email Marketing Plugin

Upgrading

  • Upgrading Codapult

Developer Tools

  • AI Agents & IDEs
  • MCP Server
  • Testing
  • Build Your First Feature with Codapult MCP
  • Architecture Guardrails for AI Coding Agents
Ai

Quotas and Memory

Persist AI conversations and control AI usage per organization.

Codapult's AI layer includes two production controls that most demos skip: persistent chat history and usage limits. They are designed for SaaS products where AI usage has real infrastructure cost.

Conversation memory

Conversation history is stored in two tables:

TablePurpose
ai_chat_conversationConversation metadata: owner, title, timestamps
ai_chat_messageIndividual messages with role and content

The conversation service exposes list, create, update-title, delete, read messages, and save message helpers.

API routes

RouteMethodPurpose
/api/ai/chat/conversationsGETList conversations
/api/ai/chat/conversationsPOSTCreate a conversation
/api/ai/chat/conversationsDELETEDelete a conversation
/api/ai/chat/conversations/[id]/messagesGETRead messages

Quotas

AI requests are checked against the organization aiChat quota before model work starts. The default limits and their time windows are defined in the plan quota configuration; the same access check is used by the chat, gateway, and batch API entry points. This request quota is separate from token-cost analytics and the optional daily or monthly spend budgets in the AI gateway.

When a request is allowed, token usage, provider cost, latency, and request status are recorded by the AI metering layer. This keeps cost analytics and budget checks on the same gateway path instead of hiding them inside a one-off chat counter.

Rate limiting

POST /api/ai/chat also applies a per-user request rate limit before the provider call. This protects you from accidental loops, scripted abuse, and runaway UI retries.

Product customization

Common changes:

  • Increase or reduce the aiChat request quota per plan.
  • Add per-organization override controls in the admin panel.
  • Configure daily or monthly AI spend budgets when cost ceilings are required.
  • Disable conversation persistence for privacy-sensitive products.

Related docs

  • Payments & Billing
  • Streaming Chat
  • RAG and Semantic Search
RAG and Semantic SearchEmail