Need help with twirp?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

4.6K Stars 230 Forks Other 469 Commits 6 Opened issues


A simple RPC framework with protobuf service definitions

Services available


Need anything else?

Contributors list

Twirp Logo Build Status Go Report Card GoDoc

Twirp is a framework for service-to-service communication emphasizing simplicity and minimalism. It generates routing and serialization from API definition files and lets you focus on your application's logic instead of thinking about folderol like HTTP methods and paths and JSON.

Define your service in a Protobuf file and then Twirp autogenerates Go code with a server interface and fully functional clients. It's similar to gRPC, but without the custom HTTP server and transport implementations: it runs on the standard library's extremely-well-tested-and-high-performance

Server. It can run on HTTP 1.1, not just http/2, and supports JSON clients for easy integrations across languages

Twirp handles routing and serialization for you in a well-tested, standardized, thoughtful way so you don't have to. Serialization and deserialization code is error-prone and tricky, and you shouldn't be wasting your time deciding whether it should be "POST /friends/:id/new" or "POST /:id/friend" or whatever. Just get to the real work of building services!

Along the way, you get an autogenerated client and a simple, smart framework for passing error messages. Nice!

For more on the motivation behind Twirp (and a comparison to REST APIs and gRPC), the announcement blog post is a good read.



go get
to install the Go client-and-server generator:
go get

You will also need: - protoc, the protobuf compiler. You need version 3+. -, the Go protobuf generator plugin. Get this with

go get


On the website:

Source for this documentation is in the docs subdirectory. The website is generated from that folder using Docusaurus.

Implementations in other languages

This repo only has the official generators, which write out Go and Python (partial, see #185 and #220) code.

For other languages, there are third-party generators available:

| Language | Clients | Servers | Repository | |----------------|---------|---------|------------| | Python3 | ✓ | ✓ | | Java | ✓ | ✓ | | Java | | ✓ | | JavaScript | ✓ | | | JavaScript | ✓ | | | Typescript | ✓ | | | Ruby | ✓ | ✓ | | Rust | ✓ | ✓ | | Scala | ✓ | ✓ | | Swagger | ✓ | ✓ | | PHP | ✓ | ✓ | | Dart | ✓ | | | Elixir | ✓ | ✓ |

This list isn't an endorsement, it's just a convenience to help you find stuff for your language.

Support and Community

We have a channel on the Gophers slack, #twirp, which is the best place to get quick answers to your questions. You can join the Gopher slack here.


Twirp follows semantic versioning through git tags, and uses Github Releases for release notes and upgrade guides: Twirp Releases


Check out for notes on making contributions.


This library is licensed under the Apache 2.0 License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.