Parameters for buy order on BTC-E
Problem solved. The error is caused by too many decimal places in the rate parameter. It would be good if the API returned a more informative error message though.

There is an API call to find the correct maximum number of places, as well as the minimum order for each currency pair. https://btc-e.com/api/3/info returns a list of currencies and information. The documentation is in Russian but translates easily with Google Translate.