The Gravitational wave high-energy Electromagnetic Counterpart All-sky Monitor (GECAM) project is the planned Chinese space telescope for detecting the X and gamma-ray counterpart. It consists of two micro-satellites in low earth orbit with the advantages of instantaneous full-sky coverage, low energy threshold down to 6 keV and can be achieved within a short period and small budget. Due to the limitation of size, weight and power consumption of micro-satellites, silicon photomultipliers (SiPMs) are used to replace the photomultiplier tubes (PMTs) to assemble a novel gamma-ray detector. A prototype of a SiPM array with LaBr3 crystal is built and tested, and it shows a high detection efficiency (70% at 5.9 keV) and an acceptable uniformity. The low-energy X-ray of 5.9 keV can be detected by a simply readout circuit, and the energy resolution is 6.5% (FWHM) at 662 keV. The design and performance of the detector are discussed in detail in this paper.