Optimum drilling mud window provides a workable downhole mud pressure range to prevent formation fluid influx, borehole instabilities, and fluid loss into the formation while drilling, and this can be achieved by a comprehensive geomechanical modeling using well data. We have integrated the wireline logs, drilling data, and measured downhole data to assess the vertical stress, pore pressure, minimum horizontal stress, and shear failure (SF) gradient of the 3400 m thick Mesozoic and Paleozoic succession in the Ourhoud field, Berkine Basin. We have interpreted the hydrocarbon pressure gradient in the Triassic Argilo-Greseux Inferieur reservoir as 0.32 psi/ft and found the overburden shales to be hydrostatically pressured (0.46 psi/ft). Poisson’s ratio-based minimum horizontal stress has a 0.73–0.80 psi/ft gradient, whereas frictional faulting theory provides a lower limit of 0.66 psi/ft. We have observed massive wash outs in the caliper logs against the Cretaceous shales, which is more prone to compressive failures. To address this wellbore failure, we have modeled SF gradient by Mohr-Coulomb rock failure criteria and compared the results with the mud pressure used in drilling. We have inferred that at least 10.5 ppg drilling mud weight is required to prevent such wellbore instabilities in the Mesozoic shales, whereas the minimum allowable mud weight for the Carboniferous shale is 10 ppg. Based on the interpreted pressure gradients, we have recommended an optimum downhole drilling window for the Ourhoud field, which will be helpful to deliver stable wellbores in future drilling campaigns.