Must have been very scary for you! Did he scream for a long time before he settled? Mine has howled in her sleep and woken up confused, but never screamed. Did you see him when he was doing it? Just asking because if he licked or bit at himself that could give a hint at where the pain was or if he was fully "there" and awake.
I hope it was a one time thing, like suggested. Sometimes that happens. My dog has had a strange pain reaction or two in her life that I could never explain. Hope you don't have to experience it again! Good call getting him checked at the vets!
Did the vet explain why he gave antibiotics? With the resistance problems of today antibiotics should not be used without any indication, so that was an odd choice. Not something you need to worry about now of course, just important for us all to be aware of and ask vets and doctors about if they don't provide a reason for using antibiotics.