codex

A setup for running the OpenAI Codex command-line tool through the FreeRideV3 gateway, which forwards requests to free upstream providers. Codex is a terminal-based coding agent that can work with files and commands.

In plain words
What is it for?
Use it to start Codex in a terminal through FreeRide, with requests translated between the interfaces used by Codex and other providers.
Why use it?
It is intended for people who want to use Codex without a paid OpenAI plan, an OpenAI API key, or OpenAI sign-in.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/shaivpidadi/freeridev3/codex
Clone the repo
git clone --depth 1 https://github.com/Shaivpidadi/FreeRideV3
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,634 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01634
Opus 5 $0.00000 $0.00817
Sonnet 5 $0.00000 $0.00327
Haiku 4.5 $0.00000 $0.00163

Measured 3d ago against content hash fcbb0050100d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

codex scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -sSL https://api.free-ride.xyz/install.sh | sh

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

1. **Injects `-c openai_base_url=http://localhost:11343/v1` into argv** right after the `codex` binary name. Codex reads its base URL from `~/.codex/config.toml` (not an env var); the `-c` flag is the per-invocation over

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sSL https://api.free-ride.xyz/install.sh | sh
docs/agents/codex.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenAI Codex CLI

The new agentic terminal tool from OpenAI (Rust, npm install -g @openai/codex). FreeRide makes it work without a paid OpenAI plan — the gateway translates Codex's Responses-API wire protocol to free upstream providers.

TL;DR

curl -sSL https://api.free-ride.xyz/install.sh | sh
npm install -g @openai/codex
freeride run codex

You're in a Codex session, routed through free providers. No OPENAI_API_KEY or CODEX_API_KEY needed. You don't have to sign in to OpenAI.


How it works

Codex speaks only the OpenAI Responses API (POST /v1/responses) — wire_api = "chat" is explicitly rejected on its side. The gateway hosts a Responses-shape endpoint that:

  1. Accepts the typed-item input array (messages, function_call, function_call_output, reasoning items)
  2. Unwraps the flat tools[] (Responses uses {type, name, parameters}, Chat Completions uses {type, function: {…}})
  3. Translates to OpenAI Chat Completions
  4. Routes through the same failover machinery /v1/messages and /v1/chat/completions use
  5. Translates the response back to Responses shape (with output[] array of typed items, status field, no choices)
  6. Re-frames streaming chunks into Responses SSE event protocol with explicit framing events (response.output_item.addedresponse.content_part.addedresponse.output_text.delta → … → response.completed)

The Codex CLI parses every event natively; from its perspective the gateway is OpenAI.

Model field on the request (gpt-5-codex, gpt-5, etc.) is rewritten to auto before dispatch — we don't host OpenAI's proprietary models, so the smart-router picks a free model. The originally-requested id is echoed back on the response so the CLI's UI stays coherent.

What the wrapper does

freeride run codex does three things before invoking codex:

  1. Injects -c openai_base_url=http://localhost:11343/v1 into argv right after the codex binary name. Codex reads its base URL from ~/.codex/config.toml (not an env var); the -c flag is the per-invocation override that doesn't mutate the user's config file.
  2. Sets CODEX_API_KEY=sk-freeride-no-auth (a sentinel) if the parent env has none. Codex's auth gate refuses to make any HTTP request without this — the sentinel satisfies the local check; the gateway recognizes it via has_inbound_auth() and demotes it to "no auth" for routing decisions.
  3. Writes ~/.codex/auth.json with {"OPENAI_API_KEY": "sk-freeride-no-auth"} on first run if the file doesn't exist, so Codex's "configure authentication" picker doesn't fire.

Read the full file on GitHub · 98 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 98 lines · 0 tokens per session scan D fcbb0050100d

Subscribe to this mod's changes

codex is an agent published in the GitHub repository Shaivpidadi/FreeRideV3 (42 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,634 tokens. A static security scan graded it D with 3 findings (downloads and executes remote code, reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.