You can have 5 master keys with remote locking and 3 sub keys (valet keys) at the same time. You cannot do the immobilizer programming with a sub key, you must have a master in the ignition.
1) Install TIS Techstream software on laptop running windows XP operating system. Here is the video instruction for newest V10.00.028 Techstream software.
Or search rav4world forum to obtain some tutorial on install it on win7/win 8 machine.
2) Plug the Toyota Techstream OBD diagnostic interface into the vehicle’s OBD II port and the other end into the laptop via USB port.
3) Turn vehicle ignition switch to ON position with engine off. Click “Connect to vehicle” and wait a few seconds until the system will pops out the connection are well built note.
4) Select “System selection menu”>> “Main Body” >> “Utility” >> “Wireless code registration”, then accept the “Wireless Code Registration Wizard” prompt.
5) Follow the screen prompts until the process complete. Click “Next” to add another key or “Exit” to finish.
6) Then move to program the immobilizer chip to enable to start the engine. Select “System selection menu” >> “Immobiliser”>> “Immobiliser Live”>> “Utility”>> “Wireless code registration”
7) Accept another wizard to turn the ignition switch off. Back on and click “Next”.
8) Turn it back off and remove the master key. Insert the new flip key without turning it. Click “Next”. The security light start illuminating after the timer on the screen counted down from about 90 minutes while ECU learned the new key code.
9) When the timer on the screen counts down to 0, the system prompts “Programming complete” message. Click “Next” to program another key or “Exit” to finish.
10) Start the engine, lock the door and test the new keys.