I built a production Go boilerplate for AI SaaS backends – multi-tenant, LLM-agnostic, Stripe + AWS (Go 1.26)

I've been CTO at an AI startup for the past year and kept rebuilding the same backend scaffolding from scratch every time — multi-tenant auth, LLM wiring, usage tracking, billing, infra.

So I packaged all of it into a proper Go boilerplate: go-ai-saas-starter.

What's in it:

- Multi-tenant auth — JWT + API keys, single middleware, bcrypt, refresh tokens

- LLM abstraction layer — clean Provider interface over OpenAI, Anthropic, Gemini. Swap via config, not code changes. Streaming on all three.

- Per-tenant usage tracking — every call logged with tokens, cost, latency, model. Daily rollups.

- Rate limiting — Redis sliding window per plan (free/pro/enterprise), X-RateLimit-* headers

- Stripe billing — checkout, customer portal, full webhook lifecycle

- Outbound webhooks — enterprise tier, HMAC-signed, Asynq delivery with retry

- OpenAI-compatible endpoint — /v1/chat/completions so existing clients just change base URL

- Admin API — tenant management, platform usage, health checks

- AWS deploy — ECS Fargate + RDS + ElastiCache + ALB via Terraform. SSM secrets, security groups, ECR all included.

- OpenTelemetry + zerolog

- 70%+ test coverage (unit, httptest, dockertest)

Stack: Go 1.26, Chi, PostgreSQL + sqlc (no ORM), Redis 7, Asynq, Stripe, Terraform.

Deliberate choices I'm happy to discuss:

- sqlc over an ORM — type-safe, explicit, no magic

- Chi over Gin/Echo — stdlib-compatible, minimal

- Asynq over a full message queue — Redis is already there for rate limits, no extra infra

- No frontend — this is backend only, intentionally

$99 (full source, MIT license) or $149 with a 30-min onboarding call.

https://shubhamster5723.gumroad.com/l/go-ai-saas-starter

Happy to answer questions about any of the design decisions.

Posted Apr 7, 2026, 11:22 AM UTC

010
Loading comments…