I haven't done this so YMMV, but I'm assuming you're having the keyboard sequencer play music given your explanation. The project's tempo is what you see in the tempo indicator at the top of the command bar. There isn't a secret place to grab the tempo that will somehow be different than the project tempo that I know of. There is a way, however, to have Sonar synchronize to the keyboard's internal clock. Check out Synchronization in the help docs. Here's a snippet of the Help doc that may apply to you. I hope this helps get you going.
MIDI Sync
MIDI Sync is not the same as MIDI Time Code. MIDI Sync is a type of synchronization that is usually used to synchronize drum machines, desk top hardware sequencers, and internal sequencers that are in keyboards. The MIDI Sync format uses a timing resolution of 24 Parts Per Quarter Note and Song Position Pointer messages. When using MIDI Sync one of the units must be designated as the clock source.
Options | Project | Clock
Set the clock source to MIDI Sync.
Follow the directions from your drum machine or hardware sequencer to have it transmit MIDI Sync. When you start Playback on Cakewalk, a MIDI Sync dialog box will indicate that Cakewalk is waiting for MIDI Sync. Then start your drum machine or external sequencer and Cakewalk will begin to play.