feat(ai): add OpenRouter provider routing support

Allows custom models to specify which upstream providers OpenRouter
should route requests to via the `openRouterRouting` field in model
definitions.

Supported fields:
- `only`: list of provider slugs to exclusively use
- `order`: list of provider slugs to try in order
This commit is contained in:
jake 2026-01-19 20:39:04 +02:00 committed by Mario Zechner
parent a6d878e804
commit dac7474da2
5 changed files with 30 additions and 0 deletions

View file

@ -30,6 +30,7 @@ const compat: Required<OpenAICompletionsCompat> = {
requiresThinkingAsText: false,
requiresMistralToolIds: false,
thinkingFormat: "openai",
openRouterRouting: {},
};
function buildToolResult(toolCallId: string, timestamp: number): ToolResultMessage {