Skip to content

[WIP] feat: support custom endpoints for built-in providers#2502

Open
VrianCao wants to merge 6 commits intoantinomyhq:mainfrom
VrianCao:feat/2490-built-in-provider-endpoints
Open

[WIP] feat: support custom endpoints for built-in providers#2502
VrianCao wants to merge 6 commits intoantinomyhq:mainfrom
VrianCao:feat/2490-built-in-provider-endpoints

Conversation

@VrianCao
Copy link

@VrianCao VrianCao commented Mar 8, 2026

What

  • add first-class endpoint overrides for built-in providers via templated provider URLs and default URL params
  • carry URL params through API key, OAuth code, and device auth flows
  • switch codex and claude_code custom-endpoint logins to BYOK while keeping provider request semantics and headers

Notes

Verification

  • cargo test -p forge_services --lib
  • cargo test -p forge_repo --lib
  • cargo test -p forge_main --lib
  • cargo test -p forge_infra --lib
  • cargo test -p forge_domain --lib
  • cargo +homebrew-local clippy -p forge_domain -p forge_services -p forge_repo -p forge_main -p forge_infra --all-targets -- -D warnings

Follow-up

  • manual CLI smoke testing is still pending

Refs #2490

- 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>
@CLAassistant
Copy link

CLAassistant commented Mar 8, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Mar 8, 2026
@VrianCao VrianCao changed the title feat: support custom endpoints for built-in providers [WIP] feat: support custom endpoints for built-in providers Mar 8, 2026
VrianCao and others added 3 commits March 8, 2026 13:27
- 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>
@amitksingh1490
Copy link
Contributor

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 ~/forge repo. So we if can support the ui to override settings and save the file in ~/forge/provider.json. It should work.

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?

@VrianCao
Copy link
Author

VrianCao commented Mar 8, 2026

Thanks @amitksingh1490 — this is helpful, and yes, I’m aware Forge already supports overriding providers via ~/forge/provider.json.

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 forge provider login flow instead of having to manually edit provider.json.

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 codex and claude_code.

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:

  • the endpoint decides the auth mode / routing
  • the provider still decides the request semantics

So for codex / claude_code, when the endpoint is customized, we intentionally want API key auth to the gateway, while still keeping the original Codex / Claude Code request format intact.

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>
@github-actions
Copy link

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Mar 13, 2026
Co-Authored-By: ForgeCode <noreply@forgecode.dev>
@VrianCao VrianCao marked this pull request as ready for review March 13, 2026 14:19
@github-actions github-actions bot removed the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants