A prototype 1mm thick CdTe detector bonded to a Timepix chip with 256*256 pixels at 55 μ m pitch was evaluated for use as a photon-counting imaging detector at high energy synchrotron beamlines (energy range 30-100 keV). A complete characterization of the system was performed. Powder diffraction experiments have also been conducted using a monochromatic beam at the ESRF. The expected gain in efficiency at energies above 30 keV with reference to silicon pixel detectors and current CCD systems of similar pixel size was demonstrated, together with an improved spatial resolution. Background-free powder diffraction spectra were obtained using the Timepix energy thresholding feature. The energy-resolved detection capabilities are limited by a strong charge sharing. The major limitations preventing a wider use of these devices at synchrotron X-ray sources are the lack of homogeneity of the CdTe crystal which exhibits numerous defects, and the unavailability of large fields of view.