We report first-principles calculations of the inelastic current-voltage (I-V) characteristics of a gold point contact and a molecular junction in the nonresonant regime. Discontinuities in the I-V curves appear in correspondence to the normal modes of the structures. Due to the quasi-one-dimensional nature of these systems, specific modes with large longitudinal components dominate the inelastic I-V curves. In the case of the gold point contact, our results are in good agreement with recent experimental data. For the molecular junction, we find that the inelastic I-V curves are quite sensitive to the structure of the contact between the molecule and the electrodes, thus providing a powerful tool to extract the bonding geometry in molecular wires.