How to run Codex on Google Cloud Vertex AI models with the gcp provider
Codex has a built-in gcp provider for Google Cloud Vertex AI. Use it when you want Codex to run on a model your own Google Cloud project can access.
- Install the Google Cloud CLI on the machine running Codex and sign in with Application Default Credentials (ADC). Codex runs
gcloud auth application-default print-access-tokento get access tokens.
gcloud auth application-default login
- Add the provider to
~/.codex/config.toml.
model_provider = "gcp"
[model_providers.gcp]
project_id = "my-project"
location = "global"
If you omit project_id or location, Codex reads GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_LOCATION respectively, and location defaults to global. To use a specific ADC file, set credential_file under [model_providers.gcp] to its absolute path.
- Starting with 0.167.0, you can also connect through a setup wizard on the sign-in screen instead of editing the config file. It's off by default, so turn the feature on first.
codex features enable gcp_setup_wizard
On the sign-in screen, choose "Sign in another way" and Google Cloud Vertex AI appears next to API key and Amazon Bedrock. Enter a project ID, a location and a credential file. Location and credential file are optional; leave the credential file blank to use ADC.
- Starting with 0.167.2, Codex sends tool updates incrementally by default on Vertex AI. To opt out, add one line under
[features]inconfig.toml.
[features]
incremental_tools_legacy_gcp = false
Sources
- Advanced configuration: Google Cloud Vertex AI providerlearn.chatgpt.com ↗
- Configuration reference: model_providers.gcplearn.chatgpt.com ↗
- Codex CLI 0.167.0 release notes (2026-11-06)github.com ↗
- openai/codex PR #57857: Add Google Cloud Vertex AI setup to TUI onboardinggithub.com ↗
- Codex CLI 0.167.2 release notes (2026-11-11)github.com ↗
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.