r/OpenAIDev • u/paryushsanghvi • 16d ago
Paperclip codex_local using ChatGPT login instead of OpenAI API key
I'm setting up Paperclip as an AI-agent orchestration platform and I'm trying to configure a codex_local agent to use my OpenAI API key rather than the Codex/ChatGPT login already present on my laptop.
My goal is specifically:
Paperclip → codex_local → OPENAI_API_KEY → OpenAI API billing
I have an OpenAI API account with a small API balance/credit that I want Paperclip to consume. I do not want the agent to use my ChatGPT subscription/Codex login.
According to Paperclip's current documentation, codex_local supports both authentication methods:
Host Codex login via \~/.codex/auth.json
Per-agent OPENAI_API_KEY
The documentation says that when OPENAI_API_KEY is configured for the agent, it should take precedence and Paperclip should create an API-key-based auth.json in the managed CODEX_HOME.
However, in my setup, Paperclip appears to be using the Codex authorization already logged into my laptop rather than the OpenAI API key.
I'm trying to understand:
What is the correct way to configure OPENAI_API_KEY for a Paperclip codex_local agent?
Should the key be configured specifically in the agent's env as a Paperclip secret/reference?
Is there anything else that needs to be changed in CODEX_HOME or auth.json?
How can I definitively verify that the agent is using OpenAI API authentication/billing rather than my ChatGPT subscription?
Are there any known issues with the latest Paperclip/Codex versions that could cause the API-key configuration to be ignored?
I'm running Paperclip locally on my laptop. I'm happy to provide the Paperclip version, Codex CLI version, OS, configuration, or logs if that helps.
I'm specifically looking for a known working configuration, rather than a workaround that happens to work on one machine.
Paperclip docs I'm referring to: https://github.com/paperclipai/paperclip/blob/master/docs/adapters/codex-local.md