I'm still in the process of writing API docs[1], but I did write a pretty thorough example client[2] that demonstrates how to talk to ycmd. It echos out all the chatter between the client and server and even pretty-prints and syntax-highlights the requests and responses. It should be pretty easy to understand how things work.