I failed to find any official docs if OpenStreetMap provide any API for directions. Maybe there is some other free service for this task?
There is nothing provided directly by the OpenStreetMap project, but there are other options provided using OpenSteeetMap data such as the MapQuest Open Directions API Service.