claudex

skill
Guvenlik Denetimi
Uyari
Health Uyari
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 26 GitHub stars
Code Uyari
  • process.env — Environment variable access in scripts/build-release.ts
  • process.env — Environment variable access in src/claudex.ts
Permissions Gecti
  • Permissions — No dangerous permissions requested
Purpose
This is a Bun-based launcher that runs Claude Code against an OpenAI-compatible endpoint, translating Anthropic API requests to OpenAI's Codex/Responses API. It acts as a proxy to let developers use OpenAI models within the Claude Code environment.

Security Assessment
The tool reads sensitive authentication data, including API keys, ChatGPT bearer tokens, and OAuth refresh tokens from local configuration files. It also makes external network requests to upstream APIs (like chatgpt.com) and automatically refreshes expired tokens. The codebase accesses environment variables to read these credentials and configuration settings. No hardcoded secrets or dangerous shell executions were found. No highly dangerous permissions are requested. Because it handles sensitive tokens and communicates externally, the overall risk is Medium.

Quality Assessment
The project is actively maintained, with its last push occurring very recently. It has a small but present community footprint with 26 GitHub stars, indicating some level of peer review and usage. However, the repository lacks a license file, which is a significant concern. Without a defined license, the legal terms of use, modification, and distribution are technically "all rights reserved" by the author, which may restrict enterprise adoption.

Verdict
Use with caution — the tool is active and functional, but handle it carefully due to its access to sensitive tokens and the absence of an open-source license.
SUMMARY

use codex model on claude code

README.md

claudex

claudex is a Bun-based launcher that runs Claude Code against an OpenAI-compatible endpoint.

You can download binaries from Releases.

Local usage

  1. Install dependencies:
bun install
  1. Ensure Codex auth file exists (config is optional but recommended):
~/.codex/auth.json
~/.codex/config.toml
  1. Run:
./claudex

Wrapper flags:

  • --model <id> / --upstream-model <id>: override the upstream OpenAI model for this run only. claudex consumes this flag itself and does not forward it to the Claude binary.
  • --no-safe: disables CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 for that run.
  • By default, claudex enables safe mode (CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1).

Example:

./claudex --model gpt-5.5-chat

Optional environment variables:

  • CLAUDEX_FORCE_MODEL (used when no CLI --model / --upstream-model is given; otherwise CLI wins. Default: value of model from ~/.codex/config.toml; fallback: gpt-5.3-codex)
  • CLAUDEX_DEFAULT_REASONING_EFFORT (default: xhigh)
  • CLAUDEX_CLAUDE_BIN
  • CLAUDEX_CODEX_CONFIG (overrides ~/.codex/config.toml)
  • CLAUDEX_CODEX_AUTH (overrides ~/.codex/auth.json)
  • CLAUDEX_MODEL_PROVIDER (overrides model_provider selection)
  • CLAUDEX_UPSTREAM_BASE_URL (force endpoint URL)
  • CLAUDEX_UPSTREAM_WIRE_API (messages or responses; overrides provider wire_api)
  • CLAUDEX_UPSTREAM_API_KEY (force API key)
  • CLAUDEX_UPSTREAM_BEARER_TOKEN (force bearer token for ChatGPT token mode)
  • CLAUDEX_CHATGPT_BEARER_TOKEN (alias of CLAUDEX_UPSTREAM_BEARER_TOKEN)
  • CLAUDEX_CHATGPT_ACCOUNT_ID (override ChatGPT-Account-Id header)
  • CLAUDEX_CHATGPT_BASE_URL (default: https://chatgpt.com/backend-api/codex)
  • CLAUDEX_CHATGPT_DEFAULT_MODEL (default: gpt-5-codex when ChatGPT mode is active and no model is explicitly configured)
  • CLAUDEX_FORCE_LOGIN_METHOD (default: console; set to none to disable injection)
  • CLAUDEX_PORT
  • CLAUDEX_DEBUG=1

Authentication note:

  • Priority is:
    1. Use model_provider / CLAUDEX_UPSTREAM_BASE_URL when resolvable, authenticated via API key.
    2. If no provider is resolvable, fall back to official ChatGPT endpoint (https://chatgpt.com/backend-api/codex) and use tokens.access_token (then tokens.id_token) from ~/.codex/auth.json.
  • When the upstream uses wire_api = "responses" (or ChatGPT fallback mode), claudex now translates Anthropic POST /v1/messages requests, tools, and tool results to the OpenAI Responses API and maps streamed tool calls back into Anthropic tool_use blocks.
  • In token mode, claudex automatically refreshes expired tokens via tokens.refresh_token when possible.
  • In token mode, if tokens.account_id exists, claudex sends it as ChatGPT-Account-Id.
  • To avoid model-availability errors on ChatGPT accounts, claudex uses gpt-5-codex as the implicit default model in ChatGPT mode (unless you explicitly set model or CLAUDEX_FORCE_MODEL).
  • claudex sets ANTHROPIC_API_KEY to the upstream bearer credential and, unless you pass --settings yourself, injects --settings {"forceLoginMethod":"console"} to avoid Claude.ai-subscription-first login flows.

Quality gates

  • Typecheck: bun run typecheck
  • Tests: bun test
  • bun test includes an integration test that round-trips Anthropic tool_use / tool_result through a Responses upstream mock (tests/proxy.integration.test.ts).
  • Combined check: bun run check
  • Enable local git hook: bun run setup:hooks

Automated release

GitHub Actions runs on every push to main and once per day:

  1. Fetches the latest install.sh from https://claude.ai/install.sh.
  2. Extracts GCS_BUCKET from that script and reads the latest Claude Code version.
  3. On push to main, always creates a rolling release tag claude-vX.Y.Z-build.<run_number>.
  4. On scheduled/manual runs, creates claude-vX.Y.Z only when that upstream version is not released yet.
  5. Builds claudex binaries for Linux, macOS, and Windows via Bun --compile.
  6. Publishes a GitHub release with those binaries.

Yorumlar (0)

Sonuc bulunamadi