Three systems in a key, one is the cut blade, second is the transponder chip, a small coffin shaped chip that is inside the fob, this has no power requirement and is read by the loop aerial around the ignition barrel when the key is inserted into the ignition barrel. It tells the EWS module to release the starter to allow the car to be started. It also receives a rolling code from the car that it will use next time the key is used. The transponder will be required to be coded to the car when a new key is generated. The third system in the key is the central locking functions and this is powered by the battery on the internal fob pcb. Original keys were fitted with rechargeable batteries that got charged via the loop aerial around the ignition barrel when the key was in use. Chinese replacement keys on ebay come with non rechargeable button batteries and of course an uncoded transponder and blank key blade.
If you go that route then you have to find someone to code the transponder to your car and cut the blade.
Once you have that done then the central locking part of the key has to be synced to the car, all keys you have must to be synced one after the other so they both operate the same, no time delays between syncing.
You could try getting a key from BMW but likely only to be able to get a dumb key without central locking functions, circa £130 last time I saw.
Other option would be a mobile locksmith who could supply a cut and coded key for your car, again circa £130 last time I looked.
There are key companies on ebay that offer replacement keys but it often involves having to send them your EWS module and your key for them to make a new key.
Useful info on syncing keys here in this old post
https://zroadster.org/threads/programming-your-bmw-z3-key-fob.11492/#post-897519