Oh no :( Sorry to hear your little buddy isn't feeling too great. Hopefully your vet will do X-rays to see if there is something broken.
I would probably put him in a bonding pouch, keep him close and try to comfort him and keep him hydrated with his favorite juicy fruits or some treats. You don't want him to injure himself further climbing around if it is a break. Keep a close eye on him so you can intervene if he's in pain and tries to chew the pain away.
It's hard to speculate on what happened, but be sure to check the cage over well to see if there's anything that he could've injured himself on (loose threads in bedding, any sharp edges or tight places he could've pinched a toe then struggled to free himself from, etc). You can take a cotton ball and rub it all over the cage, anything that is sharp will snag.
Let us know how the vet trip goes, please!