NEED HELP: Adding SSH key to contain API

Below is an example of a config file for a container-creating script. The config below works, except for the ssh option. Is it possible to add the ssh key, if so, how? Thanks in advance!

proxmox.nodes(node_name).lxc.create(
hostname=CTName,
vmid=ctid,
ostemplate=template_name,
memory=512,
cores=cores,
swap=512,
onboot=1,
password=root_password,
nameserver = IP,
rootfs=‘local-lvm:8’,
ssh_public_keys=pubkey, <---------

**network_settings
)

What type of script? What does the script look like?

It’s written in Python. The script works and it creates the container, however, i just wanted to see if someone knows a way to add it. From my reddit post it looks like it can only be done in the post creation stage by editing it with nano.