• English
  • Codex

    OpenAI's official CLI / desktop app. Point it at ByteSeek via a custom provider.

    Install

    npm
    Homebrew
    Run with npx
    Desktop app
    npm install -g @openai/codex

    For provider management on desktop, see Codex++.

    Prerequisites

    • Codex CLI installed (codex --version prints a version)
    • A key supporting the OpenAI format created on the API Keys page

    Configure (one click from the console)

    No hand-written config needed — the console generates it for your key:

    1. Open the API keys page, and in the key row's Actions column click More → Use key;
    2. Switch the dialog to the Codex CLI tab, pick the auth mode and your OS (macOS / Linux or Windows), and copy the two generated files;
    3. Write them to ~/.codex/config.toml (must sit at the top of the file) and ~/.codex/auth.json. Create the directory first with mkdir -p ~/.codex if needed (Windows paths are shown on the dialog's Windows tab).
    SCREENSHOTUse key dialog, Codex CLI tab
    The "Use key" dialog on the Codex CLI tab: auth mode and WebSocket switches on top, copy-ready config.toml and auth.json below (key redacted)

    Compatible mode (the everyday default) generates:

    model_provider = "OpenAI"
    model = "gpt-5.6-sol"
    review_model = "gpt-5.6-sol"
    model_reasoning_effort = "xhigh"
    disable_response_storage = true
    network_access = "enabled"
    windows_wsl_setup_acknowledged = true
    
    [model_providers.OpenAI]
    name = "OpenAI"
    base_url = "https://tokens.byteseek.ai"
    wire_api = "responses"
    requires_openai_auth = true
    
    [features]
    goals = true

    ~/.codex/auth.json (the key lives here — no environment variable needed):

    {
      "OPENAI_API_KEY": "sk-your-key"
    }

    Swap model / review_model for any model ID from the model plaza; tune model_reasoning_effort as you like.

    The two auth modes

    ModeForConfig difference
    Compatible modeEveryday use (default)requires_openai_auth = true
    API Key ModeOnly when Codex Desktop needs the local image toolsrequires_openai_auth = false, plus http_headers = { "x-openai-actor-authorization" = "local-image-extension" }

    After switching to API Key Mode, fully quit and restart Codex Desktop / CLI and start a new task so the client rebuilds its tool registry.

    WebSocket

    Plain HTTP requests are the default and fine. Only switch the dialog to "On" when both your Codex client and the server support WebSocket v2; composite keys do not support WebSocket.

    What you should see
    • On starting codex, the welcome info shows your configured model (e.g. gpt-5.6-sol) and provider OpenAI;
    • /status confirms the Base URL points at tokens.byteseek.ai and auth passes;
    • Conversations return normally with no 401 / stream errors.

    Verify

    codex "introduce yourself in one sentence"

    A normal reply means you are in. The request's model and charge appear on the usage page.

    Remote compaction

    In the config above the provider's name is OpenAI — not an arbitrary label. It is the switch for Codex's remote compaction.

    When a long conversation approaches the context limit, Codex compacts history. Only when the provider's name is exactly OpenAI does Codex prefer the remote compaction endpoint (/v1/responses/compact); remote compaction is higher quality and keeps very long sessions stable without degrading. Any other value (such as ByteSeek) forces local compaction, which is noticeably worse.

    Notes
    • The console-generated config already sets name to OpenAI — copy it as is and don't change it;
    • Changing this setting does not lose existing chat history.

    If you also enable the 1M context below, compaction triggers around 900k tokens, where the quality gap of remote compaction matters even more — keep name = "OpenAI".

    Enable 1M context

    The GPT-5.6 Sol model itself supports a context window of about 1,050,000 tokens, but Codex gives sessions a much smaller budget by default. The configuration below raises the session budget to 1M tokens (method published by Codex engineer Tibo).

    Add two lines at the very top of ~/.codex/config.toml — they must sit above every [section] header. TOML assigns keys after a section header to that section, so misplaced keys fail silently:

    model_context_window = 1000000
    model_auto_compact_token_limit = 900000
    KeyEffect
    model_context_windowSession context budget, set to 1M tokens
    model_auto_compact_token_limitAuto-compacts history around 900k tokens, leaving headroom for compaction and further output

    You can also test once without touching the file:

    codex -m gpt-5.6-sol \
      -c model_context_window=1000000 \
      -c model_auto_compact_token_limit=900000

    Verify and mind the cost

    • After saving, restart Codex and start a new session, then check the window size with /status.
    • Costs rise: upstream bills requests with more than 272k input tokens at a premium (roughly 2× input / 1.5× output). Long context is paid for — everyday tasks rarely need the full window.

    With Fast Mode

    The Codex desktop app has no priority switch. To route desktop requests through the high-priority lane, set the key's Fast policy to force on — no client changes, see Fast Mode. Cost is roughly 2× regular.

    Common issues

    SymptomCause and fix
    401Invalid key; check OPENAI_API_KEY inside ~/.codex/auth.json is complete
    403Client-restricted group or model not in group; check the model plaza
    Config not taking effect / empty model listHand-edited configs drift — re-copy everything from the "Use key" dialog and make sure it sits at the top of config.toml
    Broken after switching to API Key ModeFully quit and restart Codex, then start a new task
    TimeoutsSlow deep reasoning is normal; for frequent timeouts see Troubleshooting
    © 2026 ByteSeek Limited. All rights reserved.TermsPrivacyDisclaimer