Amazon is keeping its city options open and in the future could even buy the West 34th Street building it is now leasing.

The online retailer is setting up a distribution hub near Fifth Avenue between 34th and 35th streets and has a 470,000-square-foot lease with Vornado Realty Trust.

According to a deal memo we reviewed, Amazon has certain rights to buy the building or portions of it, which sources say would only occur if Vornado decides to sell the building.

“It reflects the amount of investment that Amazon wants to do in the space,” said Alexander Goldfarb, an analyst with Sandler O’Neill + Partners who was unaware of the purchase possibility.

Goldfarb said any effect on Vornado’s valuation will be minimal as it is “such a small part of Vornado” but of course, “would depend on the terms of the agreement.”

Along with the ability to absorb more space on the ground and concourse of the building, the long-term lease provides Amazon with three five-year lease options, which could bring its occupancy out to the middle of 2047.

Speaking on a February conference call, David Greenbaum, Vornado’s New York division president, said, “ … the deal encompasses office, retail and fulfillment center components throughout the 12-story building.”

Vornado declined comment through a spokeswoman. Amazon did not respond to a request for comment.