Microsoft has officially released (some time ago) a tool to download and create your own Windows 8.1 installation media. The tool will request your language, architecture and edition, and how you want to create the media (as an USB stick, or as an ISO file for burning to a DVD). It will then download the necessary files and create your installation media.
The created media will accept all Windows 8.1 OEM, Retail Full, and Retail Upgrade keys. (For Windows 8, see here.)
You can download the tool here: http://windows.microsoft.com/en-us/windows-8/create-reset-refresh-media.