We present a system consisting of a microfluidic device made of gas-permeable polydimethylsiloxane (PDMS) with two layers of microchannels and a computer-controlled multi-channel gas mixer. Concentrations of oxygen in the liquid-filled flow channels of the device are imposed by flowing gas mixtures with desired oxygen concentrations through gas channels directly above the flow channels. Oxygen gradients with different linear, exponential, and non-monotonic shapes are generated in the same liquid-filled microchannel and reconfigured in real time. The system can be used to study directed migration of cells and the development of cell and tissue cultures under gradients of oxygen.