How to use Site API to create short url?

Recently there was one requirement for one customer. where we have to post data to twitter application. but twitter when submitting comments on twittter, twitter having limitation that it has only 140 characters to be posted for status. out of that customer wants to post their blog’s url as well.