Context : Transition disks are recognized by the absence of emission of small dust grains inside a radius of up to several 10s of AUs . Due to the lack of angular resolution and sensitivity , the gas content of such dust holes has not yet been determined , but is of importance to constrain the mechanism leading to the dust holes . Transition disks are thought to currently undergo the process of dispersal , setting an end to the giant planet formation process . Aims : We present new high-resolution observations with the Atacama Large Millimeter/submillimeter Array ( ALMA ) of gas lines towards the transition disk Oph IRS 48 previously shown to host a large dust trap . ALMA has detected the J = 6 - 5 line of ^ { 12 } CO and C ^ { 17 } O around 690 GHz ( 434 \mu m ) at a resolution of \sim 0.25 ^ { \prime \prime } corresponding to \sim 30 AU ( FWHM ) . The observed gas lines are used to set constraints on the gas surface density profile . Methods : New models of the physical-chemical structure of gas and dust in Oph IRS 48 are developed to reproduce the CO line emission together with the spectral energy distribution ( SED ) and the VLT-VISIR 18.7 \mu m dust continuum images . Integrated intensity cuts and the total spectrum from models having different trial gas surface density profiles are compared to observations . The main parameters varied are the drop of gas surface density inside the dust free cavity with a radius of 60 AU and inside the gas depleted innermost 20 AU . Using the derived surface density profiles , predictions for other CO isotopologues are made , which can be tested by future ALMA observations of the object . Results : From the ALMA data we find a total gas mass of the disk of 1.4 \times 10 ^ { -4 } M _ { \odot } . This gas mass yields a gas-to-dust ratio of \sim 10 , but with considerable uncertainty . Inside 60 AU , the gas surface density drops by a factor of \sim 12 for an assumed surface density slope of \gamma = 1 ( \Sigma \propto r ^ { - \gamma } ) . Inside 20 AU , the gas surface density drops by a factor of at least 110 . The drops are measured relative to the extrapolation to small radii of the surface density law at radii > 60 AU . The inner radius of the gas disk at 20 AU can be constrained to better than \pm 5 AU . Conclusions : The derived gas surface density profile points to the clearing of the cavity by one or more massive planet/companion rather than just photoevaporation or grain-growth .