Reconstructive optoelectronic spectroscopy has generated substantial interest in the miniaturization of traditional spectroscopic tools, such as spectrometers. However, most state-of-the-art demonstrations face fundamental limits of rank deficiency in the photoresponse matrix. In this work, we demonstrate a miniaturized spectral sensing system using an electrically tunable compact optoelectronic interface, which generates distinguishable photoresponses from various input spectra, enabling accurate spectral identification with a device footprint of 5 micrometers by 5 micrometers. We report narrow-band spectral sensing with peak accuracies of ∼0.19 nanometers in free space and ∼2.45 nanometers on-chip. In addition, we implement broadband complex spectral sensing for material identification, applicable to organic dyes, metals, semiconductors, and dielectrics. This work advances high-performance, miniaturized optical spectroscopy for both free-space and on-chip applications, offering cost-effective solutions, broad applicability, and scalable manufacturing.