From 1bc0cd116682679cc801d2e047e1d004aa0b5ad4 Mon Sep 17 00:00:00 2001 From: Joseph Perla Date: Thu, 19 Nov 2026 14:22:43 -0800 Subject: [PATCH 1/3] Add TrustedRouter to the desktop model provider screen A TrustedRouter row on Connect your AI and in Settings, between Unbiased AI and the custom endpoint. TrustedRouter is an OpenAI-compatible gateway in front of many providers and has no sign-in, so the row offers only the API key tab: OpenBot fills in https://api.trustedrouter.com/v1 and the model anthropic/claude-sonnet-5.5, and the person pastes a key. The key travels as a compatible-endpoint key, exactly as a typed Unbiased AI key does, so nothing after the screen changes. The model list reads the gateway's public /models, which the catalogue already does for any compatible endpoint. The row follows the Unbiased AI endpoint path file for file: the catalogue and its tests, the endpoint preset and key link in both apps, the host that names the connection for the server and for Settings, the AiConnectionProvider enum (client regenerated with bun run api:generate), the model check's list of gateways it leaves open, the vendored mark from TrustedRouter's media kit, and the changelog. --- CHANGELOG.md | 5 +++ api/openapi.yaml | 7 ++-- api/openapi/model-connections.yaml | 15 +++++---- app/src/lib/ai-connection/providers.ts | 14 ++++++++ .../api/generated/model/aiConnectionInput.ts | 2 +- .../api/generated/model/aiConnectionLogin.ts | 2 +- .../generated/model/aiConnectionProvider.ts | 3 +- .../lib/api/generated/models/models.zod.ts | 27 ++++++++------- app/src/lib/desktop/ai-connection.ts | 1 + app/tests/ai-connection-dialog.test.tsx | 1 + app/tests/ai-connection-providers.test.ts | 2 +- desktop/src-tauri/src/ai_connection.rs | 18 ++++++++-- desktop/src-tauri/src/provider.rs | 33 +++++++++++++++++-- desktop/src/ProviderPicker.test.tsx | 14 ++++++-- desktop/src/ProviderPicker.tsx | 9 +++++ desktop/src/setupLayout.browser.test.ts | 2 ++ docs/releasing.md | 3 +- scripts/model-compat.ts | 4 +++ shared/marks/README.md | 1 + shared/marks/trustedrouter.svg | 1 + 20 files changed, 130 insertions(+), 34 deletions(-) create mode 100644 shared/marks/trustedrouter.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b521e1877..d9a575b795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,11 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged. ### OpenBot Desktop +- **TrustedRouter is on the Connect your AI screen**, and in Settings where the AI connection is + changed. TrustedRouter is an OpenAI-compatible gateway in front of many providers. A TrustedRouter + API key is all the row asks for: OpenBot fills in `https://api.trustedrouter.com/v1` and the model + `anthropic/claude-sonnet-5.5`, which can be changed to any name the gateway lists. The model list + reads the gateway's `/models`, as it does for any other compatible endpoint. - **Install on a computer with an earlier OpenBot install** sets up the software OpenBot runs on again when it is gone. On Windows, after Podman was removed, the window stayed on "Setting up this computer" after sign-in, because Install took the old install as done. diff --git a/api/openapi.yaml b/api/openapi.yaml index 058774ef9c..0b58447021 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -25058,17 +25058,18 @@ components: description: Its name, as a model picker shows it. AiConnectionProvider: type: string - description: 'The AI provider OpenBot''s Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI''s API, at an address given.' + description: 'The AI provider OpenBot''s Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI''s API, at an address given.' enum: - openai - anthropic - google - xai - unbiased + - trustedrouter - openai-compatible AiConnectionLogin: type: string - description: 'How OpenBot signs in to the provider. plan: the person''s Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person''s Google or xAI sign-in (google, xai).' + description: 'How OpenBot signs in to the provider. plan: the person''s Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person''s Google or xAI sign-in (google, xai).' enum: - plan - api-key @@ -25156,7 +25157,7 @@ components: AiConnectionInput: type: object additionalProperties: false - description: The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased and openai-compatible take endpoint. Any other pair is refused. + description: The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased, trustedrouter and openai-compatible take endpoint. Any other pair is refused. required: - provider - login diff --git a/api/openapi/model-connections.yaml b/api/openapi/model-connections.yaml index bab0c4b36b..64c4068bd5 100644 --- a/api/openapi/model-connections.yaml +++ b/api/openapi/model-connections.yaml @@ -766,17 +766,17 @@ components: description: >- The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. - openai-compatible: any server that speaks OpenAI's API, at an address - given. - enum: [openai, anthropic, google, xai, unbiased, openai-compatible] + trustedrouter: TrustedRouter. openai-compatible: any server that + speaks OpenAI's API, at an address given. + enum: [openai, anthropic, google, xai, unbiased, trustedrouter, openai-compatible] AiConnectionLogin: type: string description: >- How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, - a key (google, xai, unbiased, openai-compatible). oauth: the person's - Google or xAI sign-in (google, xai). + a key (google, xai, unbiased, trustedrouter, openai-compatible). + oauth: the person's Google or xAI sign-in (google, xai). enum: [plan, api-key, endpoint, oauth] AiConnectionSaved: type: object @@ -865,8 +865,9 @@ components: additionalProperties: false description: >- The connection to switch to. openai and anthropic take plan or - api-key; google and xai take endpoint or oauth; unbiased and - openai-compatible take endpoint. Any other pair is refused. + api-key; google and xai take endpoint or oauth; unbiased, + trustedrouter and openai-compatible take endpoint. Any other pair is + refused. required: [provider, login] properties: provider: diff --git a/app/src/lib/ai-connection/providers.ts b/app/src/lib/ai-connection/providers.ts index 9102f5084a..d39d3a8bdb 100644 --- a/app/src/lib/ai-connection/providers.ts +++ b/app/src/lib/ai-connection/providers.ts @@ -66,6 +66,14 @@ export const AI_PROVIDERS: AiProvider[] = [ logins: ["oauth", "endpoint"], mark: "unbiased", }, + { + id: "trustedrouter", + name: "TrustedRouter", + summary: "Use a TrustedRouter API key for models from many providers.", + keySummary: "Use a TrustedRouter API key for models from many providers.", + logins: ["endpoint"], + mark: "trustedrouter", + }, { id: "openai-compatible", name: "Any OpenAI-compatible endpoint", @@ -104,6 +112,12 @@ export const ENDPOINT_PRESETS: Partial< keyUrl: "https://platform.unbiased.ai/dashboard/keys", keyLink: "Get an Unbiased AI API key", }, + trustedrouter: { + baseUrl: "https://api.trustedrouter.com/v1", + model: "anthropic/claude-sonnet-5.5", + keyUrl: "https://trustedrouter.com/console/api-keys", + keyLink: "Get a TrustedRouter API key", + }, }; /** diff --git a/app/src/lib/api/generated/model/aiConnectionInput.ts b/app/src/lib/api/generated/model/aiConnectionInput.ts index 7e71271c3d..8e5feaa085 100644 --- a/app/src/lib/api/generated/model/aiConnectionInput.ts +++ b/app/src/lib/api/generated/model/aiConnectionInput.ts @@ -5,7 +5,7 @@ import type { AiConnectionLogin } from "./aiConnectionLogin"; import type { AiConnectionProvider } from "./aiConnectionProvider"; /** - * The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased and openai-compatible take endpoint. Any other pair is refused. + * The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased, trustedrouter and openai-compatible take endpoint. Any other pair is refused. */ export interface AiConnectionInput { provider: AiConnectionProvider; diff --git a/app/src/lib/api/generated/model/aiConnectionLogin.ts b/app/src/lib/api/generated/model/aiConnectionLogin.ts index 97713b3880..ad11ff8d0e 100644 --- a/app/src/lib/api/generated/model/aiConnectionLogin.ts +++ b/app/src/lib/api/generated/model/aiConnectionLogin.ts @@ -3,7 +3,7 @@ */ /** - * How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai). + * How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai). */ export type AiConnectionLogin = (typeof AiConnectionLogin)[keyof typeof AiConnectionLogin]; diff --git a/app/src/lib/api/generated/model/aiConnectionProvider.ts b/app/src/lib/api/generated/model/aiConnectionProvider.ts index 086d64ca3f..31e1865d78 100644 --- a/app/src/lib/api/generated/model/aiConnectionProvider.ts +++ b/app/src/lib/api/generated/model/aiConnectionProvider.ts @@ -3,7 +3,7 @@ */ /** - * The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI's API, at an address given. + * The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given. */ export type AiConnectionProvider = (typeof AiConnectionProvider)[keyof typeof AiConnectionProvider]; @@ -14,5 +14,6 @@ export const AiConnectionProvider = { google: "google", xai: "xai", unbiased: "unbiased", + trustedrouter: "trustedrouter", "openai-compatible": "openai-compatible", } as const; diff --git a/app/src/lib/api/generated/models/models.zod.ts b/app/src/lib/api/generated/models/models.zod.ts index 4925f8d638..58ce1a1dbc 100644 --- a/app/src/lib/api/generated/models/models.zod.ts +++ b/app/src/lib/api/generated/models/models.zod.ts @@ -264,10 +264,11 @@ export const GetAiConnectionResponse = zod "google", "xai", "unbiased", + "trustedrouter", "openai-compatible", ]) .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", ), zod.null(), ]) @@ -277,7 +278,7 @@ export const GetAiConnectionResponse = zod zod .enum(["plan", "api-key", "endpoint", "oauth"]) .describe( - "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", + "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", ), zod.null(), ]) @@ -323,15 +324,16 @@ export const GetAiConnectionResponse = zod "google", "xai", "unbiased", + "trustedrouter", "openai-compatible", ]) .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", ), login: zod .enum(["plan", "api-key", "endpoint", "oauth"]) .describe( - "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", + "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", ), endpointHost: zod .string() @@ -402,15 +404,16 @@ export const ReplaceAiConnectionBody = zod "google", "xai", "unbiased", + "trustedrouter", "openai-compatible", ]) .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", ), login: zod .enum(["plan", "api-key", "endpoint", "oauth"]) .describe( - "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", + "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", ), apiKey: zod .string() @@ -445,7 +448,7 @@ export const ReplaceAiConnectionBody = zod ), }) .describe( - "The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased and openai-compatible take endpoint. Any other pair is refused.", + "The connection to switch to. openai and anthropic take plan or api-key; google and xai take endpoint or oauth; unbiased, trustedrouter and openai-compatible take endpoint. Any other pair is refused.", ); export const ReplaceAiConnectionResponse = zod @@ -459,10 +462,11 @@ export const ReplaceAiConnectionResponse = zod "google", "xai", "unbiased", + "trustedrouter", "openai-compatible", ]) .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", ), zod.null(), ]) @@ -472,7 +476,7 @@ export const ReplaceAiConnectionResponse = zod zod .enum(["plan", "api-key", "endpoint", "oauth"]) .describe( - "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", + "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", ), zod.null(), ]) @@ -518,15 +522,16 @@ export const ReplaceAiConnectionResponse = zod "google", "xai", "unbiased", + "trustedrouter", "openai-compatible", ]) .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", ), login: zod .enum(["plan", "api-key", "endpoint", "oauth"]) .describe( - "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", + "How OpenBot signs in to the provider. plan: the person's Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person's Google or xAI sign-in (google, xai).", ), endpointHost: zod .string() diff --git a/app/src/lib/desktop/ai-connection.ts b/app/src/lib/desktop/ai-connection.ts index 32c83c154b..0a8cd6a9c7 100644 --- a/app/src/lib/desktop/ai-connection.ts +++ b/app/src/lib/desktop/ai-connection.ts @@ -19,6 +19,7 @@ const PRESET_HOSTS: Record = { "generativelanguage.googleapis.com": "Google Gemini", "api.x.ai": "xAI", "api.unbiased.ai": "Unbiased AI", + "api.trustedrouter.com": "TrustedRouter", }; function signedIn( diff --git a/app/tests/ai-connection-dialog.test.tsx b/app/tests/ai-connection-dialog.test.tsx index 8d654fe76f..6fce223f20 100644 --- a/app/tests/ai-connection-dialog.test.tsx +++ b/app/tests/ai-connection-dialog.test.tsx @@ -431,6 +431,7 @@ describe.skipIf(!asked)("changing the AI connection in Settings", () => { "Google Gemini", "xAI", "Unbiased AI", + "TrustedRouter", "Any OpenAI-compatible endpoint", ]); expect(await measured(page)).toEqual(FINE); diff --git a/app/tests/ai-connection-providers.test.ts b/app/tests/ai-connection-providers.test.ts index 2564a6533d..1c54d8e984 100644 --- a/app/tests/ai-connection-providers.test.ts +++ b/app/tests/ai-connection-providers.test.ts @@ -51,7 +51,7 @@ function catalogue() { test("Settings lists the setup window's providers, in its order and words", () => { const desktop = catalogue(); - expect(desktop.length).toBe(6); + expect(desktop.length).toBe(7); expect( AI_PROVIDERS.map(({ id, name, summary, logins, mark }) => ({ id, diff --git a/desktop/src-tauri/src/ai_connection.rs b/desktop/src-tauri/src/ai_connection.rs index 1e21241c70..cf1c320fea 100644 --- a/desktop/src-tauri/src/ai_connection.rs +++ b/desktop/src-tauri/src/ai_connection.rs @@ -219,7 +219,7 @@ pub fn intent_for(provider: &str, login: &str) -> Option { ("openai", "plan") => ModelIntent::ChatGptPlan, ("google", "oauth") => ModelIntent::GoogleOauth, ("xai", "oauth") => ModelIntent::XaiOauth, - ("google" | "xai" | "unbiased" | "openai-compatible", "endpoint") => { + ("google" | "xai" | "unbiased" | "trustedrouter" | "openai-compatible", "endpoint") => { ModelIntent::CompatibleEndpoint } _ => return None, @@ -253,6 +253,7 @@ fn endpoint_provider(base_url: &str) -> &'static str { Some("generativelanguage.googleapis.com") => "google", Some("api.x.ai") => "xai", Some("api.unbiased.ai") => "unbiased", + Some("api.trustedrouter.com") => "trustedrouter", _ => "openai-compatible", } } @@ -631,8 +632,8 @@ pub struct AiConnection { /// The model named on the setup screen. Only an address or a provider sign-in names one; with a /// key or a plan the server picks the provider's own. pub model: Option, - /// The host of a custom address, for the page to tell Gemini, xAI and Unbiased AI apart from - /// a person's own server. Only the host: an address can carry a password or a key. + /// The host of a custom address, for the page to tell Gemini, xAI, Unbiased AI and TrustedRouter + /// apart from a person's own server. Only the host: an address can carry a password or a key. pub endpoint_host: Option, } @@ -759,6 +760,7 @@ mod tests { ("google", "endpoint", ModelIntent::CompatibleEndpoint), ("xai", "endpoint", ModelIntent::CompatibleEndpoint), ("unbiased", "endpoint", ModelIntent::CompatibleEndpoint), + ("trustedrouter", "endpoint", ModelIntent::CompatibleEndpoint), ( "openai-compatible", "endpoint", @@ -775,6 +777,7 @@ mod tests { ("openai", "endpoint"), ("google", "plan"), ("unbiased", "oauth"), + ("trustedrouter", "oauth"), ("anthropic", "oauth"), ("", ""), ] { @@ -807,6 +810,15 @@ mod tests { }, r#"{"login":"endpoint","provider":"google"}"#, ), + ( + ModelCredential::Compatible { + base_url: "https://api.trustedrouter.com/v1".into(), + container_base_url: None, + api_key: "sentinel-key".into(), + model: "anthropic/claude-sonnet-5.5".into(), + }, + r#"{"login":"endpoint","provider":"trustedrouter"}"#, + ), ( ModelCredential::Compatible { base_url: "http://127.0.0.1:11434/v1".into(), diff --git a/desktop/src-tauri/src/provider.rs b/desktop/src-tauri/src/provider.rs index 2471c35fb2..e6e9ef2f74 100644 --- a/desktop/src-tauri/src/provider.rs +++ b/desktop/src-tauri/src/provider.rs @@ -3,7 +3,8 @@ //! OpenAI and Anthropic offer plan sign-in alongside API keys. Google and xAI use named endpoint //! presets with API keys; their official addresses are supplied by the frontend. Unbiased AI signs in //! through its own device authorization, which ends in an API key for the same named endpoint -//! shape, so the key is then carried like a typed one. +//! shape, so the key is then carried like a typed one. TrustedRouter is a named endpoint preset +//! with an API key and no sign-in. //! //! The row that asks for a URL is the last one, and it is the only one that asks. Keeping it there //! is what keeps a base URL off the main path, which the audience rule at the top of the build doc @@ -124,6 +125,14 @@ pub fn catalogue() -> Vec { mark: Some("unbiased".into()), caution: None, }, + Provider { + id: "trustedrouter".into(), + name: "TrustedRouter".into(), + summary: "Use a TrustedRouter API key for models from many providers.".into(), + logins: vec![Login::Endpoint], + mark: Some("trustedrouter".into()), + caution: None, + }, Provider { id: "openai-compatible".into(), name: "Any OpenAI-compatible endpoint".into(), @@ -152,7 +161,13 @@ mod tests { .collect(); assert_eq!( asking, - vec!["google", "xai", "unbiased", "openai-compatible"] + vec![ + "google", + "xai", + "unbiased", + "trustedrouter", + "openai-compatible" + ] ); for provider in catalogue() .into_iter() @@ -180,7 +195,7 @@ mod tests { /// Named providers stay ahead of the custom endpoint escape hatch. #[test] - fn five_named_providers_and_one_custom_endpoint() { + fn six_named_providers_and_one_custom_endpoint() { let rows = catalogue(); let ids: Vec<&str> = rows.iter().map(|provider| provider.id.as_str()).collect(); assert_eq!( @@ -191,6 +206,7 @@ mod tests { "google", "xai", "unbiased", + "trustedrouter", "openai-compatible" ] ); @@ -207,6 +223,17 @@ mod tests { assert_eq!(unbiased.name, "Unbiased AI"); } + /// TrustedRouter has no sign-in, so its row asks for an API key and nothing else. + #[test] + fn trustedrouter_asks_only_for_a_key() { + let trustedrouter = catalogue() + .into_iter() + .find(|p| p.id == "trustedrouter") + .expect("trustedrouter is not offered"); + assert_eq!(trustedrouter.logins, vec![Login::Endpoint]); + assert_eq!(trustedrouter.name, "TrustedRouter"); + } + /// Every row is readable without recognising a logo. #[test] fn every_row_has_a_name() { diff --git a/desktop/src/ProviderPicker.test.tsx b/desktop/src/ProviderPicker.test.tsx index 3711aab04e..9a89dc4eba 100644 --- a/desktop/src/ProviderPicker.test.tsx +++ b/desktop/src/ProviderPicker.test.tsx @@ -79,9 +79,19 @@ const unbiased = { keyLink: "Get an Unbiased AI API key", }; +/** A gateway in front of many providers, with an API key and no sign-in. */ +const trustedRouter = { + id: "trustedrouter", + name: "TrustedRouter", + baseUrl: "https://api.trustedrouter.com/v1", + model: "anthropic/claude-sonnet-5.5", + keyUrl: "https://trustedrouter.com/console/api-keys", + keyLink: "Get a TrustedRouter API key", +}; + const allProviders: Provider[] = [ ...providers, - ...[...cloudProviders, unbiased].map( + ...[...cloudProviders, unbiased, trustedRouter].map( (provider): Provider => ({ id: provider.id, name: provider.name, @@ -1217,7 +1227,7 @@ for (const provider of cloudProviders) { }); } -for (const provider of [...cloudProviders, unbiased]) { +for (const provider of [...cloudProviders, unbiased, trustedRouter]) { test(`${provider.name} opens its API key page externally without sending entered credentials`, async () => { invokeHandler = async (command) => { if (command === "providers") return allProviders; diff --git a/desktop/src/ProviderPicker.tsx b/desktop/src/ProviderPicker.tsx index 9ea040a120..c115055b83 100644 --- a/desktop/src/ProviderPicker.tsx +++ b/desktop/src/ProviderPicker.tsx @@ -105,6 +105,15 @@ const endpointPresets: Record< keyUrl: "https://platform.unbiased.ai/dashboard/keys", keyLink: "Get an Unbiased AI API key", }, + // TrustedRouter's gateway speaks the OpenAI API and lists models from many providers under their + // vendor's prefix, so the model is named the way its /models lists it. + // https://trustedrouter.com/docs + trustedrouter: { + baseUrl: "https://api.trustedrouter.com/v1", + model: "anthropic/claude-sonnet-5.5", + keyUrl: "https://trustedrouter.com/console/api-keys", + keyLink: "Get a TrustedRouter API key", + }, }; /** What approving in the browser does, for each provider that signs in that way. */ diff --git a/desktop/src/setupLayout.browser.test.ts b/desktop/src/setupLayout.browser.test.ts index 0336a33736..5db69c5a9c 100644 --- a/desktop/src/setupLayout.browser.test.ts +++ b/desktop/src/setupLayout.browser.test.ts @@ -199,6 +199,7 @@ export async function invoke(command, args) { { id: "google", name: "Google Gemini", summary: "Use a Google AI Studio key or sign in for Gemini API access.", logins: ["endpoint", "oauth"], mark: "google-color", caution: null }, { id: "xai", name: "xAI", summary: "Use an xAI API key or sign in to your xAI account.", logins: ["endpoint", "oauth"], mark: "xai", caution: null }, { id: "unbiased", name: "Unbiased AI", summary: "Sign in with Unbiased AI to use Pareto, or use an API key.", logins: ["oauth", "endpoint"], mark: "unbiased", caution: null }, + { id: "trustedrouter", name: "TrustedRouter", summary: "Use a TrustedRouter API key for models from many providers.", logins: ["endpoint"], mark: "trustedrouter", caution: null }, { id: "openai-compatible", name: "Any OpenAI-compatible endpoint", summary: "Azure, Bedrock, Mistral, DeepSeek, Ollama, vLLM or your own.", logins: ["endpoint"], mark: null, caution: null }, ]; case "prepare_installation": @@ -1296,6 +1297,7 @@ const PROVIDERS = [ "Google Gemini", "xAI", "Unbiased AI", + "TrustedRouter", "Any OpenAI-compatible endpoint", ]; diff --git a/docs/releasing.md b/docs/releasing.md index 3bd7e33b18..ea509687f8 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -1179,7 +1179,8 @@ schedule or by hand on `main`, never on a pull request. Each provider needs its key as a repository secret: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY` (Google, also used for Antigravity) and `XAI_API_KEY`. A provider without one is reported as skipped, not failed, and the summary names the missing secrets. Unbiased AI is not -checked: it is a gateway serving its own model, not a provider's listing. +checked: it is a gateway serving its own model, not a provider's listing. Nor is TrustedRouter, a +gateway in front of many providers. **When it fails**, read the provider's words in the table: diff --git a/scripts/model-compat.ts b/scripts/model-compat.ts index 2a0b97742c..9ed492722a 100644 --- a/scripts/model-compat.ts +++ b/scripts/model-compat.ts @@ -330,6 +330,10 @@ export const NOT_CHECKED: readonly { baseUrl: string; why: string }[] = [ baseUrl: "https://api.unbiased.ai/v1", why: "Unbiased AI is a gateway serving its own `pareto` model, not a provider's listing", }, + { + baseUrl: "https://api.trustedrouter.com/v1", + why: "TrustedRouter is a gateway in front of many providers, not a provider's own listing", + }, ]; function provider(id: string): Provider { diff --git a/shared/marks/README.md b/shared/marks/README.md index 5810ad5e02..f43679e66d 100644 --- a/shared/marks/README.md +++ b/shared/marks/README.md @@ -14,6 +14,7 @@ own repository: | `mastra.svg` | The glyph from Mastra's own favicon, [mastra.ai/favicon/new-brand/icon.svg](https://mastra.ai/favicon/new-brand/icon.svg) (downloaded 2026-11-18), the mark from its November 2025 [rebrand](https://mastra.ai/blog/rebrand). Its path is verbatim; the black tile behind it is dropped and the glyph drawn in `currentColor`, scaled into the 24-unit box, with a `` and `1em` sizing. The lobehub set still has the old orb, so `shared/marks.test.ts` pins this path | | `kubernetes.svg` | The Kubernetes icon from the CNCF's own artwork repository, [`cncf/artwork`](https://github.com/cncf/artwork) `projects/kubernetes/icon/color/kubernetes-icon-color.svg`, verbatim apart from a `<title>`. Used under the Linux Foundation's trademark usage guidelines, to name the project | | `unbiased.svg` | Unbiased AI's own icon, as served at `platform.unbiased.ai/logos/unbiased-icon.svg` and supplied by Unbiased AI for this row, verbatim apart from a `<title>` and `1em` sizing | +| `trustedrouter.svg` | TrustedRouter's own monochrome mark, `trustedrouter-mono.svg` from the public media kit at [trustedrouter.com/media-kit](https://trustedrouter.com/media-kit) (downloaded 2026-11-19), verbatim apart from a `<title>` and `1em` sizing. It is already drawn in `currentColor` in the 24-unit box | The clouds on Desktop's OpenBot for Business choice come from that set too, as its colour marks: `aws.svg` (`aws-color.svg`), `azure.svg` (`azure-color.svg`) and `google-cloud.svg` diff --git a/shared/marks/trustedrouter.svg b/shared/marks/trustedrouter.svg new file mode 100644 index 0000000000..5fa0ecc500 --- /dev/null +++ b/shared/marks/trustedrouter.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" role="img" aria-label="TrustedRouter mark"><title>TrustedRouter From 48776a4e8c4fd8c760a0e1f714f5306c580c1313 Mon Sep 17 00:00:00 2001 From: David McKay Date: Fri, 20 Nov 2026 07:29:53 -0800 Subject: [PATCH 2/3] Answer the AI provider as an open list, so a new one breaks no released app Adding trustedrouter to AiConnectionProvider put a value in GET and PUT /ai-connection answers that a client built against 1.1.1 has never seen, and oasdiff failed it. The answers now use AiConnectionProviderAnswer, an x-extensible-enum copy with the same values (api/README.md, Enums that grow), as PersonRoleAnswer is for PersonRole. A request still names one of the closed AiConnectionProvider list, so a switch to a provider the server doesn't take is still refused with 400. The four changes oasdiff reports are listed in accepted-breaking-changes.md. The app shows a provider it has no row for by its id, and passes it to Desktop as it came. The new spec test parses an answer naming an unknown provider and refuses a switch to one. --- api/accepted-breaking-changes.md | 4 ++ api/openapi-ai-connection.test.ts | 34 +++++++++++++ api/openapi.yaml | 21 ++++++-- api/openapi/model-connections.yaml | 14 +++++- app/src/lib/ai-connection/desktop.ts | 4 +- app/src/lib/ai-connection/providers.ts | 7 ++- .../lib/api/generated/model/aiConnection.ts | 4 +- .../model/aiConnectionProviderAnswer.ts | 8 ++++ .../api/generated/model/aiConnectionSaved.ts | 4 +- app/src/lib/api/generated/model/index.ts | 1 + .../lib/api/generated/models/models.zod.ts | 48 ++++--------------- 11 files changed, 96 insertions(+), 53 deletions(-) create mode 100644 app/src/lib/api/generated/model/aiConnectionProviderAnswer.ts diff --git a/api/accepted-breaking-changes.md b/api/accepted-breaking-changes.md index 48f1590d53..cab75d39f3 100644 --- a/api/accepted-breaking-changes.md +++ b/api/accepted-breaking-changes.md @@ -264,3 +264,7 @@ it in those words when it is the reason, and the release run fails if the releas - 2026-11-18 GET /api/v2/organizations/{organizationId}/settings the `mcpAllowlist/servers/items/` response's property pattern was changed from `^[^\x00]*\S[^\x00]*$` to `^[^\x00]*[^\s\x00][^\x00]*$` for the status `200` (shared schema: `AllowlistEntry`, also at `mcpAllowlist/servers/items`, `modelAllowlist/models/items`). The same change as worded by oasdiff 1.34: NUL refused in the one required character as everywhere else, as the server always has. - 2026-11-18 PATCH /api/v2/organizations/{organizationId}/settings changed the pattern of the request property `mcpAllowlist/servers/items/` from `^[^\x00]*\S[^\x00]*$` to `^[^\x00]*[^\s\x00][^\x00]*$` (shared schema: `AllowlistEntry`, also at `mcpAllowlist/servers/items`, `modelAllowlist/models/items`). The same change as worded by oasdiff 1.34: NUL refused in the one required character as everywhere else, as the server always has. - 2026-11-18 PATCH /api/v2/organizations/{organizationId}/settings the `mcpAllowlist/servers/items/` response's property pattern was changed from `^[^\x00]*\S[^\x00]*$` to `^[^\x00]*[^\s\x00][^\x00]*$` for the status `200` (shared schema: `AllowlistEntry`, also at `mcpAllowlist/servers/items`, `modelAllowlist/models/items`). The same change as worded by oasdiff 1.34: NUL refused in the one required character as everywhere else, as the server always has. +- 2026-11-20 GET /api/v2/organizations/{organizationId}/ai-connection removed the enum constraint from the `saved/items/provider` response property for the response status `200`. The AI provider a connection answers with is declared open with x-extensible-enum (AiConnectionProviderAnswer), so a provider such as trustedrouter can be added, and every client reads a value it doesn't know (api/README.md, Enums that grow). A request still names one of the closed AiConnectionProvider list. +- 2026-11-20 PUT /api/v2/organizations/{organizationId}/ai-connection removed the enum constraint from the `saved/items/provider` response property for the response status `200`. The same open provider in the answer to a switch. +- 2026-11-20 GET /api/v2/organizations/{organizationId}/ai-connection added `#/components/schemas/AiConnectionProviderAnswer` to the `provider` response property `oneOf` list for the response status `200`. The open copy of AiConnectionProvider, with its values, in place of the closed one beside null: the same change as the line above, as oasdiff words it for a nullable property. +- 2026-11-20 PUT /api/v2/organizations/{organizationId}/ai-connection added `#/components/schemas/AiConnectionProviderAnswer` to the `provider` response property `oneOf` list for the response status `200`. The same open provider in the answer to a switch. diff --git a/api/openapi-ai-connection.test.ts b/api/openapi-ai-connection.test.ts index f28056b8a9..e8dfa8fabf 100644 --- a/api/openapi-ai-connection.test.ts +++ b/api/openapi-ai-connection.test.ts @@ -166,6 +166,40 @@ test("every example the spec shows is one the generated client accepts", () => { } }); +test("an answer may name a provider this client doesn't know, and a switch is refused one the server doesn't take", () => { + const answer = { + provider: "a-provider-added-later", + login: "endpoint", + model: "model-a", + endpointHost: "api.example.com", + keySet: true, + ready: true, + source: "stored", + editable: true, + saved: [ + { + provider: "a-provider-added-later", + login: "endpoint", + endpointHost: "api.example.com", + }, + ], + changedAt: "2026-11-20T00:00:00Z", + }; + expect(GetAiConnectionResponse.safeParse(answer).success).toBe(true); + const body = (provider: string) => + ReplaceAiConnectionBody.safeParse({ + provider, + login: "endpoint", + baseUrl: "https://api.trustedrouter.com/v1", + model: "anthropic/claude-sonnet-5.5", + apiKey: "sk-example", + }).success; + expect(body("trustedrouter")).toBe(true); + expect(body("unbiased")).toBe(true); + expect(body("a-provider-added-later")).toBe(false); + expect(body("")).toBe(false); +}); + test("an endpoint address is http or https with nothing in it that signs in", () => { const endpoint = (baseUrl: string) => ReplaceAiConnectionBody.safeParse({ diff --git a/api/openapi.yaml b/api/openapi.yaml index 72f6b80b74..3d3ddf4360 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -25453,10 +25453,9 @@ components: label: type: string description: Its name, as a model picker shows it. - AiConnectionProvider: + AiConnectionProviderAnswer: type: string - description: 'The AI provider OpenBot''s Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI''s API, at an address given.' - enum: + x-extensible-enum: - openai - anthropic - google @@ -25464,6 +25463,7 @@ components: - unbiased - trustedrouter - openai-compatible + description: 'The AI provider OpenBot''s Bots run on, as the server answers it. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI''s API, at an address given. The list can grow: a client shows a provider it doesn''t know by its id. A request still names one of AiConnectionProvider.' AiConnectionLogin: type: string description: 'How OpenBot signs in to the provider. plan: the person''s Claude or ChatGPT plan (openai, anthropic). api-key: a key from the provider (openai, anthropic). endpoint: an address and, where it asks for one, a key (google, xai, unbiased, trustedrouter, openai-compatible). oauth: the person''s Google or xAI sign-in (google, xai).' @@ -25481,7 +25481,7 @@ components: - endpointHost properties: provider: - $ref: '#/components/schemas/AiConnectionProvider' + $ref: '#/components/schemas/AiConnectionProviderAnswer' login: $ref: '#/components/schemas/AiConnectionLogin' endpointHost: @@ -25507,7 +25507,7 @@ components: provider: description: The provider. Null while none is chosen yet. oneOf: - - $ref: '#/components/schemas/AiConnectionProvider' + - $ref: '#/components/schemas/AiConnectionProviderAnswer' - type: 'null' login: description: How OpenBot signs in to it. Null while none is chosen yet. @@ -25551,6 +25551,17 @@ components: - 'null' format: date-time description: When it was last changed. Null if never. + AiConnectionProvider: + type: string + description: 'The AI provider OpenBot''s Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI''s API, at an address given.' + enum: + - openai + - anthropic + - google + - xai + - unbiased + - trustedrouter + - openai-compatible AiConnectionInput: type: object additionalProperties: false diff --git a/api/openapi/model-connections.yaml b/api/openapi/model-connections.yaml index 913bbc62e5..515f225d5d 100644 --- a/api/openapi/model-connections.yaml +++ b/api/openapi/model-connections.yaml @@ -783,6 +783,16 @@ components: trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given. enum: [openai, anthropic, google, xai, unbiased, trustedrouter, openai-compatible] + AiConnectionProviderAnswer: + type: string + x-extensible-enum: [openai, anthropic, google, xai, unbiased, trustedrouter, openai-compatible] + description: >- + The AI provider OpenBot's Bots run on, as the server answers it. + openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: + xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. + openai-compatible: any server that speaks OpenAI's API, at an address + given. The list can grow: a client shows a provider it doesn't know + by its id. A request still names one of AiConnectionProvider. AiConnectionLogin: type: string description: >- @@ -800,7 +810,7 @@ components: required: [provider, login, endpointHost] properties: provider: - $ref: '#/components/schemas/AiConnectionProvider' + $ref: '#/components/schemas/AiConnectionProviderAnswer' login: $ref: '#/components/schemas/AiConnectionLogin' endpointHost: @@ -826,7 +836,7 @@ components: provider: description: The provider. Null while none is chosen yet. oneOf: - - $ref: '#/components/schemas/AiConnectionProvider' + - $ref: '#/components/schemas/AiConnectionProviderAnswer' - type: 'null' login: description: How OpenBot signs in to it. Null while none is chosen yet. diff --git a/app/src/lib/ai-connection/desktop.ts b/app/src/lib/ai-connection/desktop.ts index 4de6cc28cf..959d9b1df1 100644 --- a/app/src/lib/ai-connection/desktop.ts +++ b/app/src/lib/ai-connection/desktop.ts @@ -1,6 +1,7 @@ import type { AiConnectionLogin, AiConnectionProvider, + AiConnectionProviderAnswer, } from "@/lib/api/generated/model"; import { invokeDesktop } from "@/lib/desktop/queries"; @@ -116,7 +117,8 @@ export function prepareAiConnection( * longer needed, and moves the default Bot to one that can use it. */ export function settleAiConnection(connection: { - provider: AiConnectionProvider; + /** As the server answered it, so possibly a provider this app doesn't know: Desktop says so. */ + provider: AiConnectionProviderAnswer; login: AiConnectionLogin; model?: string | null; endpointHost?: string | null; diff --git a/app/src/lib/ai-connection/providers.ts b/app/src/lib/ai-connection/providers.ts index d39d3a8bdb..706393494f 100644 --- a/app/src/lib/ai-connection/providers.ts +++ b/app/src/lib/ai-connection/providers.ts @@ -1,6 +1,7 @@ import type { AiConnectionLogin, AiConnectionProvider, + AiConnectionProviderAnswer, } from "@/lib/api/generated/model"; /** @@ -133,8 +134,12 @@ export function loginsHere( ); } +/** + * The row for a provider, by its id. The server's answer can name a provider this app doesn't know + * (the list grows, api/README.md "Enums that grow"): that one has no row, and is shown by its id. + */ export function providerById( - id: AiConnectionProvider | null | undefined, + id: AiConnectionProviderAnswer | null | undefined, ): AiProvider | undefined { return AI_PROVIDERS.find((provider) => provider.id === id); } diff --git a/app/src/lib/api/generated/model/aiConnection.ts b/app/src/lib/api/generated/model/aiConnection.ts index be81ac9bcf..c9b0c6d566 100644 --- a/app/src/lib/api/generated/model/aiConnection.ts +++ b/app/src/lib/api/generated/model/aiConnection.ts @@ -2,7 +2,7 @@ * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. */ import type { AiConnectionLogin } from "./aiConnectionLogin"; -import type { AiConnectionProvider } from "./aiConnectionProvider"; +import type { AiConnectionProviderAnswer } from "./aiConnectionProviderAnswer"; import type { AiConnectionSaved } from "./aiConnectionSaved"; import type { AiConnectionSource } from "./aiConnectionSource"; @@ -11,7 +11,7 @@ import type { AiConnectionSource } from "./aiConnectionSource"; */ export interface AiConnection { /** The provider. Null while none is chosen yet. */ - provider: AiConnectionProvider | null; + provider: AiConnectionProviderAnswer | null; /** How OpenBot signs in to it. Null while none is chosen yet. */ login: AiConnectionLogin | null; /** diff --git a/app/src/lib/api/generated/model/aiConnectionProviderAnswer.ts b/app/src/lib/api/generated/model/aiConnectionProviderAnswer.ts new file mode 100644 index 0000000000..d0752839c4 --- /dev/null +++ b/app/src/lib/api/generated/model/aiConnectionProviderAnswer.ts @@ -0,0 +1,8 @@ +/** + * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. + */ + +/** + * The AI provider OpenBot's Bots run on, as the server answers it. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given. The list can grow: a client shows a provider it doesn't know by its id. A request still names one of AiConnectionProvider. + */ +export type AiConnectionProviderAnswer = string; diff --git a/app/src/lib/api/generated/model/aiConnectionSaved.ts b/app/src/lib/api/generated/model/aiConnectionSaved.ts index 3948593d80..ffe051a53b 100644 --- a/app/src/lib/api/generated/model/aiConnectionSaved.ts +++ b/app/src/lib/api/generated/model/aiConnectionSaved.ts @@ -2,13 +2,13 @@ * Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`. */ import type { AiConnectionLogin } from "./aiConnectionLogin"; -import type { AiConnectionProvider } from "./aiConnectionProvider"; +import type { AiConnectionProviderAnswer } from "./aiConnectionProviderAnswer"; /** * A connection with a key still kept in the vault, which can be used again without pasting the key (useSavedKey). Never the key. */ export interface AiConnectionSaved { - provider: AiConnectionProvider; + provider: AiConnectionProviderAnswer; login: AiConnectionLogin; /** * The host of its address, for an endpoint. Null for an API key. diff --git a/app/src/lib/api/generated/model/index.ts b/app/src/lib/api/generated/model/index.ts index c1e23f8ea8..a6db34f912 100644 --- a/app/src/lib/api/generated/model/index.ts +++ b/app/src/lib/api/generated/model/index.ts @@ -31,6 +31,7 @@ export * from "./aiConnectionFixedResponse"; export * from "./aiConnectionInput"; export * from "./aiConnectionLogin"; export * from "./aiConnectionProvider"; +export * from "./aiConnectionProviderAnswer"; export * from "./aiConnectionRefusedResponse"; export * from "./aiConnectionSaved"; export * from "./aiConnectionSource"; diff --git a/app/src/lib/api/generated/models/models.zod.ts b/app/src/lib/api/generated/models/models.zod.ts index 58ce1a1dbc..ee710ccb7f 100644 --- a/app/src/lib/api/generated/models/models.zod.ts +++ b/app/src/lib/api/generated/models/models.zod.ts @@ -258,17 +258,9 @@ export const GetAiConnectionResponse = zod provider: zod .union([ zod - .enum([ - "openai", - "anthropic", - "google", - "xai", - "unbiased", - "trustedrouter", - "openai-compatible", - ]) + .string() .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on, as the server answers it. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given. The list can grow: a client shows a provider it doesn't know by its id. A request still names one of AiConnectionProvider.", ), zod.null(), ]) @@ -318,17 +310,9 @@ export const GetAiConnectionResponse = zod zod .object({ provider: zod - .enum([ - "openai", - "anthropic", - "google", - "xai", - "unbiased", - "trustedrouter", - "openai-compatible", - ]) + .string() .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on, as the server answers it. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given. The list can grow: a client shows a provider it doesn't know by its id. A request still names one of AiConnectionProvider.", ), login: zod .enum(["plan", "api-key", "endpoint", "oauth"]) @@ -456,17 +440,9 @@ export const ReplaceAiConnectionResponse = zod provider: zod .union([ zod - .enum([ - "openai", - "anthropic", - "google", - "xai", - "unbiased", - "trustedrouter", - "openai-compatible", - ]) + .string() .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on, as the server answers it. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given. The list can grow: a client shows a provider it doesn't know by its id. A request still names one of AiConnectionProvider.", ), zod.null(), ]) @@ -516,17 +492,9 @@ export const ReplaceAiConnectionResponse = zod zod .object({ provider: zod - .enum([ - "openai", - "anthropic", - "google", - "xai", - "unbiased", - "trustedrouter", - "openai-compatible", - ]) + .string() .describe( - "The AI provider OpenBot's Bots run on. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given.", + "The AI provider OpenBot's Bots run on, as the server answers it. openai: OpenAI. anthropic: Anthropic. google: Google Gemini. xai: xAI. unbiased: Unbiased AI. trustedrouter: TrustedRouter. openai-compatible: any server that speaks OpenAI's API, at an address given. The list can grow: a client shows a provider it doesn't know by its id. A request still names one of AiConnectionProvider.", ), login: zod .enum(["plan", "api-key", "endpoint", "oauth"]) From 3ad104e91bdb22008695faf3759e0aafde55dfff Mon Sep 17 00:00:00 2001 From: Mark Fogle Date: Fri, 20 Nov 2026 17:56:27 -0800 Subject: [PATCH 3/3] Changelog: TrustedRouter in the API, and the AI provider in answers as an open list --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91f31978ce..0f423f507f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,12 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged. - **Search an organization's members.** `listOrganizationMembers` takes `search`, which narrows the list to the members whose name or address starts with it or holds it, ignoring case, best matches first. Only that organization's current members are ever listed. +- **TrustedRouter as an AI connection, and the AI provider in answers can gain values.** + `PUT /api/v2/organizations/{organizationId}/ai-connection` (`replaceAiConnection`) takes + `provider: trustedrouter` with `login: endpoint`, an address and a key, like `unbiased`. In + answers, `provider` is now declared open (`x-extensible-enum`, `AiConnectionProviderAnswer`), so + a script that reads it should show a provider it doesn't know by its id rather than fail. A + request still names one of the closed `AiConnectionProvider` list. - New optional fields: `organizationId` on a conversation event and on a Recorder connection, and `hostedSignIn` on `deployment`, true where people sign in through OpenBot by CopilotKit's own sign-in, starting at `/api/auth/hosted/sign-in`.