[WIP] feat: support custom endpoints for built-in providers#2502
[WIP] feat: support custom endpoints for built-in providers#2502VrianCao wants to merge 6 commits intoantinomyhq:mainfrom
Conversation
- extend URL param collection/defaults across API key, OAuth code, and device flows - switch Codex and Claude Code custom endpoints to BYOK while keeping provider semantics - template built-in provider URLs so endpoint overrides persist through repo/service rendering Co-Authored-By: ForgeCode <noreply@forgecode.dev>
- compare Codex and Claude Code endpoints against fixed official baselines - normalize equivalent URLs before deciding whether to switch OAuth flows to BYOK - add regression tests for canonicalization and official baseline comparisons Co-Authored-By: ForgeCode <noreply@forgecode.dev>
Resolve the remaining provider catalog conflict by keeping the built-in endpoint override support and taking the latest upstream Codex model catalog updates. Co-Authored-By: ForgeCode <noreply@forgecode.dev>
|
Hey @VrianCao thanks for this PR. One insight i would like to suggest is you can override existing provider by defining a new provider.json on You can create new providers also in ~/forge/provider.json and it will be listed in provider list. Let me know if u need help in that? |
|
Thanks @amitksingh1490 — this is helpful, and yes, I’m aware Forge already supports overriding providers via I think the goal of this PR / feature is a bit broader than only exposing that internal override path, though. What we want to achieve is more of a first-class UI/UX around endpoint configuration, so users can do this through the normal For most providers, I agree we should try to reuse the existing provider endpoint rewrite / merge system as much as possible rather than inventing a parallel mechanism. The main thing missing today is the official UX layer on top of it. The special case is For those two providers, a custom endpoint is not just “same provider, different base URL”. In some enterprise setups, Claude Code / Codex is reverse-proxied behind an internal gateway. Employees authenticate to that gateway using a standard API key, but the gateway ultimately forwards the request upstream as Claude Code / Codex. That means the request still has to preserve the original provider semantics — request shape, special headers, beta flags, tool behavior, etc. In other words:
So for This is still WIP on our side, and we’re actively thinking about how to make the whole flow simpler, smoother, and lower-friction for users. So your suggestion is definitely useful, especially for the general provider-config story — we just also need to account for the Codex / Claude Code-specific behavior. |
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
|
Action required: PR inactive for 5 days. |
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
What
codexandclaude_codecustom-endpoint logins to BYOK while keeping provider request semantics and headersNotes
endpointdecides auth/routing mode, whileproviderkeeps request semanticscodexandclaude_code, custom endpoints only change the endpoint and preserve the existing auth modeVerification
cargo test -p forge_services --libcargo test -p forge_repo --libcargo test -p forge_main --libcargo test -p forge_infra --libcargo test -p forge_domain --libcargo +homebrew-local clippy -p forge_domain -p forge_services -p forge_repo -p forge_main -p forge_infra --all-targets -- -D warningsFollow-up
Refs #2490