Skip to content

[codex] Support Anthropic-compatible base URLs#326

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

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

Conversation

@2233admin

@2233admin 2233admin commented Jun 4, 2026

Copy link
Copy Markdown

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
@1jehuang 1jehuang added the triage:converted PR triage: worth tracking as an issue label Jun 12, 2026
@1jehuang

Copy link
Copy Markdown
Owner

Thanks! This repo no longer accepts external PRs, but the underlying problem is real - it's now tracked in #362 (with credit to this PR). Closing.

@1jehuang 1jehuang closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:converted PR triage: worth tracking as an issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Anthropic-compatible base URLs for direct Anthropic provider

2 participants