Germany didn't declare war on the US in world war 1. It was the US that declared war on Germany on April 6th 1917 as a result of the unrestricted submarine war introduced by Germany in January that year. - I Warner
Initially, the US was to remain neutral in World War I but in 1917 Germany attempted to form and alliance with Mexico. Also, Germany began sinking US ships. These events led the US to declare war on April 6, 1917.