If you have a valid US visa in your passport (either F1 or H1B), you can transit in Frankfurt as long as you can stay airside (in particular: [the layover must be under 12 hours and your luggage must be checked through](http://www.germany.info/Vertretung/usa/en/05__Legal/02__Directory__Services/01__Visa/__Transit__Visa.html), at least to the next destination). I don't think the niceties of your status in the US (“OPT cap gap”, I-20, etc.) matter at all, as far as the German authorities are concerned. If you are in doubt, you could ask your airline as they will be the one to check your visa status first, even before boarding the plane in the US.