Skip to content
NewDeepSeek V4.1 Flash 1017 Uncensored is live, with 1M tokens of context.Read the launch
Coding agents

Codex

Run the OpenAI Codex CLI on XField models with a custom provider in config.toml, plus profiles and reasoning effort.

The Codex CLI talks to models through the OpenAI Responses API, which XField serves at https://xfield.cloud.brutal.ai/api/v1/responses. You add XField as a custom model provider in ~/.codex/config.toml, point Codex at it, and keep everything else about your workflow.

You need the Codex CLI installed and an API key from Settings › API keys. No key yet? Request access.

Setup

  1. Export your key

    Codex reads the key from the environment variable named in the provider entry. Add this to your shell profile so every new terminal has it.

    Shell
    export XFIELD_API_KEY="sk-xf-v1-..."
  2. Add the provider
    ~/.codex/config.toml
    TOML
    model = "deepseek-v4.1-flash-1017-uncensored"
    model_provider = "field"
    model_reasoning_effort = "high"
    model_context_window = 1000000
     
    [model_providers.field]
    name = "XField"
    base_url = "https://xfield.cloud.brutal.ai/api/v1"
    env_key = "XFIELD_API_KEY"
    wire_api = "responses"

    base_url already ends in /v1; Codex appends /responses. wire_api = "responses" is the only protocol current Codex versions support, and the default. model_context_window tells Codex how much room it has before compacting, since it does not know these models.

  3. Run it
    Shell
    codex

    Run /status in the session to confirm the model and provider. A 401 means XFIELD_API_KEY is not set in the shell that started Codex.

Switching models

Override the model for one run with -m, or any config key with -c:

Shell
codex -m glm-5.3-uncensored
codex -c model_reasoning_effort="max" "Review this diff for auth bypasses"

Inside a session, /model switches too. Model ids are exact; see models for the list.

JobModel
Day-to-day coding, long agent runsdeepseek-v4.1-flash-1017-uncensored
Hard reasoning, security review, planningglm-5.3-uncensored
Bulk edits, labeling, cheap batch workglm-5.3-flash-uncensored

Profiles

Profiles let you keep a few named setups and pick one per run. In current Codex versions a profile is its own file next to config.toml, with top-level keys:

~/.codex/review.config.toml
TOML
model = "glm-5.3-uncensored"
model_provider = "field"
model_reasoning_effort = "max"
Shell
codex --profile review

Older Codex versions read profiles from [profiles.review] tables inside config.toml instead. If --profile ignores your file, check codex --version and use the form your version expects.

Reasoning effort

model_reasoning_effort maps to reasoning.effort on the Responses API. XField accepts none, minimal, low, medium, high, xhigh and max, and each model maps the word to the levels it has. DeepSeek V4.1 Flash has low, high, xhigh and max, and runs at high when you set nothing.

Rules of thumb:

  • high for normal coding. It is the default for a reason.
  • xhigh or max for a stubborn bug, a security review, or a plan you will follow for hours.
  • low for mechanical work: renames, formatting, test scaffolding.

Higher effort means more reasoning tokens and slower turns, so raise it per run with -c rather than globally.

Tips

  • Prompt caching is automatic. Codex keeps its instructions and tool list stable at the top of each request, so long sessions mostly bill as cached input.
  • codex exec "…" runs non-interactively, which suits CI jobs and scripted red-team harnesses.
  • Rate limited? Codex retries 429s on its own. If it gives up, wait a moment and resume.