feat(api): add OrcaRouter provider preset

Add a named 'orcarouter' preset to the shared provider catalog mirroring
the existing OpenRouter entry: OpenAI-compatible base URL
https://api.orcarouter.ai/v1, default model openai/gpt-5.5, sk-orca-...
key placeholder, and a dashboard icon. Regenerate the throw-error
baseline for the line shift in provider-preset-catalog.ts.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Marc-oss-hubandClaude committed 2026-08-13 22:29:17 +08:00
1 parent a0990e0ef1
commit ea7906b975
5 files changed
+85 -9

No files matched your search

+2 -2
View File
@@ -64,8 +64,8 @@ CCS gives you one stable command surface while letting you switch between:
- multiple Claude subscriptions and isolated account contexts - multiple Claude subscriptions and isolated account contexts
- OAuth providers like Codex, xAI/Grok, Kiro, Claude, Kimi, and more, with legacy - OAuth providers like Codex, xAI/Grok, Kiro, Claude, Kimi, and more, with legacy
Copilot compatibility for existing setups Copilot compatibility for existing setups
- API and local-model profiles like GLM, Kimi, OpenRouter, Ollama, llama.cpp, - API and local-model profiles like GLM, Kimi, OpenRouter, OrcaRouter, Ollama,
Novita, Fireworks AI, and Alibaba Coding Plan llama.cpp, Novita, Fireworks AI, and Alibaba Coding Plan
Qwen Code account linking is not available in the bundled CLIProxy runtime yet; Qwen Code account linking is not available in the bundled CLIProxy runtime yet;
use an API-key Qwen profile such as Alibaba Coding Plan for Qwen models. use an API-key Qwen profile such as Alibaba Coding Plan for Qwen models.
+7 -7
View File
@@ -220,13 +220,13 @@
"src/shared/claude-extension-setup.ts:247", "src/shared/claude-extension-setup.ts:247",
"src/shared/claude-extension-setup.ts:257", "src/shared/claude-extension-setup.ts:257",
"src/shared/claude-extension-setup.ts:317", "src/shared/claude-extension-setup.ts:317",
"src/shared/provider-preset-catalog.ts:339", "src/shared/provider-preset-catalog.ts:356",
"src/shared/provider-preset-catalog.ts:342", "src/shared/provider-preset-catalog.ts:359",
"src/shared/provider-preset-catalog.ts:351", "src/shared/provider-preset-catalog.ts:368",
"src/shared/provider-preset-catalog.ts:354", "src/shared/provider-preset-catalog.ts:371",
"src/shared/provider-preset-catalog.ts:357", "src/shared/provider-preset-catalog.ts:374",
"src/shared/provider-preset-catalog.ts:362", "src/shared/provider-preset-catalog.ts:379",
"src/shared/provider-preset-catalog.ts:365", "src/shared/provider-preset-catalog.ts:382",
"src/shared/toml-object.ts:23", "src/shared/toml-object.ts:23",
"src/targets/codex-adapter.ts:103", "src/targets/codex-adapter.ts:103",
"src/targets/codex-adapter.ts:275", "src/targets/codex-adapter.ts:275",
+17
View File
@@ -10,6 +10,7 @@ export type ProviderPresetTarget = 'claude' | 'droid';
export const PROVIDER_PRESET_IDS = [ export const PROVIDER_PRESET_IDS = [
'openrouter', 'openrouter',
'orcarouter',
'alibaba-coding-plan', 'alibaba-coding-plan',
'huggingface', 'huggingface',
'tuningengines', 'tuningengines',
@@ -53,6 +54,7 @@ export interface ProviderPresetDefinition {
} }
export const OPENROUTER_BASE_URL = 'https://openrouter.ai/api/v1'; export const OPENROUTER_BASE_URL = 'https://openrouter.ai/api/v1';
export const ORCAROUTER_BASE_URL = 'https://api.orcarouter.ai/v1';
/** /**
* Legacy aliases mapped to canonical preset IDs. * Legacy aliases mapped to canonical preset IDs.
@@ -84,6 +86,21 @@ const RAW_PROVIDER_PRESET_DEFINITIONS: readonly ProviderPresetDefinition[] = [
featured: true, featured: true,
icon: '/icons/openrouter.svg', icon: '/icons/openrouter.svg',
}, },
{
id: 'orcarouter',
name: 'OrcaRouter',
description: '188+ models from OpenAI, Anthropic, Google, Meta via auto-routing gateway',
baseUrl: ORCAROUTER_BASE_URL,
defaultProfileName: 'orcarouter',
defaultModel: 'openai/gpt-5.5',
apiKeyPlaceholder: 'sk-orca-...',
apiKeyHint: 'Get your API key at orcarouter.ai/console',
category: 'recommended',
requiresApiKey: true,
badge: '188+ models',
featured: true,
icon: '/icons/orcarouter.svg',
},
{ {
id: 'alibaba-coding-plan', id: 'alibaba-coding-plan',
name: 'Alibaba Coding Plan', name: 'Alibaba Coding Plan',
@@ -0,0 +1,58 @@
import { describe, expect, it } from 'bun:test';
import { getPresetById, isValidPresetId } from '../../../src/api/services/provider-presets';
import { PROVIDER_PRESET_IDS } from '../../../src/shared/provider-preset-catalog';
describe('provider-presets-orcarouter', () => {
it('resolves orcarouter preset id', () => {
const preset = getPresetById('orcarouter');
expect(preset?.id).toBe('orcarouter');
expect(preset?.baseUrl).toBe('https://api.orcarouter.ai/v1');
expect(preset?.defaultProfileName).toBe('orcarouter');
});
it('registers orcarouter in PROVIDER_PRESET_IDS', () => {
expect(PROVIDER_PRESET_IDS).toContain('orcarouter');
});
it('uses the OpenAI-compatible base URL with a /v1 suffix', () => {
const preset = getPresetById('orcarouter');
expect(preset?.baseUrl).toBe('https://api.orcarouter.ai/v1');
expect(preset?.baseUrl.endsWith('/v1')).toBe(true);
});
it('pins a provider/model default (openai/gpt-5.5)', () => {
const preset = getPresetById('orcarouter');
expect(preset?.defaultModel).toBe('openai/gpt-5.5');
});
it('validates orcarouter preset requires an API key with the sk-orca- placeholder', () => {
const preset = getPresetById('orcarouter');
expect(preset?.requiresApiKey).toBe(true);
expect(preset?.apiKeyPlaceholder).toBe('sk-orca-...');
});
it('is a recommended, featured provider', () => {
const preset = getPresetById('orcarouter');
expect(preset?.category).toBe('recommended');
expect(preset?.featured).toBe(true);
});
it('treats orcarouter as a valid preset id', () => {
expect(isValidPresetId('orcarouter')).toBe(true);
});
it('handles whitespace in orcarouter preset id', () => {
const preset = getPresetById(' orcarouter ');
expect(preset?.id).toBe('orcarouter');
});
it('handles uppercase orcarouter preset id', () => {
const preset = getPresetById('ORCAROUTER');
expect(preset?.id).toBe('orcarouter');
});
it('does not resolve partial or invalid orcarouter ids', () => {
expect(getPresetById('orcarouter-invalid')).toBeUndefined();
expect(isValidPresetId('orcarouter-invalid')).toBe(false);
});
});
+1
View File
@@ -0,0 +1 @@
<svg fill="#0160E6" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>OrcaRouter</title><path d="M 0.00 0.00 C 6.37 0.00 12.74 0.00 19.30 0.00 C 19.23 0.05 19.17 0.10 19.10 0.15 C 18.03 0.98 17.24 1.93 17.18 3.33 C 17.15 3.75 17.15 3.75 16.95 3.80 C 16.77 3.72 16.59 3.64 16.40 3.55 C 14.76 3.14 13.22 3.54 12.10 4.85 C 12.00 5.05 12.00 5.05 12.05 5.25 C 12.30 5.30 12.30 5.30 12.75 5.25 C 13.99 5.24 13.99 5.24 14.49 5.28 C 14.88 5.30 15.27 5.31 15.66 5.31 C 15.72 5.31 15.72 5.31 16.07 5.31 C 16.39 5.30 16.72 5.28 17.05 5.25 C 17.50 5.70 19.12 7.71 18.85 8.25 C 18.62 8.25 18.39 8.25 18.15 8.25 C 17.88 8.52 18.27 8.97 18.40 9.20 C 18.80 9.65 18.80 9.65 19.30 10.05 C 19.30 11.09 18.29 11.72 17.45 12.10 C 16.78 12.27 15.92 12.39 15.45 11.80 C 15.50 11.50 15.50 11.50 15.65 11.10 C 15.58 10.77 15.58 10.77 15.25 10.70 C 14.52 10.76 13.94 10.92 13.25 11.15 C 12.15 11.37 11.26 10.61 10.38 10.05 C 8.22 8.69 5.87 7.41 3.27 7.21 C 2.75 7.15 2.75 7.15 2.24 6.97 C 1.46 6.70 0.81 6.63 0.25 7.30 C 0.15 7.55 0.15 7.55 0.15 8.10 C 0.18 8.08 0.18 8.08 0.35 8.00 C 1.62 7.36 3.26 9.18 4.05 10.00 C 4.49 10.51 4.87 10.99 5.21 11.58 C 5.55 12.10 5.84 12.36 6.35 12.70 C 6.79 13.14 6.95 13.54 7.20 14.10 C 7.55 14.45 7.89 14.68 8.30 14.95 C 9.41 15.75 11.11 17.81 10.60 19.35 C 10.10 19.68 9.39 19.40 8.90 19.20 C 8.39 19.00 7.88 18.81 7.35 18.65 C 6.87 18.36 6.41 18.07 5.95 17.75 C 5.85 17.68 5.75 17.62 5.65 17.55 C 5.50 17.40 5.50 17.40 5.50 17.30 C 5.45 17.30 5.40 17.30 5.35 17.30 C 5.35 17.27 5.35 17.23 5.35 17.20 C 5.28 17.17 5.22 17.13 5.15 17.10 C 5.02 17.00 4.89 16.90 4.75 16.80 C 4.65 16.73 4.55 16.67 4.45 16.60 C 4.33 16.47 4.22 16.34 4.10 16.20 C 4.05 16.18 4.05 16.18 3.80 16.05 C 3.68 15.93 3.57 15.82 3.45 15.70 C 3.40 15.68 3.35 15.67 3.30 15.65 C 3.30 15.62 3.30 15.58 3.30 15.55 C 3.23 15.53 3.17 15.52 3.10 15.50 C 3.08 15.42 3.07 15.34 3.05 15.25 C 3.00 15.25 2.95 15.25 2.90 15.25 C 3.03 15.51 3.18 15.77 3.45 15.90 C 3.50 15.98 3.55 16.07 3.60 16.15 C 3.86 16.42 4.12 16.66 4.41 16.89 C 4.65 17.10 4.65 17.10 4.60 17.30 C 4.30 17.57 4.00 17.84 3.70 18.10 C 2.78 19.02 0.96 21.07 1.65 22.45 C 3.23 23.50 5.64 22.04 6.85 21.00 C 7.36 20.54 7.80 20.11 8.20 19.55 C 8.40 19.50 8.40 19.50 8.69 19.64 C 9.52 20.02 10.39 20.29 11.28 20.47 C 11.79 20.57 11.88 20.73 12.23 21.11 C 13.76 22.76 15.64 23.74 17.90 23.95 C 17.90 23.97 17.90 23.98 17.90 24.00 C 11.99 24.00 6.09 24.00 0.00 24.00 C 0.00 16.08 0.00 8.16 0.00 0.00 Z"/></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB