diff --git a/CHANGELOG.md b/CHANGELOG.md index 1203b9cf7e..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`. @@ -108,6 +114,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. - **OpenBot Desktop's back end moves to CopilotKit Intelligence 0.17.0-rc.4.** The bundled CLI moves to `copilotkit@3e64135`, so an install or update runs Intelligence 0.17.0-rc.4. - **Setup no longer stops for good after the back end's saved settings were deleted.** With 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 a2619294ac..3d3ddf4360 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -25453,19 +25453,20 @@ 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. openai-compatible: any server that speaks OpenAI''s API, at an address given.' - enum: + 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: '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 @@ -25480,7 +25481,7 @@ components: - endpointHost properties: provider: - $ref: '#/components/schemas/AiConnectionProvider' + $ref: '#/components/schemas/AiConnectionProviderAnswer' login: $ref: '#/components/schemas/AiConnectionLogin' endpointHost: @@ -25506,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. @@ -25550,10 +25551,21 @@ 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 - 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 76ce544324..515f225d5d 100644 --- a/api/openapi/model-connections.yaml +++ b/api/openapi/model-connections.yaml @@ -780,17 +780,27 @@ components: 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] + 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. - enum: [openai, anthropic, google, xai, unbiased, openai-compatible] + 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, 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 @@ -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. @@ -879,8 +889,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/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 9102f5084a..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"; /** @@ -66,6 +67,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 +113,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", + }, }; /** @@ -119,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/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/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 4925f8d638..ee710ccb7f 100644 --- a/app/src/lib/api/generated/models/models.zod.ts +++ b/app/src/lib/api/generated/models/models.zod.ts @@ -258,16 +258,9 @@ export const GetAiConnectionResponse = zod provider: zod .union([ zod - .enum([ - "openai", - "anthropic", - "google", - "xai", - "unbiased", - "openai-compatible", - ]) + .string() .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, 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(), ]) @@ -277,7 +270,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(), ]) @@ -317,21 +310,14 @@ export const GetAiConnectionResponse = zod zod .object({ provider: zod - .enum([ - "openai", - "anthropic", - "google", - "xai", - "unbiased", - "openai-compatible", - ]) + .string() .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, 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"]) .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 +388,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 +432,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 @@ -453,16 +440,9 @@ export const ReplaceAiConnectionResponse = zod provider: zod .union([ zod - .enum([ - "openai", - "anthropic", - "google", - "xai", - "unbiased", - "openai-compatible", - ]) + .string() .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, 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(), ]) @@ -472,7 +452,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(), ]) @@ -512,21 +492,14 @@ export const ReplaceAiConnectionResponse = zod zod .object({ provider: zod - .enum([ - "openai", - "anthropic", - "google", - "xai", - "unbiased", - "openai-compatible", - ]) + .string() .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, 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"]) .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 6264db1cd1..cacf7e58f7 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -1188,7 +1188,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