Skip to content

[codex] Support Anthropic-compatible base URLs#326

Open
2233admin wants to merge 1 commit into
1jehuang:masterfrom
2233admin:codex/anthropic-compatible-base-url
Open

[codex] Support Anthropic-compatible base URLs#326
2233admin wants to merge 1 commit into
1jehuang:masterfrom
2233admin:codex/anthropic-compatible-base-url

Conversation

@2233admin
Copy link
Copy Markdown

@2233admin 2233admin commented Jun 4, 2026

Closes #325

Summary

  • Honor ANTHROPIC_BASE_URL for non-OAuth direct Anthropic Messages requests and model-catalog refreshes.
  • Add ANTHROPIC_AUTH_TOKEN support for bearer-token Anthropic-compatible gateways/proxies.
  • Preserve existing behavior for Claude OAuth and official Anthropic API keys: OAuth stays on the official OAuth endpoint, and API keys keep using x-api-key.
  • Update Anthropic auth-status detection and test env isolation so bearer-token direct auth is visible without polluting unrelated tests.

Validation

  • cargo test -p jcode-base provider::anthropic --lib
  • cargo test -p jcode-base provider::models::catalog --lib
  • cargo test -p jcode-base auth::active_method --lib
  • cargo test -p jcode-base full_and_fast_auth_status_match_for_shared_probe_fields --lib
  • cargo check -p jcode-base --all-targets
  • rustfmt --edition 2024 --config skip_children=true --check <touched Rust files>

Local notes

  • cargo fmt --all -- --check reports unrelated formatting churn in untouched modules with my local stable Rust 1.96 checkout.
  • cargo clippy -p jcode-base --lib -- -D warnings currently stops on pre-existing warnings outside this patch (jcode-core/src/stdin_detect.rs, jcode-render-core/src/markdown.rs).
  • cargo check -p jcode-base --all-targets --all-features is not a clean Windows local signal here: it stops in tikv-jemalloc-sys before checking this patch because the Windows/MSVC all-features path expects a Unix sh/jemalloc configure environment.

@2233admin 2233admin force-pushed the codex/anthropic-compatible-base-url branch from c2dad58 to b25c311 Compare June 4, 2026 21:46
@2233admin 2233admin marked this pull request as ready for review June 4, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Anthropic-compatible base URLs for direct Anthropic provider

1 participant