As a licensed developer, you can download versions of Xcode at the Downloads for Apple Developers page.
You need Xcode 6.1 to develop with the iOS 8.1 SDK. Xcode 6.1 requires Mac OS X 10.9.4 (Mavericks) or later according to the App Store. The aforementioned Downloads page confirms that it requires Mavericks or Yosemite.
If you want to develop using the iOS 8.0 SDK, you need Xcode 6.0 or later. It requires Mavericks, too.
You can use Xcode 5.1 on Mountain Lion or Mavericks, but you can only develop against the iOS 7.1 SDK (and no Swift).
By the way, effective February 15th, 2015, you cannot submit apps to the store that were developed using an SDK prior to iOS 8 (i.e. you must use Xcode 6.0 or later by that point):
64-bit and iOS 8 Requirements for App Updates
December 17, 2014
As we announced in October, beginning on February 1, 2015 new iOS apps submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK. Beginning June 1, 2015 app updates will also need to follow the same requirements. To enable 64-bit in your project, we recommend using the default Xcode build setting of “Standard architectures” to build a single binary with both 32-bit and 64-bit code.
See the relevant developer announcement on the News and Updates page.
So you may want to go ahead and update in anticipation of that.