Looking at the GitHub API reference at http://develop.github.com/p/repo.html, I see all sorts of good stuff, but I don\'t see any way to rename a repository through the API.
Adding additional notes to what braitsch said already,
If you are trying to rename a repository under an organization, add these variables:
myToken='XXXX_Your_Personal_Access_Token_XXXX'
myOrg="MyGithubOrg"
newName='{"name": "NewNameForRepo"}'
oldName="MyRepo"
And, make a curl request like this:
curl -H 'Authorization: token $myToken' -X PATCH -d "$newName" https://api.github.com/repos/$myOrg/$oldName