http4k models HTTP as pure Kotlin functions for routing, clients, testing, and integrations. Modules cover servers, cloud connectors, AI adapters, and enterprise add-ons.
Overview
http4k is a Kotlin HTTP toolkit where applications are functions from Request to Response, optionally wrapped by composable filters. The core stays small while add-on modules supply servers, clients, formats, security, templating, WebSockets, and serverless adapters.
Because handlers are plain functions, tests can invoke application logic in memory without starting sockets—a default property rather than a bolt-on test harness. Apps can mount into Jetty, Netty, Servlet containers, AWS Lambda, and other backends, or compile to GraalVM native binaries.
http4k-connect provides typed clients and fakes for cloud and SaaS APIs. http4k-ai adds LLM provider adapters, LangChain4J integration, and agent-oriented helpers with in-memory fakes. Commercial http4k-pro and http4k-enterprise modules add Wiretap tracing, WebAuthn, MCP, hot reload, long-term support, and supply-chain verification tooling.
Artifacts publish to Maven Central and a project Maven repository on a regular release cadence. The ecosystem lists hundreds of integration modules for AWS, GCP, Azure, Kafka, OpenTelemetry, OAuth, and related stacks.
The design favors uniform composition: routing, authentication, and outbound calls all use the same functional patterns, contrasting with heavier annotation-driven frameworks.
Key features
- Request-to-Response function model
- Composable filter middleware
- In-memory HTTP testing
- Multiple server and client backends
- Cloud API client modules
- LLM and agent adapters
- GraalVM native compilation
- OpenAPI and security modules
Use cases
- Kotlin microservices and APIs
- Serverless HTTP handlers
- Contract-style unit testing
- Cloud-integrated backend services
- LLM-backed agent tooling