Codex

Bring Ambient into Codex with the ambient-codex plugin. Route the bulk of your coding to Ambient's open models with Delegate and Ambient-session (takeover) modes, while Codex stays the control plane for review, tests, and the final commit.

The ambient-codex plugin brings Ambient into a Codex session, reached with $ambient. It adds chat, second-opinion audits, focused code drafts, multi-file builds, and repository maps. Codex stays the control plane; Ambient is the generation plane you route work to.

Install#

  1. Install the plugin#

    codex plugin marketplace add AmbientCrypto/ambient-codex
    codex plugin add ambient-codex@ambient-codex

    Reinstalling uses the same second command. Start a new Codex thread after every install or update so Codex loads the current version.

  2. Connect your Ambient API key (one time)#

    The plugin lives in a versioned Codex cache, so it ships a small ambient-codex command that you use to store your key and run diagnostics. Create that command once, then run setup:

    PLUGIN_DIR="$(codex mcp get ambient --json | python3 -c 'import json,sys; print(json.load(sys.stdin)["transport"]["cwd"].rstrip("/."))')"
    "$PLUGIN_DIR/bin/ambient" link
    ambient-codex setup

    setup hides the key while you type, verifies it with a real call, and stores it in your OS keychain. Never paste an API key into Codex chat. (If ~/.local/bin is not on your PATH, the link command prints the exact line to add.)

  3. Start#

    Open a new Codex thread and enter $ambient for the control panel, or just ask for Ambient by name.

    $ambient

Ways to work#

Switch modes from $ambient (change mode). Modes are session-only; a fresh Codex thread starts in Normal Codex.

On demand (Normal Codex)#

Codex works exactly as it does now. Ambient runs only when you ask for it by name, for a one-off audit, build, or second opinion.

Delegate#

Codex plans and reviews, and routes the token-heavy work to Ambient. Larger audits, bulk reading, code drafts, and multi-file builds go to open models, while Codex keeps trivial edits and anything sensitive, destructive, or production-facing local. You get frontier orchestration at open-model rates on the volume.

Takeover (Ambient session)#

Ambient becomes the direct chat and work engine for the thread, so the bulk of the coding runs on Ambient's open models and costs a fraction of a frontier session. Codex stays the control plane and acts as the orchestrator: it frames the acceptance contract, reviews every result, runs the tests, does the final commit, push, and merge, and keeps key handling, outbound-secret checks, destructive actions, and security-critical boundaries local. Ambient does the primary generation; Codex integrates it and uses its own tools around the result.

Turn it on from $ambient (change mode, then Ambient session).

Workflows#

Each workflow picks the right model and context budget for the job. Drive them in plain language, or open $ambient and choose one.

Workflow What it does
Ask A direct question or short chat with Ambient (ask Ambient <question>)
Audit A second-opinion review of a diff, files, or the whole repo, with optional multi-model consensus (audit this diff, audit this repo)
Code A focused code draft from the context files you point it at
Build A multi-file build with a resumable manifest and bounded, reviewable writes (build <task>)
Map Parallel summaries or classifications across many files
Agent A working-tree agent that inspects a scoped directory

Generated code is untrusted until you review and test it. On large work, Ambient reports partial or unread coverage instead of presenting a truncated result as complete.

Choose your models#

Chat/review and code/build each keep their own default model. From $ambient: set one model for all work, change chat/review model, change code/build model, or browse available models. The model catalog shows what the network is serving now.

Diagnostics and removal#

ambient-codex doctor                # check the install, key, and MCP server
ambient-codex setup --remove        # remove the stored key
ambient-codex link --remove         # remove the command
codex plugin remove ambient-codex@ambient-codex

Run Codex directly on Ambient#

The plugin keeps Codex as the control plane and routes work to Ambient on demand. To point Codex's own provider at Ambient instead, add Ambient as a model provider in ~/.codex/config.toml. Ambient serves the Responses wire format, so set wire_api = "responses".

model = "ambient/large"
model_provider = "ambient"
 
[model_providers.ambient]
name = "Ambient"
base_url = "https://api.ambient.xyz/v1"
env_key = "AMBIENT_API_KEY"
wire_api = "responses"

Export your key, then start Codex:

export AMBIENT_API_KEY=your-ambient-api-key
codex

What you get#

  • One key. Create it once at app.ambient.xyz/keys.
  • Your model choice. The model catalog shows what the network serves now.
  • Verified inference. Every response carries a receipt. See Verified inference for what it proves.
  • Zero data retention by default. You decide, per task, what leaves your machine.