I am having an upper GI endoscopy in 10 hrs. Can I have a cup of coffee?

Yes. Generally, most endoscopists prefer the stomach to be empty at least 2 hours prior to conscious sedation for endoscopy. Nothing by mouth after midnight the night before a 0730 procedure, is routine as well, especially for any general anesthesia procedure.