Skip to content

fix(provider): TrustedRouter provider - #4102

Open
jperla wants to merge 1 commit into
tailcallhq:mainfrom
jperla:add-trustedrouter
Open

jperla wants to merge 1 commit into
tailcallhq:mainfrom
jperla:add-trustedrouter

Conversation

@jperla

@jperla jperla commented Nov 20, 2026

Copy link
Copy Markdown

Summary

Add TrustedRouter as a built-in provider. TrustedRouter is an OpenAI-compatible gateway, so this uses the existing OpenAI response type with no new transport code, declared the same way as open_router, requesty and orca_router.

crates/forge_repo/src/provider/provider.json

  • trusted_router entry, response type OpenAI
  • Chat: https://api.trustedrouter.com/v1/chat/completions
  • Models: https://api.trustedrouter.com/v1/models (public, OpenRouter-shaped, fetched live)
  • Auth: API key (TRUSTEDROUTER_API_KEY)

crates/forge_domain/src/provider.rs

  • ProviderId::TRUSTED_ROUTER, registered in built_in_providers()
  • "TrustedRouter" display name and "trusted_router" FromStr arm
  • Tests: test_trusted_router_from_str, test_trusted_router_display_name, test_trusted_router_in_built_in_providers; extended the aggregate display-name and built-in tests

crates/forge_repo/src/provider/provider_repo.rs

  • test_trusted_router_config covering id, env var, response type, chat URL and models URL

Usage

  1. Get an API key at https://trustedrouter.com (docs: https://trustedrouter.com/docs)
  2. forge provider login trusted_router and enter the key (or set TRUSTEDROUTER_API_KEY)
  3. Pick a model via /model; ids are vendor-prefixed (e.g. anthropic/claude-sonnet-4.5), and trustedrouter/auto routes automatically

Verification

cargo test -p forge_domain
# test result: ok. 618 passed; 0 failed (includes the 3 new trusted_router tests)
cargo clippy -p forge_domain --all-targets -- -D warnings
# clean
cargo fmt --all -- --check
# no diffs in touched files

forge_repo needs protoc to build, which I don't have locally, so test_trusted_router_config will be exercised by CI; it mirrors test_orca_router_config with only the literals changed. provider.json parses and has no duplicate ids.

Disclosure: I work on TrustedRouter.

Add TrustedRouter as a built-in OpenAI-compatible provider. Models are
fetched from https://api.trustedrouter.com/v1/models and authentication
uses TRUSTEDROUTER_API_KEY.
@CLAassistant

CLAassistant commented Nov 20, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added type: fix Iterations on existing features or infrastructure. type: provider Updates provider.json configuration. labels Nov 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure. type: provider Updates provider.json configuration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants