• 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

    Edit ~/.codex/config.toml:

    model = "gpt-5-codex"
    model_provider = "byteseek"
    
    [model_providers.byteseek]
    name = "OpenAI"  # must be OpenAI — enables remote compaction, see below
    base_url = "https://tokens.byteseek.ai/v1"
    wire_api = "responses"

    Set the key environment variable:

    export OPENAI_API_KEY="sk-your-key"
    What you should see
    • On starting codex, the welcome info shows your configured model (e.g. gpt-5.6-sol) and provider byteseek;
    • /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

    The config above sets name in [model_providers.byteseek] to OpenAI rather than ByteSeek — deliberately. 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
    • name is only the display name used to trigger remote compaction — keep it OpenAI;
    • The provider identifier is unaffected: model_provider = "byteseek" and the [model_providers.byteseek] section name stay as they are;
    • 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; confirm OPENAI_API_KEY is active
    403Client-restricted group or model not in group; check the model plaza
    Empty model listbase_url missing /v1, or wire_api not set to responses
    TimeoutsSlow deep reasoning is normal; for frequent timeouts see Troubleshooting
    © 2026 ByteSeek Limited. All rights reserved.TermsPrivacyDisclaimer