The generation of X-rays and γ-rays based on synchrotron radiation from free electrons, emitted in magnet arrays such as undulators, forms the basis of much of modern X-ray science. This approach has the drawback of requiring very high energy, up to the multi-GeV-scale, electron beams, to obtain the required photon energy. Due to the limit in accelerating gradients in conventional particle accelerators, reaching high energy typically demands use of instruments exceeding 100's of meters in length. Compact, less costly, monochromatic X-ray sources based on very high field acceleration and very short period undulators, however, may enable diverse, paradigm-changing X-ray applications ranging from novel X-ray therapy techniques to active interrogation of sensitive materials, by making them accessible in energy reach, cost and size. Such compactness and enhanced energy reach may be obtained by an all-optical approach, which employs a laser-driven high gradient accelerator based on inverse free electron laser (IFEL), followed by a collision point for inverse Compton scattering (ICS), a scheme where a laser is used to provide undulator fields. We present an experimental proof-of-principle of this approach, where a TW-class CO2 laser pulse is split in two, with half used to accelerate a high quality electron beam up to 84 MeV through the IFEL interaction, and the other half acts as an electromagnetic undulator to generate up to 13 keV X-rays via ICS. These results demonstrate the feasibility of this scheme, which can be joined with other techniques such as laser recirculation to yield very compact photon sources, with both high peak and average brilliance, and with energies extending from the keV to MeV scale. Further, use of the IFEL acceleration with the ICS interaction produces a train of high intensity X-ray pulses, thus enabling a unique tool synchronized with a laser pulse for ultra-fast strobe, pump-probe experimental scenarios.