Unfortunately, no known workflow exists for overlaying element ID with the image exposed from Revit in APS.
Alternatively, you can add a Text annotation showing the element ID to overlay on the element in 2D views(e.g., Floor Plan Views), or Sheets, and then export the views or sheets into the image, which is pure Revit Desktop use. e.g. https://www.youtube.com/watch?v=w2-h2ACxYLc
It's irrelevant to the APS API.