I remember figuring this out when I needed to buy a new key for my Audi and the dealer wanted $200 to program it.
https://www.audiworld.com/forums/a8-s8-d2-platform-discussio...
the software's available online, all you need to do is get access to the OBD port and you can make your car trust a new key!