chi is a small, fast, and composable HTTP router for Go. Built on a Patricia Radix trie, it is 100% compatible with the standardDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/go-chi/chi/llms.txt
Use this file to discover all available pages before exploring further.
net/http library and ships with zero external dependencies. Whether you’re building a small microservice or a large REST API, chi scales with your project.
Quickstart
Build your first chi HTTP service in under five minutes with a working example.
Installation
Add chi to your Go project using go get and go modules.
Routing Overview
Learn how chi’s radix trie router works, URL patterns, and route groups.
Middleware
Explore chi’s composable middleware stack and 25+ built-in handlers.
Why chi?
chi was designed to make large REST API services maintainable as they grow. It brings together the best of the Go standard library with a clean, expressive routing API.Zero Dependencies
Only the Go standard library — no external packages, no version conflicts.
net/http Compatible
Any middleware or handler compatible with
net/http works with chi out of the box.Composable
Build modular services with route groups, sub-routers, and middleware stacks.
Context-Aware
URL parameters and request-scoped values flow through Go’s
context.Context.Fast
Patricia Radix trie routing with minimal allocations per request.
Production-Ready
In use at Cloudflare, Heroku, 99Designs, and many others.
Get started in three steps
Explore the docs
Core Concepts
Understand URL patterns, named parameters, wildcards, and route matching.
Built-in Middleware
Logger, Recoverer, RequestID, Timeout, Compress, and 20+ more handlers.
REST API Guide
Build a complete REST API with sub-routers, middleware, and context values.
API Reference
Full reference for the Router interface, Mux, and all public functions.
Ecosystem
CORS, JWT auth, rate limiting, host routing, and more from the go-chi org.
Testing
Test chi handlers and middleware with Go’s standard testing package.