About Clidex
What is Clidex
Use native sessions for everyday coding. Start an interactive session from Clidex CLI, the desktop app, or an ACP editor. The official Claude Code or Codex CLI uses a subscription account assigned by Clidex to send model requests directly to Anthropic or OpenAI. Clidex handles account assignment and session continuation.
For scripts, automation, and third-party tools, use the separate API Access option. The Clidex gateway accepts OpenAI-compatible requests and forwards them using a dedicated account pool. API access currently supports Codex only.
| Native sessions | API access | |
|---|---|---|
| Request path | Clidex CLI or desktop app → Official CLI → Anthropic or OpenAI | Script or third-party tool → Clidex API gateway → OpenAI |
| Tools or models | Claude Code, Codex | Codex (OpenAI) |
| Upstream accounts | Subscription accounts dedicated to sessions | Subscription accounts listed separately for API use |
| Billing | Pay per token from your prepaid balance | Same rates as native sessions, with requests marked API in the dashboard |
Are Clidex’s models real?
Both access options use official subscription accounts. In a native session, you can see the official CLI’s subscription mode and account details. The API lists its available models at GET /v1/models.
Why sessions don’t use a reverse proxy
The official CLI handles model requests, so sessions retain Claude Code and Codex behaviors such as project commands and conversation history. The clidex init pairing command connects your Clidex account. Once a session starts, the assigned subscription account authenticates with the model provider.
Quick Start
Install Clidex
Download and run the install script in your terminal:
-
macOS, Linux, WSL
curl -fsSL https://clidex.dev/install.sh | bash -
Windows PowerShell
irm https://clidex.dev/install.ps1 | iex -
Windows CMD
curl -fsSL https://clidex.dev/install.cmd -o install.cmd && install.cmd && del install.cmd
If you see The token '&&' is not a valid statement separator, you’re in PowerShell, not CMD. If you see 'irm' is not recognized as an internal or external command, you’re in CMD, not PowerShell. Your prompt shows PS C:\ in PowerShell, and C:\ (without PS) in CMD.
If the install command fails with syntax error near unexpected token '<', 403, or another curl error, see Troubleshoot installation to match the error to a fix or an alternative install method.
We recommend installing Git for Windows on native Windows so Claude Code and Codex can use the Bash tool. Without Git for Windows, Claude Code falls back to PowerShell as its shell tool. WSL setups don’t need Git for Windows.
Uninstall Clidex
Uninstall with the same script you installed with. Quit every running clidex first (including the tray, clidex tray):
-
macOS, Linux, WSL
curl -fsSL https://clidex.dev/install.sh | sh -s -- --uninstall -
Windows PowerShell
$env:CLIDEX_UNINSTALL=1; irm https://clidex.dev/install.ps1 | iex -
Windows CMD
curl -fsSL https://clidex.dev/install.cmd -o install.cmd && install.cmd uninstall && del install.cmd
Uninstalling removes:
- The
clidexexecutable (/usr/local/bin,~/.local/bin, or%LOCALAPPDATA%\Programs\clidexon Windows) and any temp files left by auto-update - The PATH entry the installer added to your shell config (
~/.zshrc,~/.bashrc, …) or Windows User PATH; it is kept if other programs still live in that folder - Runtime data in
~/.config/clidex(%USERPROFILE%\.config\clidexon Windows): pairing info and token, device ID, update-check state; the legacy~/.config/coding-cli; and on Windows the bundled shell extracted to%TEMP%\clidex
To keep your pairing so a reinstall doesn’t need clidex init again, set CLIDEX_KEEP_DATA=1 before the command (on Unix you can also use --uninstall --keep-data). Uninstalling never touches Claude Code / Codex’s own config (~/.claude, ~/.codex). If /usr/local/bin isn’t writable, the script prints the sudo rm command to run.
Connect your Clidex account
- Log in to the Clidex dashboard: https://dash.clidex.dev/login
- Open the CLI Access menu and copy the one-click pairing command shown on the page (in the form
clidex init https://api.clidex.dev <YOUR_TOKEN>) - Paste the command into your terminal and press Enter — seeing “✔ Paired successfully:
” means you’re connected
initonly needs to run once, and it validates the token immediately. The address must be the machine API endpoint starting withapi., not thedash.dashboard address — the command shown on the page already has this right, so just copy it as-is.
Start a session
cd into any project directory and simply run:
clidex
The first time you start in a project, you’ll be prompted to choose Claude / Codex before its native interactive terminal opens. The current directory is automatically bound as your workspace. If you’ve saved a choice for this project, later launches use it directly.
After choosing an agent, your first session with that agent type also asks whether to sync your local config and the current project’s session history — see “Sync Local Config & Session History” below.
Choose and remember an agent
Use ↑ / ↓ to switch between Claude and Codex, Enter to confirm, or Esc to cancel startup. “Remember this project’s choice” is checked by default. Press Space to uncheck it if you want to be asked on every launch.
clidex # Use the project's saved choice, or prompt if none is saved
clidex --choose-agent # Choose again and decide whether to remember it
clidex --claude # Use Claude for this session only
clidex --codex # Use Codex for this session only
clidex --choose-agent -w ~/project # Choose again for a specific workspace
--claude/--codexoverride this session only and leave the project’s saved choice unchanged. These flags and--choose-agentare mutually exclusive.- To restore the prompt on every launch, run
clidex --choose-agent, uncheck “Remember this project’s choice,” and confirm. - Choices are saved separately for each workspace directory. With
-w, the specified directory’s preference applies. Preferences are stored locally in~/.config/clidex/projects/, without adding files to your project. clidex connectandclidex maxfollow the same rules. Automatic account-switch reconnections keep the agent selected for this session.- In non-interactive environments such as pipes and scripts, the saved choice is used. If none exists, specify
--claudeor--codexexplicitly.
CLI Commands
| Command | Description |
|---|---|
clidex / clidex connect |
Requests an execution node and opens an interactive terminal (equivalent to connect when no subcommand is given) |
clidex max |
Same as clidex, but only allocates Max-tier subscription accounts — see “Premium Max” below |
clidex acp |
Connects Zed, JetBrains, VS Code, and other editors over ACP (beta, Claude only) — see “Editor Integration (ACP)” below |
clidex init <platform-address> <token> |
One-time account pairing — no need to pass the address or token again afterward |
clidex --auto-resume |
Configure a continuation prompt for account switches. Saves the setting and exits. Off by default |
clidex --load [claude|codex] |
Select local config and the current directory’s session history, upload them to the platform and exit — defaults to Claude |
clidex status |
Shows the billing mode, quota usage, and balance (--json for scripting) |
clidex tray |
Starts a standalone, persistent tray icon (without opening a session) |
clidex update |
Checks for and upgrades to the latest version (--check only checks, doesn’t install) |
clidex version |
Shows version and build information |
Common flags:
| Flag | Description |
|---|---|
--claude / --codex |
Override the agent for this session only, without changing the project’s saved choice |
--choose-agent |
Choose the project’s agent again and whether to remember it; mutually exclusive with --claude / --codex |
-w, --workspace |
The project directory to bind — defaults to the current directory |
--no-tray |
Don’t attach a tray icon when starting a session |
--accel |
Manually specify an acceleration channel (SSH / HTTP tunnel), useful on poor network conditions — see “Acceleration channel” below |
--direct |
Ignore the acceleration channel assigned by the platform and force a direct connection |
Common clidex status combinations:
clidex status # human-readable output
clidex status --json # for scripts / monitoring
Common clidex tray flags:
clidex tray --display used # show percentage as "used" instead of the default "remaining"
clidex tray --interval 60s --low-balance 20 # polling interval and low-balance alert threshold
-s/--addr,-t/--token, and similar flags are an escape hatch for connecting directly to a known node during local debugging — you don’t need them for normal use. Nodes are assigned automatically by the platform based on your subscription tier, and certificates are issued along with the session.
Sync Local Config & Session History
Bring the Claude / Codex setup you’ve already tuned on your machine, plus the session history of the current project, over to Clidex — new sessions feel just like home, and /resume picks up your earlier conversations.
How to sync
clidex --load # Sync Claude config and the current directory's session history
clidex --load codex # Sync Codex config and the current directory's session history
--load only uploads; it doesn’t open a session or read or change the project’s saved agent choice. Omitting the type still syncs Claude; use clidex --load codex to sync Codex. It cannot be combined with --choose-agent. After scanning, it first lists what was skipped, then shows a selection list:
↑/↓to move, Space to toggle,ato select all, Enter to confirm,Escto cancel- The selected items are packed and uploaded (with a progress bar); every new session picks them up automatically
- Each selected category is replaced as a whole: e.g. if you select skills, skills you deleted locally are deleted on the platform too; unselected categories stay as they are on the platform
- Press
Ctrl+Cduring the upload to exit — the whole upload is discarded and previously synced config is untouched - When not running in a terminal (pipes, scripts), no list is shown and everything is synced
You’ll be asked on your first session with each agent type: after clidex init, the first time you use Claude or Codex, its selection list asks whether to sync. Press Esc to skip and go straight into the session.
Syncing requires a positive account balance. With insufficient balance you’ll be asked to top up first, and the first-session prompt is skipped until your first session after topping up.
What gets synced
| Agent | Synced content |
|---|---|
| Claude | CLAUDE.md, rules, commands, agents, skills, output-styles, workflows, themes, keybindings.json, personal preferences in settings.json, and the current directory’s session history |
| Codex | AGENTS.md (including AGENTS.override.md), prompts, rules, skills (~/.agents/skills and ~/.codex/skills), and the current directory’s session history |
settings.json preferences
Only the following personal preferences in settings.json are synced; every other field is left out:
| Field | What it does |
|---|---|
theme |
Terminal color theme |
outputStyle |
Output style of responses |
language |
Language Claude responds in |
viewMode |
Display mode of the conversation view |
verbose |
Show full tool call output |
prefersReducedMotion |
Reduce UI animations |
spinnerVerbs |
Custom verbs shown while waiting |
spinnerTipsEnabled |
Show tips while waiting |
editorMode |
Input editing mode (normal / Vim) |
respectGitignore |
Hide .gitignored files when picking files with @ |
alwaysThinkingEnabled |
Enable extended thinking by default |
showThinkingSummaries |
Show summaries of the thinking process |
showTurnDuration |
Show how long each turn took |
timeFormat |
Time display format |
timeZone |
Time zone |
attribution |
Attribution text in Git commits and PRs |
includeCoAuthoredBy |
Add a Co-Authored-By trailer to commits |
- A value is only updated when it changed locally, so settings you changed in a session via
/configwon’t be reverted - Values the platform doesn’t support (e.g.
custom:themes) are listed in the scan summary and skipped
Other notes
- Not synced: the
env,hooks,permissions,modeland other fields ofsettings.json, as well asconfig.toml, MCP, plugins and memory (memory/). These can point sessions at other API endpoints or run machine-specific commands, so they don’t belong in the cloud - Scripts inside skills keep working in sessions
- Symlinks are followed; directories like
.gitandnode_modulesare skipped - Limits: 1 MB per file, 20 MB and at most 2000 files of config in total; anything over the limit is listed in the scan summary
Session history
- Only the current working directory’s sessions are synced (the current directory, or the one given with
-w; sessions started in subdirectories don’t count). To sync another project,cdinto it and runclidex --loadorclidex --load codexagain; if the current directory has no local session records, that item won’t appear in the list - After syncing, start the matching agent (
clidex --claudeorclidex --codex) in the same directory and use/resumeto pick up where you left off. You can also runclidexif the saved or prompted choice matches that agent - Reasoning content is removed on import: it’s bound to the model and account that produced it, fails verification on the platform’s accounts, and would prevent the session from being resumed. The surrounding messages are re-linked, so the conversation itself is unaffected
- Sessions that already exist on the platform aren’t overwritten (you may have continued them there); they’re only updated when you’ve continued the conversation further locally
- Limits: 50 MB per session, 200 MB in total
Premium Max
Users whose balance meets the platform threshold can open sessions on Max-tier subscription accounts only:
clidex max # Use the project's saved agent, or prompt if none is saved
clidex --claude max # Claude, Claude Max subscription accounts only
clidex --codex max # Codex, ChatGPT Pro (including Pro Lite) subscription accounts only
- Balance threshold: your balance must be at least the threshold set by the platform. Otherwise the session is refused and the terminal shows the threshold and your current balance — top up and retry, or drop
maxto use normal allocation - Automatic fallback when no Max account is available: the session still opens on a regular account, and the terminal tells you no Max account was available this time — you’re never locked out
- Automatic account switching also prefers Max: when the account’s quota hits the threshold mid-session and Clidex switches accounts, it still prefers a Max account and only falls back when none is available
- Other flags work as usual, e.g.
clidex max -w ~/project --no-tray
Editor Integration (ACP)
Beta: Editor integration is in beta and supports Claude only.
Clidex supports ACP (Agent Client Protocol). Zed, JetBrains IDEs, VS Code, and other ACP-compatible editors can add Clidex as an agent and run the official Claude Code inside the editor. Your machine runs Claude Code’s official ACP adapter, and the official Claude Code still sends every model request.
Requirements
- Clidex CLI installed and connected to your account
- Node.js installed locally. It runs the official ACP adapter, which is downloaded automatically through npx on first use
Configuration
ACP is a standard protocol, so every editor uses the same setup: add an agent whose command is clidex acp. In Zed, add this to settings.json:
{
"agent_servers": {
"Clidex": { "command": "clidex", "args": ["acp"] }
}
}
JetBrains IDEs read the same content from ~/.jetbrains/acp.json. VS Code and other ACP-compatible editors work the same way: add an agent whose command is clidex acp.
To get Max subscription accounts only, change the arguments to ["acp", "--max"]. The rules match Premium Max.
How it works
- Each editor session is a Clidex native session, billed by actual token usage
- Session history lists this project’s sessions on the platform, including
clidexterminal sessions, so you can load one and keep going. Long sessions replay only the most recent part, and the full context stays in the session - Tools run on your machine just like terminal sessions, and your local MCP servers stay available. MCP servers the editor configures for a session also run locally, and the editor’s entry wins on a name clash
- Permission prompts, mode switching, and file diffs are shown by the editor
- Your local
~/.claudeis never read or written, so local Claude Code sessions and settings stay separate - When an account reaches its quota threshold, Clidex switches accounts and continues the same conversation. The running turn follows your continuation prompt setting. If that is off, the turn ends with an error and you can send “continue”. Queued messages are answered on the new account as usual
- After a network drop of up to 60 seconds, the same conversation resumes automatically. The running turn ends with an error, so check it and resend or send “continue”
- If an idle session is reclaimed, it resumes automatically when you send the next message
Known limitations
- Claude only. Codex is not supported yet
- A new session needs a node and a fresh runtime, so expect a wait of about ten seconds
- File paths in the editor are runtime paths (
/workspace/...) - Forking and deleting sessions are not supported
API Access
Besides sessions, Codex (OpenAI) models can be called directly through an OpenAI-compatible API:
| Item | Details |
|---|---|
| Base URL | https://api.clidex.dev/v1 |
| Endpoints | POST /v1/responses, POST /v1/chat/completions, GET /v1/models, GET /v1/user/balance (available balance; works with usage queries in tools like CC Switch) |
| Auth | Authorization: Bearer <YOUR_TOKEN> — the same token you use with clidex init, created and shown on the console’s CLI Access page |
| Models | Whatever GET /v1/models returns; currently Codex (OpenAI) models only |
curl https://api.clidex.dev/v1/models \
-H "Authorization: Bearer <YOUR_TOKEN>"
curl https://api.clidex.dev/v1/responses \
-H "Authorization: Bearer <YOUR_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"model": "<a model from the list above>", "input": "Hello"}'
With the OpenAI SDK, set base_url to https://api.clidex.dev/v1 and api_key to your token.
- Billing: same price as sessions, charged to your balance per actual token; the token’s spending limit also applies
- Usage: the console’s Usage page can filter by source; API calls are marked
API - Common errors:
401invalid or expired token;402insufficient balance or token limit reached;403account disabled
Using it in the Codex CLI
To use API Access from your local Codex CLI, edit two files under ~/.codex (%USERPROFILE%\.codex on Windows).
Editing
auth.jsonreplaces Codex’s existing ChatGPT sign-in, so back it up first. To keep both, see “Keeping your ChatGPT sign-in” below.
1. auth.json: store your token
{
"auth_mode": "apikey",
"OPENAI_API_KEY": "<YOUR_TOKEN>"
}
Or write it with a command, which does the same thing:
echo "<YOUR_TOKEN>" | codex login --with-api-key
2. config.toml: add Clidex and make it the default
model_provider = "clidex"
model = "<a model returned by GET /v1/models>"
[model_providers.clidex]
name = "Clidex"
base_url = "https://api.clidex.dev/v1"
wire_api = "responses"
requires_openai_auth = true
- The first two lines are top-level settings and must come before any
[...]section in the file; otherwise they’re read as part of the section above them requires_openai_auth = truemakes Codex read the token fromauth.json; don’t also setenv_key, or Codex will read it from an environment variable instead
Save, then just run codex.
Keeping your ChatGPT sign-in: put the two files above in a separate directory and point CODEX_HOME at it. That directory only holds these two files; copy over skills, MCP and other settings from ~/.codex if you need them:
mkdir -p ~/.codex-clidex # put the auth.json and config.toml above in it
CODEX_HOME=~/.codex-clidex codex
$env:CODEX_HOME = "$HOME\.codex-clidex"; codex
These settings only affect Codex on your machine. Clidex sessions don’t sync config.toml or auth.json, so sessions keep using native subscription accounts.
How It Works
Credential quota threshold reached: automatic account switch with session continuation
Each account may have multiple upstream AI credentials bound to it. When the credential currently in use approaches the usage threshold set by the platform, the platform proactively closes the current session and has the client re-request one — the entire process requires no manual intervention:
- The terminal prints a notice:
Current account's credential quota is low, switching accounts and resuming your session (attempt N/3, retrying in X) ... - The CLI keeps this session’s selected agent (Claude / Codex), automatically re-requests a session from the platform, and receives a new credential and execution node
- Your previous conversation context is carried over — there’s no need to restate your request
- Retry intervals increase with each attempt (2s, 4s, 6s), up to 3 automatic reconnect attempts; if it still fails, you’ll get a clear error prompting you to manually run
clidex connectagain - Sessions started with
clidex maxalso prefer a Max account when switching
This mechanism requires no user intervention — during the process you’ll only see the terminal briefly pause while it prints the switch notice.
Auto-send a continuation prompt
If an account switch interrupts a running task, Clidex can send a custom prompt after restoring the original conversation. For example, use “Continue the previous task and run the tests when you finish.” This option is off by default and applies to both Claude Code and Codex.
- CLI. Run
clidex --auto-resume, selectonwith the arrow keys, enter your prompt, and press Enter to save. - Desktop. Go to Settings → Configuration → Auto-resume sessions. Enable the option, edit Message to send, and save.
Clidex sends the prompt when the agent was generating or running a tool at the time of the switch, the original conversation was restored, and you haven’t started interacting with the session in the meantime. Use a single line of up to 200 characters starting with a character other than ! or /.
Insufficient balance / no accounts available: new sessions are refused, running sessions are not cut off
If your balance is insufficient, or the execution layer isn’t temporarily ready and the account pool has no node to assign, the platform will not forcibly interrupt a session that’s already running. Instead, it refuses outright whenever you request a new session — including the very first clidex connect, as well as the automatic account-switch reconnection described above. The reason for the refusal is generated by the platform and printed directly in the terminal (e.g., insufficient balance, no accounts available, etc.). When this happens, you need to top up in the dashboard or contact an administrator — it won’t resolve itself automatically.
The tray: your only window into the automatic switching above
By default, clidex / clidex connect attaches a ring-progress icon to your menu bar / notification area (disable with --no-tray), which automatically disappears when the session ends; you can also run clidex tray to keep it running persistently on its own. It’s the only place, while you’re coding, where you can see events the platform doesn’t otherwise announce — like low-balance alerts:
- Pay-as-you-go: the icon shows your balance directly, turning yellow below
--low-balance(default $5) and red below a fifth of that - When status can’t be read, it shows
?, distinct from an actual “zero usage” state
Acceleration channel and auto-update (supporting mechanisms)
- On poor network conditions (cross-border routing, ISP detours), a session can route the underlying TCP through an SSH / HTTP relay; TLS is still negotiated end-to-end between the client and the execution node, so the relay only forwards bytes and never sees the content. If the channel can’t connect, it automatically falls back to a direct connection rather than blocking the session.
clidex connect/statuscheck for a new version in the background at most once per day; if a new version is available, it’s downloaded and swapped in the background while your session keeps running, with a notice shown once the session ends — the next launch will use the new version. Set the environment variableCLIDEX_AUTO_UPDATE=0to only notify without auto-switching, orCLIDEX_UPDATE_CHECK=0to skip the check entirely.