As part of an experiment to measure the spectrum of photons emitted in beta-decay of the free neutron, we developed and operated a detector consisting of 12 bismuth germanate (BGO) crystals coupled to avalanche photodiodes (APDs). The detector was operated near liquid nitrogen temperature in the bore of a superconducting magnet and registered photons with energies from 5 keV to 1000 keV. To enlarge the detection range, we also directly detected soft X-rays with energies between 0.2 keV and 20 keV with three large area APDs. The construction and operation of the detector is presented, as well as information on operation of APDs at cryogenic temperatures.