Installing Codex and connecting it to the MyGPTLife API

Install Claude Code and Codex, configure your model and token, find Windows and Intel Mac downloads, and compare the costs and limits of three access options.

Open the Codex installation guide
A developer workstation with a terminal and keyboard

Install the command-line tools

Run node --version in a terminal. The current Claude Code npm package requires Node.js 22 or later. After installing Node.js, run the command for each tool you need.

Download Node.js

npm install -g @anthropic-ai/claude-code
npm install -g @openai/codex

Check the installation with claude --version or codex --version. If Windows PowerShell reports that scripts are disabled, set RemoteSigned for the current user and try again.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Set the Codex model and gateway

Open ~/.codex/config.toml, creating it if necessary. On Windows the directory is %USERPROFILE%\.codex. Put these settings before any TOML table header. Update existing keys in place.

model_reasoning_effort = "medium"
model = "gpt-6-astra"
openai_base_url = "https://api4.mygptlife.com/v1"

Create a token in the MyGPTLife console. Open Codex, select API key sign-in and enter your token. When using CC-Switch, set the Codex base URL to https://api4.mygptlife.com/v1.

Create or manage a MyGPTLife token

Download CC-Switch

Desktop downloads and Chinese localization on Windows

Extract the legacy Windows RAR and open Codex.exe in the app folder. On an Intel Mac, choose the x64 DMG. To apply the Windows Chinese localization, quit Codex, download and open the localizer, follow its prompts, then reopen Codex.

Download legacy Codex for Windows

Download Codex for Intel Mac

Download the Windows Chinese localizer

Compare three ways to access Codex

MyGPTLife quotes 10–20% of the corresponding official API list price. Compare the same model and billing unit. Balance, rate limits and model permissions determine actual availability.

No.ItemChatGPT accountOpenAI APIMyGPTLife API
1Network accessSubject to supported regions and networksSubject to supported regions and networksSupports connections from mainland China
2Usage allowancePlan-specific allowanceMetered, subject to balance and rate limitsMetered, subject to balance and token group
3gpt-image-2 image countDepends on your plan and feature availabilityMetered within account limitsMetered within token limits
4Veo 3.1、Omni-FlashDepends on available product featuresSee the official model catalog. Google provides Veo 3.1Depends on the model catalog and token group
5Nano Banana modelsNo native endpointNo native endpointAvailable with an eligible token group
6Account restrictionsAccount usage rules applyAPI usage rules applyPlatform and upstream rules apply
7PaymentPayment methods vary by regionPayment methods vary by regionRMB payments via Alipay and WeChat Pay
8Contracts and invoicesSubscription receipts are available in the accountBilling and contracts depend on the customer planContracts and invoicing available
9PriceSubscription pricingOfficial per-model rates10–20% of the official API list price, subject to the model price shown in the console
10Technical supportHelp center and plan-specific supportDepends on the service plan16 hours of WeChat and phone support daily
11Typical usersIndividualsDevelopers, teams and companiesSmall teams and companies
12SetupRequires a suitable account and connectionRequires API and billing setupEnter the gateway address and token
13Control Codex from the ChatGPT mobile appDepends on account and client featuresAn API key alone does not enable this featureA gateway token alone does not enable this feature
14Billing modelRecurring subscription with usage limitsPay as you goPay as you go

A template for Codex instructions

Copy the template into Codex custom instructions or the project’s AGENTS.md.

For image generation, use gpt-image-2. Read the key from Codex auth and the base URL from its config. The API provider returns a hosted image URL.

Transcribe audio locally by default, or use API4’s gpt-4o-transcribe.

For image watermark removal, use API4’s nano-banana. Read the key from Codex auth and the base URL from its config.

Check a token