feat: add TrustedRouter as an OpenAI-compatible provider - #2194
Open
jperla wants to merge 1 commit into
Open
Conversation
TrustedRouter speaks the OpenAI Chat Completions API, so it is a single ProviderMap entry — plugin_registry picks it up from there automatically. BuildEnvVariable maps the name to TRUSTEDROUTER_API_KEY, and the REST config handlers gain the matching field alongside the other providers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds TrustedRouter to the OpenAI-compatible provider list.
TrustedRouter is an OpenAI-compatible router — one key reaches models from OpenAI, Anthropic, Google, DeepSeek and others, with per-request routing and failover. Base URL is
https://api.trustedrouter.com/v1.Since it speaks Chat Completions, this is a single
ProviderMapentry;plugin_registry.goalready iterates that map, so no registration code is needed.BuildEnvVariablederivesTRUSTEDROUTER_API_KEYfrom the provider name automatically.The REST config handlers get the matching field next to the other providers, so the key can be set through
/config/updateand shows up masked inGET /config.ImplementsResponsesis false — TrustedRouter exposes Chat Completions, not the Responses API.Verified:
go build ./...clean,go test ./internal/plugins/ai/openai_compatible/... ./internal/server/...passes,gofmtclean. Added aTestCreateClientcase alongside the existing provider cases.