codex - 💡(How to fix) Fix Heartbeat automations ignore custom provider/base_url and call api.openai.com

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

error=Incorrect API key provided

Root Cause

Users who use OpenAI-compatible proxies/routers/custom providers can chat normally in Codex Desktop but cannot rely on heartbeat automations, because those automations silently use a different provider path and fail with auth errors.

Code Example

POST https://custom-provider.example/v1/responses
model=openai/gpt-5.5
status=200

---

POST https://api.openai.com/v1/responses
model=gpt-5.5
status=401 Unauthorized
error=Incorrect API key provided

---

model_provider = "custom"
model = "openai/gpt-5.5"
disable_response_storage = true
model_reasoning_effort = "xhigh"

[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "https://custom-provider.example/v1"

---

kind = "heartbeat"
name = "Daily AI briefing"
status = "ACTIVE"
rrule = "RRULE:FREQ=WEEKLY;BYHOUR=22;BYMINUTE=0;BYDAY=SU,MO,TU,WE,TH,FR,SA"
target_thread_id = "..."

---

kind = "cron"
model = "openai/gpt-5.5"
execution_environment = "local"
cwds = ["/path/to/workspace"]
RAW_BUFFERClick to expand / collapse

What happened?

Codex Desktop heartbeat automations appear to ignore the user's configured custom model provider / base URL and instead send requests to the official OpenAI endpoint.

In the same local Codex Desktop session, normal chat requests use the configured custom provider successfully:

POST https://custom-provider.example/v1/responses
model=openai/gpt-5.5
status=200

But a heartbeat automation triggered from the app uses the official OpenAI endpoint instead:

POST https://api.openai.com/v1/responses
model=gpt-5.5
status=401 Unauthorized
error=Incorrect API key provided

The key detail is that the heartbeat automation request is not using the configured custom provider endpoint, while normal chat requests do.

Config shape

Relevant ~/.codex/config.toml shape, with secrets omitted:

model_provider = "custom"
model = "openai/gpt-5.5"
disable_response_storage = true
model_reasoning_effort = "xhigh"

[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "https://custom-provider.example/v1"

Automation shape

The failing automation is a thread heartbeat automation:

kind = "heartbeat"
name = "Daily AI briefing"
status = "ACTIVE"
rrule = "RRULE:FREQ=WEEKLY;BYHOUR=22;BYMINUTE=0;BYDAY=SU,MO,TU,WE,TH,FR,SA"
target_thread_id = "..."

For comparison, a local cron automation can specify local execution fields, for example:

kind = "cron"
model = "openai/gpt-5.5"
execution_environment = "local"
cwds = ["/path/to/workspace"]

Expected behavior

Heartbeat automations should either:

  1. inherit the same configured model_provider, model, wire_api, and base_url as normal Codex Desktop chat sessions; or
  2. expose fields to explicitly configure provider/base URL/model for the heartbeat automation; or
  3. fail early with a clear message that heartbeat automations only support official OpenAI-hosted execution and do not support custom providers.

Actual behavior

Heartbeat automation requests go to https://api.openai.com/v1/responses with model=gpt-5.5, even though normal chat requests in the same app/session go to the configured custom provider endpoint with model=openai/gpt-5.5.

Why this matters

Users who use OpenAI-compatible proxies/routers/custom providers can chat normally in Codex Desktop but cannot rely on heartbeat automations, because those automations silently use a different provider path and fail with auth errors.

Version / environment

  • Codex CLI: 0.130.0
  • Codex Desktop app logs show: app.version=0.131.0-alpha.9
  • Wire API: Responses
  • OS: macOS

Notes

All API keys and sensitive values were omitted or redacted.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Heartbeat automations should either:

  1. inherit the same configured model_provider, model, wire_api, and base_url as normal Codex Desktop chat sessions; or
  2. expose fields to explicitly configure provider/base URL/model for the heartbeat automation; or
  3. fail early with a clear message that heartbeat automations only support official OpenAI-hosted execution and do not support custom providers.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Heartbeat automations ignore custom provider/base_url and call api.openai.com