This happened to my cat once and what you need to do is make him very relaxed, you might lie him down in his bed and pat him then slowly pick small bits at a time and let him sniff them if he refuses thentry something different like you might mash up some corn and carrot with meat and just experiment around! Hope this works!
Hi and welcome to the Forum.
From what you are describing, I am not seeing anything obvious jumping out, yet.
He may just be off his food or it could be due to teething. Give the inside of his mouth a good going over, including the underside. Make sure there are no irritated areas. You may want to use a small flashlight. If you get that far, try to see the back of his throat, check for redness, etc. feel the glands under his jaws to make sure nothing is swollen. This may produce no findings,mood thing, but a good place to start.
I assume he is up on his shots. Has he been wormed? Not unusual for a pup to have parasites and you might want to take a fresh stool,sample in to your Vet to be checked and get a wormer, if necessary. A lot of Vets will do this without having to make an appt.
I am not familiar with the food you feed. You can try a few things. Withhold the treats and use praise instead. Do not feed him anything extra except the things he chews on. You can try adding a bit of warm water to his food. You can try adding a bit of a good canned dog food to his food. You can try changing foods but gradually by buying a small bag of a new food and mixing half and half with what he eats now. How often is he fed? That age should be 2-3 times a day. Are his food bowls put down at mealtime or do you let him free feed? Try putting his food down, wait 15 -20 mins. If he has not eaten it, pick it up and do not feed him until he would get his next meal. Do the same thing. If he is not sick, he will eventually get hungry enough to eat. I have never seen a healthy dog starve themselves. If he is drinking water, is active and no other signs of illness, I would try this.
Of course, you know your dog. If he acts sick, vomits or has diarrhea, off to the Vet.
Good luck and please come back to update.