It sounds to me likely that it's something he ate. Ducks are hardy and he may recover on his own. If he's swallowed a nail or other piece of hardware, it might require surgery, but it's more likely he got into moldy feed or similar. Make sure he has fresh food and water and give him time. I hope he'll come around for you! Of course, if you have the resources, a vet visit rarely goes amiss.