Are you looking for a better approach to federated chat than #Matrix or #XMPP? I'm working on #Chatterbox, a simple, straightforward federated chat protocol that, ideally, will be more user-friendly (and developer-friendly) than either.
https://adam.nels.onl/blog/chatterbox-federated-chat-that-doesnt-suck/
The blog post links to a gist with the full API specification, in a single well-commented Protobuf file.
I'm working on a reference server that should be available soon. Follow the hashtag if you're interested in updates.