You can open a shell with a shellscript and let it do some magic. I am doin that with a pane splitted tmux session. This way I can run 9 codex cli instances in one window. So 27 on three screens which already is way too much for my usecases.
I mean in that setup I would say you should be able to start the session → take it from OPENAI_API_KEY → write it to their prefered method → do the tasks → remove their perefered method…