Skip to main content
Use a separate image skill: Codex keeps handling conversations with your existing official account, while the skill calls the image endpoint with your BetterToken API Key and saves the result locally. Image requests are billed at BetterToken’s current prices. This guide uses the community project Wangnov/gpt-image-2-skill. Its independent OpenAI-compatible image configuration lets you keep your Codex chat model and sign-in files. After setup, request images and edits in natural language.

Prepare Codex and an API Key

  1. Sign in with your official account in the local Codex App or Codex CLI and open a project.
  2. Create a BetterToken API Key or use an existing key.
  3. Check the image model and current pricing in the model plaza. Start with gpt-image-2.
Codex must be able to run local scripts and reach bettertoken.ai. This workflow is for the local App and CLI; cloud tasks need their own runtime and credentials.

Step 1: send the setup prompt to Codex

Copy the whole prompt below. It contains a placeholder, so you do not need to share a real key.
If Node.js is missing, follow Codex’s instructions to install Node.js LTS. The wrapper normally downloads the released runtime for your system.

Step 2: fill in the key locally

Open the config file that Codex reports. Replace the placeholder in credentials.api_key.value with your BetterToken API Key. For a custom CODEX_HOME, use the absolute path Codex reports. This image configuration is separate from your Codex sign-in file. A new configuration looks like this. When a file already exists, edit only the relevant entry:
Keep the file private and outside project repositories and screenshots. providers is a configuration field of the community tool.

Step 3: generate your first image

Save the configuration, start a new Codex chat, and send:
Allow the script’s image API network request when Codex asks. Generation can take a few minutes; wait for the current request to finish. Confirm that your original Codex account remains signed in, output/images/mug.png exists and opens, and the BetterToken usage log contains the matching image model request.

Edit a reference image

Put the reference image in the project or provide its local path:
The skill uses the image editing endpoint. See image editing for uploads and masks. To change image models, specify the full Model ID from the model plaza.

Troubleshooting