The API spec is available here: https://github.com/github/git-lfs/blob/master/docs/api.md
There's a reference implementation here: https://github.com/github/lfs-test-server