# One Menu Click Unplugs Your Whole Free AI Setup

**URL:** <https://onehack.st/t/one-menu-click-unplugs-your-whole-free-ai-setup/325264>\
**Category:** Tutorials & Methods\
**Tags:** freebies, networking, ai, self-hosted-tools\
**Created:** [September 3, 2026, 4:18pm UTC](https://onehack.st/t/one-menu-click-unplugs-your-whole-free-ai-setup/325264 "2026-09-03T16:18:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BCBC](https://onehack.st/user_avatar/onehack.st/bcbc/32/179606_2.png) [@BCBC](https://onehack.st/u/BCBC)\
**Post date:** [September 3, 2026, 4:18pm UTC](https://onehack.st/t/one-menu-click-unplugs-your-whole-free-ai-setup/325264/1 "2026-09-03T16:18:49Z")

</div>

### ⚙ Change Codex’s reasoning effort and every request dies ❌ with an error that looks like your server fell over — ✅ one line back to auto and it’s instantly fine.

```plaintext
   model = "auto" model = "gpt-5.6-sol"
         │ │
   ┌─────▼─────┐ ┌─────▼─────┐
   │ GATEWAY │ picks for you │ GATEWAY │ bypassed
   └─────┬─────┘ └─────┬─────┘
         │ │
   free · free · free · paid one upstream, no fallback
                                                  │
   ✅ routing alive, limits absorbed ❌ Invalid request: Invalid input

```

```plaintext
╔══════════════════════════════════════════════════════════════╗
║ CODEX + OPENAI-COMPATIBLE GATEWAY FIELD NOTE ║
║ ║
║ Gateway working? Changed /model? Suddenly broken? ║
║ ║
║ CHECK THE MODEL SETTING FIRST. ║
╚══════════════════════════════════════════════════════════════╝

```

Landed here from this exact error? You’re in the right place:

```plaintext
{"error":{"message":"Invalid request: input: Invalid input","type":"invalid_request_error"}}

```

I hit this in **OpenAI Codex CLI v0.152.1** against a custom OpenAI-compatible gateway. Posting it because the failure sends you troubleshooting in exactly the wrong direction — and because if you’re stacking free tiers behind a router, this is the thing that silently switches it off.

* * *

> **🧪 The proof — A/B test across two gateway profiles**
>
> ## 🎯 What I Was Actually Trying To Do
> 
> I wasn’t really trying to change providers.
> 
> I simply wanted to change how much reasoning Codex used.
> 
> Something like:
> 
> ```plaintext
> LOW
> ↓
> MEDIUM
> ↓
> HIGH
> 
> ```
> 
> But Codex’s model interface ties model selection and reasoning selection together closely enough that I ended up changing the configured model too.
> 
> My previously working gateway configuration effectively went from:
> 
> ```toml
> model = "auto"
> model_reasoning_effort = "low"
> 
> ```
> 
> to something like:
> 
> ```toml
> model = "gpt-5.6-sol"
> model_reasoning_effort = "high"
> 
> ```
> 
> And that was enough to break the requests.
> 
> * * *
> 
> ## 🧪 The Evidence
> 
> I tested this against **two independently configured gateway profiles**.
> 
> The same Codex client was used.
> 
> The same gateway software was used.
> 
> Authentication remained valid.
> 
> No API keys were rotated during the A/B test.
> 
> No reverse-proxy configuration was changed.
> 
> No containers were rebuilt.
> 
> One meaningful variable was changed:
> 
> ```plaintext
> MODEL
> 
> ```
> 
> ### Results
> 
> | Model configuration | Reasoning | Result |
> | --- | --- | --- |
> | Explicit model | HIGH | ❌ FAIL |
> | Explicit model | LOW | ❌ FAIL |
> | `auto` | HIGH | ✅ PASS |
> | `auto` | MEDIUM | ✅ PASS |
> 
> The explicit model produced:
> 
> ```plaintext
> Invalid request: input: Invalid input
> 
> ```
> 
> Changing only:
> 
> ```toml
> model = "gpt-5.6-sol"
> 
> ```
> 
> back to:
> 
> ```toml
> model = "auto"
> 
> ```
> 
> restored successful completions.
> 
> * * *
> 
> ## ✅ Proven Working State
> 
> One working profile ended with:
> 
> ```plaintext
> Model: auto
> Reasoning: high
> Provider: custom OpenAI-compatible gateway
> Result: PASS
> 
> ```
> 
> A second independently configured profile ended with:
> 
> ```plaintext
> Model: auto
> Reasoning: medium
> Provider: custom OpenAI-compatible gateway
> Result: PASS
> 
> ```
> 
> So reasoning effort itself was **not** the problem.
> 
> That was an important distinction.
> 
> * * *
> 
> ## ⚠ The `auto` Warning Is NOT The Same Failure
> 
> When using:
> 
> ```toml
> model = "auto"
> 
> ```
> 
> Codex currently displays:
> 
> ```plaintext
> Model metadata for `auto` not found.
> Defaulting to fallback metadata; this can degrade performance and cause issues.
> 
> ```
> 
> That warning looks ugly.
> 
> But in my testing it was **non-fatal**.
> 
> The completion still succeeded.
> 
> So we have two separate conditions:
> 
> ```plaintext
> ┌──────────────────────────────────────────────┐
> │ model = auto │
> │ │
> │ metadata warning appears │
> │ ↓ │
> │ request completes successfully │
> │ │
> │ PASS │
> └──────────────────────────────────────────────┘
> 
> ```
> 
> versus:
> 
> ```plaintext
> ┌──────────────────────────────────────────────┐
> │ explicit model selected │
> │ ↓ │
> │ request sent through custom gateway │
> │ ↓ │
> │ Invalid request: input: Invalid input │
> │ │
> │ FAIL │
> └──────────────────────────────────────────────┘
> 
> ```
> 
> Do not assume the `auto` metadata warning is the actual problem.
> 
> * * *

> **🛠️ The fix — 8 steps, inspect to rollback**
>
> # 🛠 Repair Procedure
> 
> The commands below are intentionally generic.
> 
> Replace:
> 
> ```plaintext
> ~/.codex/my-gateway.config.toml
> 
> ```
> 
> with your own custom-provider configuration file.
> 
> Do **not** publish your real API keys, gateway hostname, IP addresses, usernames, internal paths, VM/container identifiers, or session IDs.
> 
> > **▶ 1. Inspect the current Codex gateway profile**
> >
> > This changes nothing.
> > 
> > ```bash
> > CONFIG="$HOME/.codex/my-gateway.config.toml"
> > 
> > grep -E \
> > '^(model|model_provider|model_reasoning_effort)[[:space:]]*=' \
> > "$CONFIG"
> > 
> > ```
> > 
> > A broken profile may look similar to:
> > 
> > ```plaintext
> > model = "gpt-5.6-sol"
> > model_provider = "my_gateway"
> > model_reasoning_effort = "high"
> > 
> > ```
> 
> > **▶ 2. Back up the profile BEFORE changing anything**
> >
> > Always preserve the original first.
> > 
> > ```bash
> > CONFIG="$HOME/.codex/my-gateway.config.toml"
> > 
> > BACKUP="${CONFIG}.before-auto-repair-$(date +%Y%m%d-%H%M%S)"
> > 
> > cp -a "$CONFIG" "$BACKUP"
> > 
> > echo "BACKUP=$BACKUP"
> > 
> > ```
> 
> > **▶ 3. Restore gateway-controlled model routing**
> >
> > Change only the model setting:
> > 
> > ```bash
> > CONFIG="$HOME/.codex/my-gateway.config.toml"
> > 
> > sed -i \
> > 's/^model[[:space:]]*=.*/model = "auto"/' \
> > "$CONFIG"
> > 
> > ```
> 
> > **▶ 4. Set reasoning effort independently**
> >
> > For MEDIUM:
> > 
> > ```bash
> > CONFIG="$HOME/.codex/my-gateway.config.toml"
> > 
> > sed -i \
> > 's/^model_reasoning_effort[[:space:]]*=.*/model_reasoning_effort = "medium"/' \
> > "$CONFIG"
> > 
> > ```
> > 
> > Other commonly used values are:
> > 
> > ```plaintext
> > low
> > medium
> > high
> > 
> > ```
> > 
> > The important part is that reasoning effort can remain independent from gateway model routing.
> 
> > **▶ 5. Verify the repaired profile**
> >
> > ```bash
> > CONFIG="$HOME/.codex/my-gateway.config.toml"
> > 
> > grep -E \
> > '^(model|model_provider|model_reasoning_effort)[[:space:]]*=' \
> > "$CONFIG"
> > 
> > ```
> > 
> > Expected:
> > 
> > ```plaintext
> > model = "auto"
> > model_provider = "my_gateway"
> > model_reasoning_effort = "medium"
> > 
> > ```
> 
> > **▶ 6. Test with the smallest possible completion**
> >
> > Start Codex through your custom provider and send something trivial:
> > 
> > ```plaintext
> > Reply exactly: GATEWAY AUTO TEST OK
> > 
> > ```
> > 
> > You are looking for:
> > 
> > ```plaintext
> > GATEWAY AUTO TEST OK
> > 
> > ```
> > 
> > Do not start rebuilding infrastructure until this test has been attempted.
> 
> > **▶ 7. Confirm the provider with /status**
> >
> > Inside Codex:
> > 
> > ```plaintext
> > /status
> > 
> > ```
> > 
> > Confirm that the session is actually using your custom provider.
> > 
> > A sanitized example:
> > 
> > ```plaintext
> > Model: auto
> > Reasoning: medium
> > Model provider: My OpenAI-Compatible Gateway
> > Directory: ~/project
> > 
> > ```
> > 
> > This step matters.
> > 
> > A successful response is much stronger evidence if you can also prove that Codex did **not** silently fall back to another provider.
> 
> > **▶ 8. Roll back if necessary**
> >
> > If the experiment makes things worse:
> > 
> > ```bash
> > CONFIG="$HOME/.codex/my-gateway.config.toml"
> > BACKUP="$HOME/.codex/my-gateway.config.toml.before-auto-repair-YYYYMMDD-HHMMSS"
> > 
> > cp -a "$BACKUP" "$CONFIG"
> > 
> > ```
> > 
> > Use the actual timestamped backup filename created earlier.
> 
> * * *

> **🧰 The script — does all 8 steps for you**
>
> # 🧰 Small Standalone Repair Script
> 
> This is a generic helper for people who hit the same problem.
> 
> It:
> 
> - validates the requested reasoning level;
> - verifies that the configuration exists;
> - creates a timestamped backup;
> - restores `model = "auto"`;
> - sets reasoning independently;
> - prints only non-secret model settings;
> - never asks for or prints an API key.
> 
> > **▶ Codex OpenAI-Compatible Gateway Profile Repair Script**
> >
> > Save as:
> > 
> > ```plaintext
> > codex-gateway-auto-repair.sh
> > 
> > ```
> > 
> > ```bash
> > #!/usr/bin/env bash
> > set -euo pipefail
> > 
> > CONFIG="${1:-$HOME/.codex/config.toml}"
> > EFFORT="${2:-medium}"
> > 
> > case "$EFFORT" in
> > low|medium|high)
> > ;;
> > *)
> > echo "ERROR: reasoning effort must be low, medium, or high"
> > echo
> > echo "Usage:"
> > echo " $0 [config-file] [low|medium|high]"
> > exit 2
> > ;;
> > esac
> > 
> > if [! -f "$CONFIG"]; then
> > echo "ERROR: configuration file not found:"
> > echo "$CONFIG"
> > exit 1
> > fi
> > 
> > BACKUP="${CONFIG}.before-auto-repair-$(date +%Y%m%d-%H%M%S)"
> > 
> > echo
> > echo "============================================================"
> > echo " CODEX OPENAI-COMPATIBLE GATEWAY PROFILE REPAIR"
> > echo "============================================================"
> > echo
> > echo "CONFIG : $CONFIG"
> > echo "BACKUP : $BACKUP"
> > echo "EFFORT : $EFFORT"
> > echo
> > 
> > cp -a "$CONFIG" "$BACKUP"
> > 
> > if grep -q '^model[[:space:]]*=' "$CONFIG"; then
> > sed -i \
> > 's/^model[[:space:]]*=.*/model = "auto"/' \
> > "$CONFIG"
> > else
> > sed -i \
> > '1i model = "auto"' \
> > "$CONFIG"
> > fi
> > 
> > if grep -q '^model_reasoning_effort[[:space:]]*=' "$CONFIG"; then
> > sed -i \
> > "s/^model_reasoning_effort[[:space:]]*=.*/model_reasoning_effort = \"$EFFORT\"/" \
> > "$CONFIG"
> > else
> > sed -i \
> > "2i model_reasoning_effort = \"$EFFORT\"" \
> > "$CONFIG"
> > fi
> > 
> > echo "CURRENT NON-SECRET MODEL SETTINGS:"
> > echo
> > 
> > grep -E \
> > '^(model|model_provider|model_reasoning_effort)[[:space:]]*=' \
> > "$CONFIG" || true
> > 
> > echo
> > echo "============================================================"
> > echo " REPAIR COMPLETE"
> > echo "============================================================"
> > echo
> > echo "Rollback copy:"
> > echo "$BACKUP"
> > echo
> > echo "Next:"
> > echo " Start Codex through your custom gateway."
> > echo " Send a tiny test completion."
> > echo " Confirm the provider with /status."
> > echo
> > 
> > ```
> > 
> > Make executable:
> > 
> > ```bash
> > chmod +x codex-gateway-auto-repair.sh
> > 
> > ```
> > 
> > Example:
> > 
> > ```bash
> > ./codex-gateway-auto-repair.sh \
> > "$HOME/.codex/my-gateway.config.toml" \
> > medium
> > 
> > ```
> 
> * * *

> **🤔 Why this is sneaky — where people waste hours instead**
>
> # 🤔 Why This Failure Is So Misleading
> 
> When the request starts returning:
> 
> ```plaintext
> Invalid request: input: Invalid input
> 
> ```
> 
> a normal administrator may reasonably start checking:
> 
> ```plaintext
> ┌───────────────┐
> │ CODEX │
> └───────┬───────┘
> │
> ▼
> ┌───────────────┐
> │ API KEY │
> └───────┬───────┘
> │
> ▼
> ┌───────────────┐
> │ TLS / DNS │
> └───────┬───────┘
> │
> ▼
> ┌───────────────┐
> │ NGINX / PROXY │
> └───────┬───────┘
> │
> ▼
> ┌───────────────┐
> │ LLM GATEWAY │
> └───────┬───────┘
> │
> ▼
> ┌───────────────┐
> │ PROVIDER KEY │
> └───────┬───────┘
> │
> ▼
> ┌───────────────┐
> │ UPSTREAM API │
> └───────────────┘
> 
> ```
> 
> You can burn hours proving every layer.
> 
> But if all of that worked five minutes ago, first inspect:
> 
> ```toml
> model =
> 
> ```
> 
> Sometimes the entire infrastructure is healthy.
> 
> The client has simply stopped asking the gateway to route the request the way it was designed to.
> 
> * * *

> **💡 Wishlist — 4 things that would stop this happening at all**
>
> # 💡 Improvements I Would Like To See
> 
> ## 1. Give `Default / Auto` a first-class option
> 
> If a custom provider is configured with:
> 
> ```toml
> model = "auto"
> 
> ```
> 
> the model interface should allow the user to retain it.
> 
> Something like:
> 
> ```plaintext
> Model:
> 
> ▶ Default / Gateway Auto
> model-a
> model-b
> model-c
> 
> ```
> 
> * * *
> 
> ## 2. Separate reasoning effort from model selection
> 
> This was the original reason I found the problem.
> 
> I wanted to change:
> 
> ```plaintext
> reasoning:
> LOW → MEDIUM
> 
> ```
> 
> I did not necessarily want:
> 
> ```plaintext
> model:
> AUTO → EXPLICIT MODEL
> 
> ```
> 
> Those are conceptually different settings.
> 
> They should be independently adjustable.
> 
> * * *
> 
> ## 3. Recognize router semantics
> 
> For an OpenAI-compatible router:
> 
> ```plaintext
> CODEX
> │
> │ model = auto
> ▼
> ┌─────────────┐
> │ GATEWAY │
> └──────┬──────┘
> │
> ┌───────┼────────┐
> ▼ ▼ ▼
> Provider A Provider B Provider C
> 
> ```
> 
> `auto` does not necessarily mean:
> 
> ```plaintext
> unknown model
> 
> ```
> 
> It may mean:
> 
> ```plaintext
> Gateway, you decide.
> 
> ```
> 
> That is intentional architecture.
> 
> * * *
> 
> ## 4. Warn before overriding it
> 
> A warning like this would help tremendously:
> 
> ```plaintext
> This custom provider is currently configured with:
> 
> model = "auto"
> 
> Selecting a specific model may override routing performed by
> your OpenAI-compatible gateway.
> 
> Continue? [y/N]
> 
> ```
> 
> * * *

> **🔐 Safety before you post logs + the field rule**
>
> # 🔐 Public Troubleshooting Safety
> 
> Before posting your configuration or logs publicly, remove or sanitize:
> 
> ```plaintext
> API keys
> Bearer tokens
> access tokens
> session IDs
> gateway hostnames
> public IP addresses
> private IP addresses
> SSH information
> usernames
> real filesystem paths
> VM/container identifiers
> internal network names
> provider credentials
> authorization headers
> cookie values
> database credentials
> 
> ```
> 
> A good technical bug report should reveal:
> 
> ```plaintext
> software behavior
> configuration semantics
> error messages
> A/B test results
> reproduction method
> recovery method
> 
> ```
> 
> It should **not** provide strangers with an infrastructure map.
> 
> * * *
> 
> # 📋 Field Troubleshooting Rule
> 
> ```plaintext
> ╔═══════════════════════════════════════════════════════════════╗
> ║ EVIDENCE BEATS MEMORY ║
> ╠═══════════════════════════════════════════════════════════════╣
> ║ ║
> ║ What was true before? ║
> ║ ║
> ║ What changed? ║
> ║ ║
> ║ Why did it change? ║
> ║ ║
> ║ What proves the new state? ║
> ║ ║
> ║ Where is the recovery artifact? ║
> ║ ║
> ║ How do we roll it back? ║
> ║ ║
> ║ What is still unknown? ║
> ║ ║
> ╚═══════════════════════════════════════════════════════════════╝
> 
> ```
> 
> In this case:
> 
> ```plaintext
> BEFORE
> │
> └── model = auto
> │
> ▼
> PASS
> 
> CHANGE
> │
> └── explicit model selected
> │
> ▼
> FAIL
> 
> A/B TEST
> │
> └── model restored to auto
> │
> ▼
> PASS
> 
> ```
> 
> That’s enough.
> 
> Don’t rebuild the bridge after you’ve already proven the bridge isn’t broken.
> 
> * * *

# Bottom Line

With the tested combination of:

```plaintext
OpenAI Codex CLI v0.152.1
        +
Custom OpenAI-compatible provider
        +
Gateway-controlled routing

```

an explicitly selected model produced reproducible:

```plaintext
Invalid request: input: Invalid input

```

on two separate custom-provider profiles.

Restoring:

```toml
model = "auto"

```

restored successful completions on both.

Reasoning effort was successfully tested independently at:

```plaintext
HIGH

```

and:

```plaintext
MEDIUM

```

So if your previously functioning Codex gateway suddenly starts throwing:

```plaintext
Invalid request: input: Invalid input

```

after using `/model`:

**check the persisted model configuration before touching the rest of your infrastructure.**

You may save yourself several hours.

```plaintext
╔══════════════════════════════════════════════════════════════╗
║ BRIDGE CROSSED ║
║ ║
║ Change one variable. ║
║ Preserve the evidence. ║
║ Keep the rollback. ║
║ Move forward. ║
╚══════════════════════════════════════════════════════════════╝

```

* * *

**Built and field-tested collaboratively by**

**William James / Mikey\_LikesIT**  
**ChatGPT / OpenAI — GPT-5.6 Sol**

For the BCBC community and anyone else building their own AI infrastructure.

```plaintext
──────────────────────────────────────────────────────────────

                     ALTERED REALITY

                   In memory of Ron Phillips

                       R.I.P., my friend.

──────────────────────────────────────────────────────────────

```
