Artisanal, machine-generated API libraries
summary
Stripe replaces eight years of hand‑maintained SDKs by generating libraries in seven programming languages using a TypeScript tool called api code gen that consumes OpenAPI and emits client code changelogs and examples. The team moves from fragile string templates to compiler‑style IRs, tagged unions and overrides to preserve human readability and backwards compatibility. The system handles real scale — one library sees 40 releases since January — and succeeds in shipping readable generated libraries and new typings without sweeping breaking changes.
AI-written summary · about
chapters (32)
- 0:00Introduction
- 1:45Stripes API
- 2:55Maintaining libraries manually
- 3:52Why we generated our libraries
- 6:31Demo
- 6:49Gouda
- 6:59Template approach
- 7:21Template example
- 8:03Advantages of templates
- 10:06Limitations of templates
- 10:42The compiler approach
- 11:50Converting a template into a compiler
- 13:25Example code
- 14:05Sequential logic
- 14:56Template string interpolation
- 15:20Template types
- 15:43Syntax
- 16:04Syntax Tree
- 17:20What do we gain
- 17:55Snapshot testing
- 18:35Transformations
- 19:03Data
- 21:41Case analysis
- 23:50Algebraic data types
- 24:11Example
- 26:01Artisanal
- 26:52overrides
- 27:33types of overrides
- 28:07conclusion
- 28:45web backend
- 29:34strangeloop
- 29:44contact information
related talks
32mHow we build APIs and Team at Stripe
32mBoutique machine generated gems
32mBuilding for Builders: Designing APIs for the Internet Economy
28mMaking Your Code Examples Shine
18mSimplifying Consuming APIs for SDK Haters
33mTypeScript for APIs
26mSupporting SDKs in seven different languages while maintaining sanity
45mType-Safe APIs - Syncing Back & Front End Types w/ Code Generation
