Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

feat(models): deliver versioned multi-interface catalogs across harnesses

Chris6563d0616dd1
diff --git a/apps/desktop/src/main/localDb/ipc/sessions.ts b/apps/desktop/src/main/localDb/ipc/sessions.ts
index 35fae0ca9c..459cab8d15 100644
--- a/apps/desktop/src/main/localDb/ipc/sessions.ts
+++ b/apps/desktop/src/main/localDb/ipc/sessions.ts
@@ -1,3 +1,4 @@
+import { removeSessionModelInterface } from '../../maker-host/session-model-interface.js';
import { ensureOpenedProjectGit, openSession } from '../sessionOpening.js';
import {
claimOwnedProvisionalSession,
@@ -3096,6 +3097,9 @@ function removeImAttachmentsIfStillDeleted(sessionId: string): Promise<void> {
function cleanupSessionTerminalArtifacts(sessionId: string, status: unknown): void {
if (status !== 'deleted' && status !== 'archived') return;
if (status === 'deleted') {
+ try { removeSessionModelInterface(sessionId); } catch (error) {
+ log.warn('session interface snapshot cleanup failed', { sessionId, error: String(error) });
+ }
void removeTurnChangeSetsForSession(sessionId).catch((err) => {
log.warn('turn change-set cleanup failed', {
sessionId,
diff --git a/apps/desktop/src/main/maker-host/__tests__/custom-provider-store.test.ts b/apps/desktop/src/main/maker-host/__tests__/custom-provider-store.test.ts
index 4f1bc393bb..828d794350 100644
--- a/apps/desktop/src/main/maker-host/__tests__/custom-provider-store.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/custom-provider-store.test.ts
@@ -863,6 +863,21 @@ describe('custom-provider-store CRUD (per-runtime)', () => {
expect(got?.runtimes.codex?.headers).toBeUndefined();
});
+ it('persists automatic and explicit interface choices without derived API snapshots', async () => {
+ mountDb();
+ await createCustomProvider({ ...valid, runtimes: { codex: { ...valid.runtimes.codex!, models: [
+ { id: 'automatic', name: 'Automatic', interfaceId: 'auto' },
+ { id: 'explicit', name: 'Explicit', interfaceId: 'vendor-responses' },
+ ] } } });
+ const stored = await getCustomProvider(valid.id);
+ expect(stored?.runtimes.codex?.models).toEqual([
+ { id: 'automatic', name: 'Automatic', interfaceId: 'auto' },
+ { id: 'explicit', name: 'Explicit', interfaceId: 'vendor-responses' },
+ ]);
+ await updateCustomProvider(valid.id, { ...stored!, name: 'Renamed' });
+ expect((await getCustomProvider(valid.id))?.runtimes).toEqual(stored?.runtimes);
+ });
+
it('round-trips explicit true and false Pi image-input capabilities', async () => {
mountDb();
await createCustomProvider({
diff --git a/apps/desktop/src/main/maker-host/__tests__/piNativeProviders.test.ts b/apps/desktop/src/main/maker-host/__tests__/piNativeProviders.test.ts
index cce1b0a8ff..38c5cd4d04 100644
--- a/apps/desktop/src/main/maker-host/__tests__/piNativeProviders.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/piNativeProviders.test.ts
@@ -428,6 +428,25 @@ describe('resolvePiCindyGatewayModelApi', () => {
});
describe('buildPiNativeProvidersFromConfigs', () => {
+ // Tier 2: the actual launch builder must carry a user's V6 selection, including
+ // protocol limits, instead of reverting to the connection's Messages default.
+ it.each(['anthropic-messages', 'openai-completions', 'openai-responses'] as const)(
+ 'launches Kimi through the selected V6 %s interface', (api) => {
+ const config = { id: 'kimi-v6', name: 'Kimi', runtimes: { pi: {
+ catalogPresetId: 'moonshot-kimi-code', baseUrl: 'https://api.kimi.com/coding',
+ wireProtocol: 'anthropic-messages' as const,
+ models: [{ id: 'k3.1-pro', name: 'K3.1', interfaceId: `moonshot-kimi-code-${api}` }],
+ } } };
+ const provider = buildUserProvider(config);
+ const catalog = { ...BUNDLED_CATALOG, providers: [...BUNDLED_CATALOG.providers, provider] };
+ const result = buildPiNativeProvidersFromConfigs([config], () => 'fixture-key', undefined, undefined, catalog);
+ const projected = result.providers[0].models[0];
+ expect(projected.api ?? result.providers[0].api).toBe(api);
+ expect(projected.baseUrl ?? result.providers[0].baseUrl).toBe(api === 'anthropic-messages' ? 'https://api.kimi.com/coding' : 'https://api.kimi.com/coding/v1');
+ expect(projected).toMatchObject({ wireId: 'k3.1-pro', contextWindow: 262144, maxTokens: 262144, input: ['text', 'image'] });
+ },
+ );
+
it('carries catalog-generated suppliers through the real Pi launch mapping', () => {
const generatedIds = ['ant-ling', 'baseten', 'cerebras', 'fireworks', 'groq',
'huggingface', 'nvidia', 'together', 'mistral', 'opencode', 'qwen-token-plan',
diff --git a/apps/desktop/src/main/maker-host/__tests__/piProviderTransport.test.ts b/apps/desktop/src/main/maker-host/__tests__/piProviderTransport.test.ts
index 3ad1dd234a..2d1a482f93 100644
--- a/apps/desktop/src/main/maker-host/__tests__/piProviderTransport.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/piProviderTransport.test.ts
@@ -13,6 +13,42 @@ const reply = [
].map(value => `data: ${JSON.stringify(value)}\n\n`).join('') + 'data: [DONE]\n\n';
describe('Pi-owned transport for Cindy harnesses', () => {
+ // Tier 2: exercise official serializers, not just selected API labels. Responses
+ // input is converted once and must reach Kimi's matching endpoint and wire ID.
+ it.each(['anthropic-messages', 'openai-responses', 'openai-completions'] as const)(
+ 'serializes Kimi V6 %s through the installed official adapter', async api => {
+ const provider = buildUserProvider({ id: 'kimi-v6', name: 'Kimi', runtimes: { codex: {
+ baseUrl: 'https://api.kimi.com/coding/v1', catalogPresetId: 'moonshot-kimi-code', wireProtocol: 'openai-chat',
+ models: [{ id: 'k3.1-pro', name: 'K3.1', interfaceId: `moonshot-kimi-code-${api}` }],
+ } } }, { modelRegistry: BUNDLED_CATALOG.modelRegistry });
+ const model = provider.models.codex![0];
+ const row = invocationModelRecord(model, model.route!.baseUrl)!;
+ let sent: Record<string, unknown> | undefined;
+ let destination = '';
+ const send = createPiProviderFetch({ row, providerId: provider.id, apiKey: 'fixture-key', fetchImpl: async (url, init) => {
+ destination = String(url);
+ sent = JSON.parse(String(init?.body));
+ const events = [
+ { type: 'message_start', message: { id: 'msg-fixture', type: 'message', role: 'assistant', model: 'k3.1-pro', content: [], stop_reason: null, usage: { input_tokens: 1, output_tokens: 0 } } },
+ { type: 'message_delta', delta: { stop_reason: 'end_turn' }, usage: { output_tokens: 0 } },
+ { type: 'message_stop' },
+ ];
+ const body = api === 'openai-completions' ? reply : api === 'openai-responses'
+ ? 'data: {"type":"response.completed","response":{"id":"fixture","status":"completed","output":[],"usage":{"input_tokens":1,"output_tokens":0,"total_tokens":1}}}\n\n'
+ : events.map(e => `event: ${e.type}\ndata: ${JSON.stringify(e)}\n\n`).join('');
+ return new Response(body, { headers: { 'content-type': 'text/event-stream' } });
+ } });
+ const result = await (await send('https://unused.invalid', { body: JSON.stringify({
+ model: model.id, input: 'Hello', max_output_tokens: 1024, stream: true,
+ }) })).text();
+ expect(destination.split('?')[0]).toBe('https://api.kimi.com/coding' + (api === 'anthropic-messages' ? '/v1/messages' : api === 'openai-responses' ? '/v1/responses' : '/v1/chat/completions'));
+ expect(result).toContain('response.completed');
+ expect(result).not.toContain('response.failed');
+ expect(sent).toMatchObject({ model: 'k3.1-pro' });
+ expect(Array.isArray(sent?.[api === 'openai-responses' ? 'input' : 'messages'])).toBe(true);
+ },
+ );
+
it.each([true, false, undefined])('sends discovered Sub2API effort and declared Fast (%s) through the native Chat adapter', async supportsFastMode => {
const upstream = 'https://sub2api.example/custom/v1';
const models = parseModelsListResponse({ data: [{ id: 'grok-4.7',
diff --git a/apps/desktop/src/main/maker-host/__tests__/providerRoute.test.ts b/apps/desktop/src/main/maker-host/__tests__/providerRoute.test.ts
index 6fa8663db7..e4410688fe 100644
--- a/apps/desktop/src/main/maker-host/__tests__/providerRoute.test.ts
+++ b/apps/desktop/src/main/maker-host/__tests__/providerRoute.test.ts
@@ -1,3 +1,10 @@
+import { createServer } from 'node:http';
+import { createAnthropicCompatProxy } from '@cindy/anthropic-compat-proxy';
+import { loadCatalogWithSource, type ModelRegistry } from '@cindy/model-providers';
+import { mkdtempSync, rmSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import path from 'node:path';
+import { configureSessionModelInterfaceStorage, sessionModelInterface } from '../session-model-interface.js';
import { afterEach, describe, it, expect, vi } from 'vitest';
const { mockGetAppCapabilities } = vi.hoisted(() => ({
@@ -1970,3 +1977,83 @@ describe('resolveVisionBackendRoute(视觉桥复用统一路由器)', () =>
expect(resolveVisionBackendRoute('nokey-provider', 'nokey-model', null)).toBeNull();
});
});
+
+// Tier: integration. Persisted transport must survive catalog refresh + process
+// restart, while retirement blocks dispatch. No credentials enter the snapshot.
+describe('task interface snapshot', () => {
+ it('pins across restart and refuses retired profiles without falling back', () => {
+ const directory = mkdtempSync(path.join(tmpdir(), 'cindy-interface-'));
+ const registry = structuredClone(BUNDLED_CATALOG.modelRegistry!);
+ const config = { id: 'snapshot-kimi', name: 'Kimi', runtimes: { codex: {
+ catalogPresetId: 'moonshot-kimi-code', baseUrl: 'https://api.kimi.com/coding/v1',
+ wireProtocol: 'openai-chat' as const, models: [{ id: 'k3.1-pro', name: 'Kimi' }],
+ } } };
+ try {
+ configureSessionModelInterfaceStorage(() => directory);
+ const initial = buildUserProvider(config, { modelRegistry: registry }).models.codex![0];
+ const first = sessionModelInterface('task', config.id, 'codex', initial, registry)!;
+ expect(first.api).toBe('openai-responses');
+ expect(first.defaults).toMatchObject({ contextWindow: 262144, maxOutputTokens: 262144 });
+ registry.models.flatMap(e => e.routes).find(r => r.providerId === 'moonshot-kimi-code' && r.modelId === 'k3.1-pro')!.preferredInterfaces!.codex = ['moonshot-kimi-code-openai-completions'];
+ const next = buildUserProvider(config, { modelRegistry: registry }).models.codex![0];
+ configureSessionModelInterfaceStorage(() => directory); // real disk restore
+ expect(sessionModelInterface('task', config.id, 'codex', next, registry)).toEqual(first);
+ expect(sessionModelInterface('new-task', config.id, 'codex', next, registry)?.api).toBe('openai-completions');
+ registry.interfaceProfiles!.find(p => p.id === first.profileId)!.retired = true;
+ expect(() => sessionModelInterface('task', config.id, 'codex', next, registry)).toThrow('MODEL_INTERFACE_RETIRED');
+ } finally {
+ configureSessionModelInterfaceStorage(() => null);
+ rmSync(directory, { recursive: true, force: true });
+ }
+ });
+});
+
+// Tier: integration. Fixed production loader + resolver + proxy, real HTTP on
+// both sides. Only the served registry changes between calls; no client rebuild.
+it('dispatches a newly delivered model through all three existing HTTP interfaces', async () => {
+ let delivered: unknown;
+ const received: Array<{ url: string; body: Record<string, unknown>; auth?: string }> = [];
+ const upstream = createServer(async (req, res) => {
+ if (req.url?.startsWith('/api/model-catalog/catalog')) {
+ res.setHeader('content-type', 'application/json'); res.end(JSON.stringify(delivered)); return;
+ }
+ const chunks: Buffer[] = [];
+ for await (const chunk of req) chunks.push(Buffer.from(chunk));
+ received.push({ url: req.url!, body: JSON.parse(Buffer.concat(chunks).toString()), auth: req.headers.authorization });
+ res.setHeader('content-type', 'application/json'); res.end(JSON.stringify({ ok: true }));
+ });
+ await new Promise<void>(resolve => upstream.listen(0, '127.0.0.1', resolve));
+ const port = (upstream.address() as { port: number }).port;
+ const base = `http://127.0.0.1:${port}`;
+ let decision: ReturnType<typeof buildRouteDecision>;
+ const proxy = await createAnthropicCompatProxy({ upstream: base, routingTransform: () => decision });
+ try {
+ for (const [index, api] of ['anthropic-messages', 'openai-responses', 'openai-completions'].entries()) {
+ const wire = api === 'openai-completions' ? 'openai-chat' : api;
+ const requestPath = ['/v1/messages', '/responses', '/chat/completions'][index];
+ const modelId = `future-model-${index}`;
+ const registry: ModelRegistry = { schemaVersion: 6, updatedAt: `2099-01-0${index + 1}T00:00:00.000Z`,
+ interfaceProfiles: ['anthropic-messages', 'openai-responses', 'openai-completions'].map((api, i) => ({ id: `fixture-api-${i}`, providerId: 'fixture', api, baseUrl: base, inputBaseUrls: [base], requestPath: ['/v1/messages', '/responses', '/chat/completions'][i] })),
+ models: [{ id: modelId, name: 'Future', routes: [{ providerId: 'fixture', modelId, agents: ['codex'],
+ defaults: { contextWindow: 32768, maxOutputTokens: 1024 }, interfaces: [{ profileId: `fixture-api-${index}`, wireModelId: `wire-${index}` }], preferredInterfaces: { codex: [`fixture-api-${index}`] } }] }],
+ };
+ delivered = { version: '2', providers: BUNDLED_CATALOG.providers, modelRegistry: registry };
+ const loaded = await loadCatalogWithSource({ baseUrl: base }, { fetchText: async url => (await fetch(url)).text() });
+ expect(loaded.source).toBe('remote');
+ const provider = buildUserProvider({ id: 'http-account', name: 'HTTP', runtimes: { codex: {
+ catalogPresetId: 'fixture', baseUrl: base, wireProtocol: 'openai-chat', models: [{ id: modelId, name: 'Future' }],
+ } } }, { modelRegistry: loaded.catalog.modelRegistry });
+ const routing = providerRoutingForModel(provider, 'codex', modelId)!;
+ expect(routing.wireProtocol).toBe(wire);
+ decision = buildRouteDecision(routing, null, 'codex', 'fixture-key');
+ decision = { ...decision!, pathOverride: routing.requestPath };
+ const response = await fetch(`${proxy.url}/responses`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ model: modelId, stream: false }) });
+ expect(await response.json()).toEqual({ ok: true });
+ expect(received.at(-1)).toMatchObject({ url: requestPath, body: { model: `wire-${index}` }, auth: 'Bearer fixture-key' });
+ }
+ } finally {
+ await proxy.dispose();
+ upstream.closeAllConnections();
+ await new Promise<void>((resolve, reject) => upstream.close(error => error ? reject(error) : resolve()));
+ }
+});
diff --git a/apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts b/apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts
index b0bd4ac967..33cada2fd5 100644
--- a/apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts
+++ b/apps/desktop/src/main/maker-host/anthropic-compat-proxy-host.ts
@@ -48,7 +48,7 @@ import { buildVisionBridgeProxyTransform } from '../vision-bridge/vision-bridge-
import { CLAUDE_PROVIDER_AUTH_PLACEHOLDER_KEY, anthropicCatalogModelIds, isAnthropicWireModel } from './claude-gateway-config.js';
import { getActiveCatalog } from './active-catalog.js';
-import { providerModelRecord } from '@cindy/model-providers';
+import { providerModelRecord, modelWithInterface } from '@cindy/model-providers';
import { outboundFetch } from './outbound-fetch.js';
import { invocationModelRecord, requiresNativeProviderAuth } from './pi-provider-transport.js';
import { createClaudeProviderBridge } from './claude-provider-bridge.js';
@@ -93,6 +93,7 @@ import {
import {
buildRouteDecision,
providerRoutingForModel,
+ sessionProviderRoutingForModel,
gatewayDefaultRouteDecision,
getUserProviderIdForSession,
inferProviderIdForModel,
@@ -151,8 +152,9 @@ let _readGatewayKey: () => string | null = () => null;
function attachClaudeProviderBridge(route: RoutingDecision, providerId: string, wireModel: string, sessionId?: string): RoutingDecision {
if (route.localHandler) return route;
const provider = getActiveCatalog().providers.find(p => p.id === providerId);
- const model = provider?.models['claude-code']?.find(m => m.id === wireModel);
- const routing = provider ? providerRoutingForModel(provider, 'claude-code', wireModel) : null;
+ const catalogModel = provider?.models['claude-code']?.find(m => m.id === wireModel);
+ const routing = provider ? (sessionId ? sessionProviderRoutingForModel(sessionId, provider, 'claude-code', wireModel) : providerRoutingForModel(provider, 'claude-code', wireModel)) : null;
+ const model = catalogModel && modelWithInterface(catalogModel, routing?.modelInterface);
// Adapter identity belongs to the declared route. An OAuth account can select
// another host without becoming a different provider (e.g. Copilot Business).
const nativeRow = model && routing && model.api ? invocationModelRecord(model, routing.upstream) : undefined;
@@ -179,6 +181,7 @@ function attachClaudeProviderBridge(route: RoutingDecision, providerId: string,
fetchImpl: outboundFetch,
});
return { ...route, localHandler: args => handler.handle({ ...args,
+ ...(routing.modelInterface && isPlainObject(args.parsedBody) ? { parsedBody: { ...args.parsedBody, model: routing.modelInterface.wireModelId } } : {}),
prefs: { reasoningEffort: (sessionId ? getSessionEffort(sessionId) : null) ?? model.defaultEffort ?? undefined,
fast: sessionId ? getSessionFastMode(sessionId) : false },
}) };
diff --git a/apps/desktop/src/main/maker-host/codex-proxy-host.ts b/apps/desktop/src/main/maker-host/codex-proxy-host.ts
index 795ae91566..b04329eb9a 100644
--- a/apps/desktop/src/main/maker-host/codex-proxy-host.ts
+++ b/apps/desktop/src/main/maker-host/codex-proxy-host.ts
@@ -10,6 +10,11 @@ import {
} from '@cindy/responses-chat-bridge';
import {
isCustomRoutedProvider,
+ availableModelInterfaces,
+ modelWithInterface,
+ resolveModelMetadata,
+ BUNDLED_CATALOG,
+ type ModelInterfaceSnapshot,
isCodexGatewayWireModel,
providerCatalogId,
providerModelRecord,
@@ -1012,27 +1017,6 @@ function isGoogleGeminiChatUpstream(upstream: string): boolean {
}
}
-const MOONSHOT_CHAT_HOSTS = new Set(['api.moonshot.cn', 'api.moonshot.ai']);
-/** Kimi Code (coding plan) official endpoint DNS boundary. */
-const KIMI_CODING_CHAT_HOST = 'api.kimi.com';
-/** Model ids on the Kimi Code Codex (openai-chat) route verified for image input. */
-const KIMI_CODING_IMAGE_CHAT_MODELS = new Set([
- 'k3.1-pro',
- 'k3.1-pro-highspeed',
- 'k3',
- 'k3-256k',
- 'kimi-for-coding',
- 'kimi-for-coding-highspeed',
-]);
-/** Moonshot 开放平台上官方文档确认支持图片输入的 model id。 */
-const MOONSHOT_IMAGE_CHAT_MODELS = new Set([
- 'kimi-k3.1-pro',
- 'kimi-k3.1-pro-highspeed',
- 'kimi-k3',
- 'kimi-k2.7-code',
- 'kimi-k2.7-code-highspeed',
- 'kimi-k2.6',
-]);
/** 火山方舟(豆包)官方 DNS 边界:ark.<region>.volces.com(如 ark.cn-beijing.volces.com)。 */
const VOLCENGINE_ARK_CHAT_HOST_RE = /^ark\.[a-z0-9-]+\.volces\.com$/;
/** 阿里云百炼 Coding Plan / Token Plan / 按量付费官方 DNS 边界。 */
@@ -1132,12 +1116,15 @@ export function chatBridgeCapabilitiesForRoute(
upstream: string,
realModel: string,
fallback: ChatBridgeCapabilities = CHAT_BRIDGE_DEFAULT_CAPABILITIES,
+ selected?: ModelInterfaceSnapshot,
): ChatBridgeCapabilities {
let capabilities = fallback;
if (isDeepSeekReasoningHistoryRoute(upstream, realModel)) {
capabilities = { ...capabilities, reasoningHistoryField: 'reasoning_content' };
}
- if (isVerifiedImageChatRoute(upstream, realModel)) {
+ if (selected ? selected.api === 'openai-completions' && selected.compatibility.includes('chat-image-v1') &&
+ selected.defaults.supportsImageInput === true && selected.route.baseUrl.replace(/\/+$/, '') === upstream.replace(/\/+$/, '')
+ : isVerifiedImageChatRoute(upstream, realModel)) {
capabilities = { ...capabilities, imageInput: 'image_url' };
}
return capabilities;
@@ -1175,8 +1162,15 @@ function isVerifiedImageChatRoute(upstream: string, realModel: string): boolean
}
if (url.protocol !== 'https:') return false;
const host = url.hostname.toLowerCase();
- if (MOONSHOT_IMAGE_CHAT_MODELS.has(realModel)) return MOONSHOT_CHAT_HOSTS.has(host);
- if (KIMI_CODING_IMAGE_CHAT_MODELS.has(realModel)) return host === KIMI_CODING_CHAT_HOST;
+ // Legacy callers and auxiliary requests use the same catalog bindings, without
+ // restoring a parallel model allowlist. An accepted remote registry is complete.
+ const registry = getActiveCatalog().modelRegistry ?? BUNDLED_CATALOG.modelRegistry;
+ for (const providerId of new Set((registry?.interfaceProfiles ?? []).map(p => p.providerId))) {
+ const declared = availableModelInterfaces(registry, providerId, realModel, upstream, 'codex')
+ .find(p => p.api === 'openai-completions' && p.compatibility.includes('chat-image-v1'));
+ if (declared && resolveModelMetadata(registry, providerId, realModel, undefined, undefined,
+ 'codex', undefined, undefined, undefined, declared.defaults).supportsImageInput === true) return true;
+ }
if (isDoubaoVisionModel(realModel)) return VOLCENGINE_ARK_CHAT_HOST_RE.test(host);
if (isQwenImageChatModel(realModel)) return DASHSCOPE_CODING_CHAT_HOSTS.has(host);
return false;
@@ -1194,11 +1188,12 @@ function createChatBridgeDecision(
reasoningEffortOverride?: CodexSubagentRouteSnapshot['reasoningEffort'],
): RoutingDecision | null {
if (!route) return null;
- const nativeModel = getActiveCatalog().providers.find(p => p.id === route.providerId)?.models.codex?.find(m => m.id === (requestModelOverride ?? wireModel));
+ const catalogNativeModel = getActiveCatalog().providers.find(p => p.id === route.providerId)?.models.codex?.find(m => m.id === (requestModelOverride ?? wireModel));
+ const nativeModel = catalogNativeModel && modelWithInterface(catalogNativeModel, route.routing.modelInterface);
if (route.routing.wireProtocol !== 'openai-chat' && !nativeModel?.api) return null;
const { headers } = buildLocalHandlerHeaders(route, 'codex');
const stripPrefix = route.routing.modelIdRewrite?.stripPrefix;
- const realModel = rewriteChatBridgeModel(wireModel, stripPrefix);
+ const realModel = route.routing.modelInterface?.wireModelId ?? rewriteChatBridgeModel(wireModel, stripPrefix);
// localHandler 绕过 proxy 的 responseObserver,自定义(user/organization)供应商的上游错误不会被
// createProviderUpstreamErrorObserver 看到。这里显式把非 2xx 上游错误喂回同一广播通道,
// 让 Chat 桥接会话与透明自定义供应商一样弹结构化 providerError.* 提示。内置来源不广播
@@ -1222,6 +1217,7 @@ function createChatBridgeDecision(
route.routing.upstream,
realModel,
baseCapabilities,
+ route.routing.modelInterface,
);
const systemMessagePolicy = chatBridgeSystemMessagePolicyForRoute(
route.providerId,
@@ -1239,7 +1235,7 @@ function createChatBridgeDecision(
upstreamBase: route.routing.upstream,
...(route.routing.requestPath ? { chatCompletionsPath: route.routing.requestPath } : {}),
buildHeaders: async () => headers,
- rewriteModel: (model: string) => rewriteChatBridgeModel(model, stripPrefix),
+ rewriteModel: (model: string) => route.routing.modelInterface?.wireModelId ?? rewriteChatBridgeModel(model, stripPrefix),
capabilities,
...(onUpstreamError ? { onUpstreamError } : {}),
// localHandler 分支的上游请求由 chat bridge 自己发,绕开了 compat-proxy 转发层的
@@ -1260,9 +1256,10 @@ function createChatBridgeDecision(
// 只把入站头快照交给 bridge 解析稳定会话 ID(→ x-opencode-session,#4073);bridge 不透传
// 这些头,凭证与 Codex 账号头仍由 buildLocalHandlerHeaders 的隔离边界管。
// ctx 在生产路径恒有;既有测试与旧调用方可能省略,按「无入站头」处理即不附加会话头。
- const actualModel = isPlainObject(body) && typeof body.model === 'string'
- ? rewriteChatBridgeModel(body.model, stripPrefix) : realModel;
- const selected = getActiveCatalog().providers.find(p => p.id === providerId)?.models.codex?.find(m => m.id === actualModel);
+ const actualModel = route.routing.modelInterface?.wireModelId ?? (isPlainObject(body) && typeof body.model === 'string'
+ ? rewriteChatBridgeModel(body.model, stripPrefix) : realModel);
+ const catalogSelected = getActiveCatalog().providers.find(p => p.id === providerId)?.models.codex?.find(m => m.id === (requestModelOverride ?? wireModel));
+ const selected = catalogSelected && modelWithInterface(catalogSelected, route.routing.modelInterface);
const standard = selected?.api ? invocationModelRecord(selected, route.routing.upstream) : !route.routing.requestPath
? providerModelRecord(actualModel, route.routing.upstream, 'openai-chat') : undefined;
if (standard && isPlainObject(body)) {
@@ -1592,7 +1589,8 @@ function createLocalBridgeDecision(
reasoningEffortOverride?: CodexSubagentRouteSnapshot['reasoningEffort'],
): RoutingDecision | null {
if (!route) return null;
- const nativeModel = getActiveCatalog().providers.find(p => p.id === route.providerId)?.models.codex?.find(m => m.id === (requestModelOverride ?? wireModel));
+ const catalogNativeModel = getActiveCatalog().providers.find(p => p.id === route.providerId)?.models.codex?.find(m => m.id === (requestModelOverride ?? wireModel));
+ const nativeModel = catalogNativeModel && modelWithInterface(catalogNativeModel, route.routing.modelInterface);
if (route.routing.wireProtocol === 'openai-chat' || (nativeModel?.api && (nativeModel.api !== 'openai-responses' || requiresNativeProviderAuth(invocationModelRecord(nativeModel, route.routing.upstream))))) {
const decision = createChatBridgeDecision(
route,
@@ -3027,7 +3025,8 @@ export function createModelRoutingTransform(
: sessionId
? getSessionRoutingDescriptor(sessionId, 'codex', model || undefined)
: null;
- const selectedModel = getActiveCatalog().providers.find(p => p.id === explicitProviderId)?.models.codex?.find(m => m.id === model);
+ const catalogSelectedModel = getActiveCatalog().providers.find(p => p.id === explicitProviderId)?.models.codex?.find(m => m.id === model);
+ const selectedModel = catalogSelectedModel && modelWithInterface(catalogSelectedModel, selectedRouting?.modelInterface);
const selectedUsesLocalBridge =
ctx.method === 'POST'
&& Boolean(model)
diff --git a/apps/desktop/src/main/maker-host/custom-provider-store.ts b/apps/desktop/src/main/maker-host/custom-provider-store.ts
index 073d1f47f2..3df5e532e1 100644
--- a/apps/desktop/src/main/maker-host/custom-provider-store.ts
+++ b/apps/desktop/src/main/maker-host/custom-provider-store.ts
@@ -273,6 +273,7 @@ function validateRuntime(agent: string, rt: unknown): ValidationResult {
if (mm.supportsImageInput !== undefined && typeof mm.supportsImageInput !== 'boolean') {
return invalid(`runtime '${agent}' model.supportsImageInput must be a boolean`);
}
+ if (mm.interfaceId !== undefined && (typeof mm.interfaceId !== 'string' || !mm.interfaceId.trim() || mm.interfaceId.length > 256)) return invalid(`runtime '${agent}' model.interfaceId invalid`);
if (mm.api !== undefined && !isPiModelApi(mm.api)) return invalid(`runtime '${agent}' model.api invalid`);
if (mm.piApi !== undefined && (agent !== 'pi' || !isPiModelApi(mm.piApi))) {
return invalid(`runtime '${agent}' model.piApi invalid`);
@@ -601,6 +602,7 @@ function normalizeRuntime(
? { supportsUltrafastMode: m.supportsUltrafastMode } : {}),
...(m.discoveredCost ? { discoveredCost: m.discoveredCost } : {}),
...(m.nameExplicit === true ? { nameExplicit: true } : {}),
+ ...(m.interfaceId ? { interfaceId: m.interfaceId } : {}),
...(m.api ? { api: m.api } : {}),
...(agent === 'pi' && m.piApi ? { piApi: m.piApi } : {}),
...(m.route
@@ -841,6 +843,7 @@ function parseRuntimes(raw: string): Partial<Record<AgentKind, CustomProviderRun
id: String(m.id),
name: String(m.name ?? ''),
...pickModelMetadata(m),
+ ...(typeof m.interfaceId === 'string' && m.interfaceId.trim() && m.interfaceId.length <= 256 ? { interfaceId: m.interfaceId } : {}),
...(isPiModelApi(m.api) ? { api: m.api } : {}),
...(agent === 'pi' && isPiModelApi(m.piApi) ? { piApi: m.piApi } : {}),
...(route ? { route } : {}),
diff --git a/apps/desktop/src/main/maker-host/index.ts b/apps/desktop/src/main/maker-host/index.ts
index 4b95f8e009..4d2e57033e 100644
--- a/apps/desktop/src/main/maker-host/index.ts
+++ b/apps/desktop/src/main/maker-host/index.ts
@@ -1,3 +1,4 @@
+import { configureSessionModelInterfaceStorage, sessionModelInterface } from './session-model-interface.js';
import { readGeneratedImageEpoch } from '../cindy-media/generatedImageStorage';
import { readAgentCapabilityCatalog, RUNTIME_MCP_NAMES_KEY, type AgentCapabilityQuery } from './agentCapabilityCatalog.js';
import { listCindyManagedSkills, prepareCindyCodexSkills } from './managed-skills.js';
@@ -2953,6 +2954,12 @@ export function getMaker(): Maker {
}
// 所有创建路径共用的派发边界,opts.providerId 此刻已是本次启动的终值。
freezeSessionProviderAtStart(sessionId, opts.providerId);
+ const interfaceProvider = getActiveCatalog().providers.find(p => p.id === opts.providerId);
+ const interfaceModel = interfaceProvider?.models[opts.agentKind]?.find(m => m.id === opts.model);
+ if (interfaceProvider && interfaceModel) sessionModelInterface(sessionId, interfaceProvider.id, opts.agentKind,
+ interfaceModel, getActiveCatalog().modelRegistry,
+ opts.resumeSessionId ? interfaceProvider.routing[opts.agentKind]?.wireProtocol : undefined);
+
if (!opts.remoteHostId && !opts.agentDeviceId) {
opts.fastModePolicy = createSubscriptionFastPolicy(sessionId, () => getSessionProvider(sessionId)
?? resolveDesktopModelContextProviderId(getDesktopSelectableCatalog(), opts.agentKind, null, opts.model));
@@ -3677,3 +3684,6 @@ export async function shutdownLspServerPool(): Promise<void> {
// re-exports for IPC layer
export { desktopClaudeAuthAdapter, desktopCodexAuthAdapter };
+
+// Lazy path lookup follows owner changes; installing the reader performs no IO.
+configureSessionModelInterfaceStorage(() => ownerScopedUserDataPath('model-interface-snapshots'));
diff --git a/apps/desktop/src/main/maker-host/pi-host.ts b/apps/desktop/src/main/maker-host/pi-host.ts
index 7e5a95261a..4e44a56bbd 100644
--- a/apps/desktop/src/main/maker-host/pi-host.ts
+++ b/apps/desktop/src/main/maker-host/pi-host.ts
@@ -1,3 +1,5 @@
+import { modelWithInterface } from '@cindy/model-providers';
+import { sessionModelInterface } from './session-model-interface.js';
import { ANSWER_DELIVERY_PROMPT } from '@cindy/maker-shared/rich-answer-guide';
import { listCindyManagedSkills } from './managed-skills.js';
import { scanLocalCustomizations } from '../skillhub/customizationScanHost';
@@ -1221,6 +1223,7 @@ export function buildPiNativeProvidersFromConfigs(
reasoningEfforts?: PiReasoningEffort[];
api?: PiModelApi;
piApi?: PiModelApi;
+ selectedInterface?: import('@cindy/model-providers').ModelInterfaceSnapshot;
route?: {
baseUrl: string;
wireProtocol: ProviderWireProtocol;
@@ -1257,8 +1260,15 @@ export function buildPiNativeProvidersFromConfigs(
}
};
for (const cfg of configs) {
- const rt = cfg.runtimes.pi;
- if (!rt) continue;
+ const savedRuntime = cfg.runtimes.pi;
+ if (!savedRuntime) continue;
+ const resolvedProvider = resolvedCatalog?.providers.find(p => p.id === runtimeCustomProviderId(cfg.id));
+ const rt = { ...savedRuntime, models: savedRuntime.models.map(model => {
+ const resolved = resolvedProvider?.models.pi?.find(item => item.id === model.id);
+ return resolved?.selectedInterface ? { ...model, api: resolved.api, piApi: resolved.piApi,
+ route: resolved.route, selectedInterface: resolved.selectedInterface } : model;
+ }) };
+
const authMethod = cfg.auth?.method ?? 'apiKey';
if (authMethod === 'oauth' && (!cfg.auth?.oauth || !oauthProxyEndpoint)) {
onSkip?.(cfg.id, 'oauth proxy not ready for pi native');
@@ -1431,6 +1441,7 @@ export function buildPiNativeProvidersFromConfigs(
m.route && explicitRouteApi === modelApi ? explicitRoute?.baseUrl : undefined;
const spec = {
id: m.id,
+ ...(m.selectedInterface ? { wireId: m.selectedInterface.wireModelId } : {}),
...(authMethod === 'oauth' ? { cacheIdentityBaseUrl: modelBaseUrl ?? rt.baseUrl } : {}),
...(resolved?.supportsFastMode !== undefined ? { supportsFastMode: resolved.supportsFastMode } : {}),
...(m.api || m.piApi || modelApi !== providerApi ? { api: modelApi } : {}),
@@ -1736,6 +1747,7 @@ export function resolvePiCindyGatewayModelSpec(
/** BYOM:读 DB 自定义 provider + safeStorage key → pi 原生 provider spec。IO 外壳,逻辑在上面。 */
export async function resolvePiNativeProviders(ctx: {
+ sessionId?: string;
workingDir: string;
remoteHostId?: string | null;
providerId?: string | null;
@@ -1826,12 +1838,23 @@ export async function resolvePiNativeProviders(ctx: {
}
}
}
+ const sessionCatalog = getActiveCatalog();
+ const pinnedCatalog = ctx.sessionId && ctx.purpose !== 'preview' ? { ...sessionCatalog,
+ providers: sessionCatalog.providers.map(provider => provider.id !== ctx.providerId ? provider : {
+ ...provider, models: { ...provider.models, pi: provider.models.pi?.map(model => {
+ if (model.id !== ctx.model) return model;
+ const selected = sessionModelInterface(ctx.sessionId!, provider.id, 'pi', model, sessionCatalog.modelRegistry,
+ ctx.resumeSessionId ? provider.routing.pi?.wireProtocol : undefined);
+ return modelWithInterface(model, selected);
+ }) },
+ }),
+ } : sessionCatalog;
const custom = buildPiNativeProvidersFromConfigs(
mergeByokNativeConfigs(configs, getActiveCatalog().providers),
readCustomProviderKey,
(id, reason) => log.warn('resolvePiNativeProviders: skipped custom provider', { id, reason }),
bundledModels ?? undefined,
- getActiveCatalog(),
+ pinnedCatalog,
!isRemote && compatProxyReady ? getClaudeEndpoint() : undefined,
);
// Remote PI cannot use the local native overlay. Preserve upstream's exact
diff --git a/apps/desktop/src/main/maker-host/provider-route.ts b/apps/desktop/src/main/maker-host/provider-route.ts
index 274e607e5f..053a70e2fc 100644
--- a/apps/desktop/src/main/maker-host/provider-route.ts
+++ b/apps/desktop/src/main/maker-host/provider-route.ts
@@ -21,6 +21,7 @@
import {
actualSourceIdForModel,
+ modelWithInterface,
chatEligibleSourcesForModel,
isExclusiveXaiModelId,
isCodexGatewayWireModel,
@@ -40,6 +41,7 @@ import type { RoutingDecision } from '@cindy/anthropic-compat-proxy';
import { getActiveCatalog, isXdCodexAnthropicBridgeModel } from './active-catalog.js';
import { getAppCapabilities } from '../appCapabilities.js';
+import { sessionModelInterface, assertModelInterfaceAvailable } from './session-model-interface.js';
import { getSessionProvider } from './session-provider-store.js';
/**
@@ -336,7 +338,23 @@ function hasHeader(headers: Record<string, string> | undefined, expectedName: st
* (cc=`x-api-key`,codex=`authorization: Bearer`)。内置三家不传 / 忽略。
* `oauthToken` 仅 `oauth-token` 策略(描述符驱动的通用 OAuth 供应商)使用。
*/
-export function buildRouteDecision(
+export function buildRouteDecision(...args: Parameters<typeof buildRouteDecisionBase>): RoutingDecision | null {
+ const decision = buildRouteDecisionBase(...args);
+ const selected = args[0].modelInterface;
+ if (!decision || !selected || decision.localHandler) return decision;
+ return { ...decision, compatibilityProfiles: selected.compatibility,
+ transformRequestBody: (body) => {
+ let parsed: unknown;
+ try { parsed = JSON.parse(body.toString('utf8')); } catch { return { body }; }
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) return { body };
+ const object = parsed as Record<string, unknown>;
+ if (typeof object.model === 'string') object.model = selected.wireModelId;
+ return { body: Buffer.from(JSON.stringify(parsed)) };
+ },
+ };
+}
+
+function buildRouteDecisionBase(
routing: RoutingDescriptor,
gatewayKey: string | null,
agent: AgentKind,
@@ -534,6 +552,7 @@ export function providerRoutingForModel(
const model = wireModel
? provider.models[agent]?.find((candidate) => candidate.id === wireModel)
: undefined;
+ if (model?.interfaceUnavailable) throw new Error('MODEL_INTERFACE_UNAVAILABLE');
const modelRoute = model?.route;
const piRoute =
agent === 'pi'
@@ -556,6 +575,7 @@ export function providerRoutingForModel(
delete inherited.requestPath;
return {
...inherited,
+ ...(model?.selectedInterface ? { modelInterface: model.selectedInterface } : {}),
upstream: agent === 'pi' ? piRoute!.baseUrl : modelRoute!.baseUrl,
wireProtocol: agent === 'pi' ? piRoute!.wireProtocol : modelRoute!.wireProtocol,
...(agent === 'pi'
@@ -568,6 +588,17 @@ export function providerRoutingForModel(
};
}
+/** Pin only the model transport. Live credentials, provider disable and namespace
+ * restrictions still come from the current connection. */
+export function sessionProviderRoutingForModel(sessionId: string, provider: Provider, agent: AgentKind, wireModel?: string): RoutingDescriptor | null {
+ const model = provider.models[agent]?.find(m => m.id === wireModel);
+ const selected = model && sessionModelInterface(sessionId, provider.id, agent, model, getActiveCatalog().modelRegistry);
+ const pinned = selected ? { ...provider, models: { ...provider.models,
+ [agent]: provider.models[agent]?.map(m => m.id === wireModel ? modelWithInterface(m, selected) : m),
+ } } : provider;
+ return providerRoutingForModel(pinned, agent, wireModel);
+}
+
/**
* 某 provider 对某 agent 的路由是否服务该 wire model(modelPrefixes 语义;未声明 = true,
* provider 无该 agent 路由 = false)。
@@ -613,7 +644,7 @@ export function getSessionRoutingDescriptor(
if (!providerId) return null;
if (isProviderRouteMutationInProgress(providerId)) return null;
const provider = getActiveCatalog().providers.find((candidate) => candidate.id === providerId);
- const routing = provider ? providerRoutingForModel(provider, agent, wireModel) : null;
+ const routing = provider ? sessionProviderRoutingForModel(sessionId, provider, agent, wireModel) : null;
if (!routing || !routingServesWireModel(routing, wireModel)) return null;
return routing;
}
@@ -723,7 +754,12 @@ export async function resolveSessionRoute(
): Promise<ResolvedSessionRoute | null> {
const providerId = getSessionProvider(sessionId);
if (!providerId) return null;
- return resolveProviderRouteById(providerId, agent, wireModel);
+ if (isProviderRouteMutationInProgress(providerId)) return null;
+ const provider = getActiveCatalog().providers.find(p => p.id === providerId);
+ const routing = provider ? sessionProviderRoutingForModel(sessionId, provider, agent, wireModel) : null;
+ if (!provider || !routing || !routingServesWireModel(routing, wireModel)) return null;
+ return { providerId, providerSource: provider.source, routing,
+ ...await readProviderRouteCredentials(provider, routing, agent) };
}
/** Build outbound headers for an already resolved local protocol handler. */
@@ -817,13 +853,14 @@ export async function resolveProviderRouteDecision(
agent: AgentKind,
gatewayKey: string | null,
wireModel?: string,
+ sessionId?: string,
): Promise<ResolvedProviderRouteDecision | null> {
const id = providerId?.trim() || null;
if (!id) return null;
if (isProviderRouteMutationInProgress(id)) return null;
if (id === 'xd' && !getAppCapabilities().canUseCindyGateway) return null;
const provider = getActiveCatalog().providers.find((p) => p.id === id);
- const routing = provider ? providerRoutingForModel(provider, agent, wireModel) : null;
+ const routing = provider ? (sessionId ? sessionProviderRoutingForModel(sessionId, provider, agent, wireModel) : providerRoutingForModel(provider, agent, wireModel)) : null;
if (!provider || !routing || !routingServesWireModel(routing, wireModel)) return null;
const { apiKey, oauthToken } = await readProviderRouteCredentials(provider, routing, agent);
const decision = buildRouteDecision(routing, gatewayKey, agent, apiKey, oauthToken);
@@ -855,6 +892,7 @@ export async function resolveFrozenProviderRouteDecision(
const provider = getActiveCatalog().providers.find((candidate) => candidate.id === id);
if (!provider || !isCustomRoutedProvider(provider) || !provider.agents.includes(agent)) return null;
if (!routingServesWireModel(routing, wireModel)) return null;
+ if (routing.modelInterface && wireModel) assertModelInterfaceAvailable(routing.modelInterface, wireModel, getActiveCatalog().modelRegistry);
const { apiKey, oauthToken } = await readProviderRouteCredentials(provider, routing, agent);
// Header overrides are user-owned configuration. Organization routes use only the trusted
// directory descriptor and managed credential, even if stale local data shares an id.
@@ -902,7 +940,7 @@ export function resolveSessionRouteDecision(
}
if (providerId === 'xd' && !getAppCapabilities().canUseCindyGateway) return null;
const provider = getActiveCatalog().providers.find((p) => p.id === providerId);
- const routing = provider ? providerRoutingForModel(provider, agent, wireModel) : null;
+ const routing = provider ? sessionProviderRoutingForModel(sessionId, provider, agent, wireModel) : null;
if (!routing) return null;
if (routing.disabled) return disabledProviderRouteDecision(providerId);
if (pendingDecision) return pendingDecision;
@@ -1283,7 +1321,7 @@ export function resolveVisionBackendRoute(
// 转发上游前还原 model id(对齐 rewriteModelIdForProvider)。
// XD 投影给 Codex 的模型走 Claude Messages 面时,折扣前缀不是后端真实模型名,
// 必须剥掉(否则上游 /v1/messages 收到 model:'codex/...' 404)。剥到目录裸 id。
- let model = modelId;
+ let model = routing.modelInterface?.wireModelId ?? modelId;
if (provider.id === 'xd' && isXdCodexAnthropicBridgeModel(modelId)) {
model = stripCodexGatewayWirePrefix(modelId).replace(/\[1m\]$/, '');
}
diff --git a/apps/desktop/src/main/maker-host/remote-claude-route.ts b/apps/desktop/src/main/maker-host/remote-claude-route.ts
index 3df4c88bbf..b45189a55b 100644
--- a/apps/desktop/src/main/maker-host/remote-claude-route.ts
+++ b/apps/desktop/src/main/maker-host/remote-claude-route.ts
@@ -45,6 +45,7 @@ const REMOTE_NO_AUTH_PLACEHOLDER = 'cindy-remote-no-auth';
const REMOTE_AGENT = 'claude-code' as const;
export async function resolveRemoteClaudeRoute(opts: {
+ sessionId?: string;
providerId?: string | null;
model: string;
}): Promise<RemoteClaudeRoute | null> {
@@ -67,8 +68,13 @@ export async function resolveRemoteClaudeRoute(opts: {
`[REMOTE_PROVIDER_UPDATING] provider "${providerId}" credentials are being updated on this desktop; retry in a moment`,
);
}
- const routed = await resolveProviderRouteDecision(providerId, REMOTE_AGENT, readClaudeApiKey());
- if (routed) return materializeRoutedProvider(routed);
+ const routed = await resolveProviderRouteDecision(providerId, REMOTE_AGENT, readClaudeApiKey(), opts.model, opts.sessionId);
+ if (routed) {
+ if (routed.routing.modelInterface && routed.routing.modelInterface.wireModelId !== opts.model) {
+ throw new Error('[REMOTE_PROVIDER_UNSUPPORTED] this interface needs model-id rewriting, which remote Claude Code cannot express');
+ }
+ return materializeRoutedProvider(routed);
+ }
// TOCTOU 兜底:resolver 内部也会因 mutation 窗口返回 null;若恰好在两次判定之间
// 窗口开启,报 UPDATING 而非 UNSUPPORTED(语义更准确,用户稍后重试即可)。
if (isProviderRouteMutationInProgress(providerId)) {
diff --git a/apps/desktop/src/main/maker-host/session-model-interface.ts b/apps/desktop/src/main/maker-host/session-model-interface.ts
new file mode 100644
index 0000000000..9a90de0de5
--- /dev/null
+++ b/apps/desktop/src/main/maker-host/session-model-interface.ts
@@ -0,0 +1,89 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { createHash, randomUUID } from 'node:crypto';
+import { MODEL_INTERFACE_CAPABILITIES } from '@cindy/model-providers';
+import type { AgentKind, CatalogModel, ModelInterfaceSnapshot, ModelRegistry } from '@cindy/model-providers';
+
+// Only non-secret interface metadata is pinned. Credentials and provider membership
+// remain live. The owner-scoped root is supplied by the host, never by a request.
+let storageRoot: () => string | null = () => null;
+const cache = new Map<string, Pin>();
+interface Pin { providerId: string; agent: AgentKind; modelId: string; selection: ModelInterfaceSnapshot }
+export function configureSessionModelInterfaceStorage(root: () => string | null): void {
+ storageRoot = root;
+ cache.clear();
+}
+function location(sessionId: string, identity: string) {
+ const root = storageRoot();
+ const name = createHash('sha256').update(sessionId).digest('hex');
+ const model = createHash('sha256').update(identity).digest('hex');
+ return { key: `${root ?? 'memory'}:${name}:${model}`, file: root ? path.join(root, name, `${model}.json`) : null };
+}
+function readPin(key: string, file: string | null): Pin | undefined {
+ if (cache.has(key)) return cache.get(key);
+ if (!file || !fs.existsSync(file)) return;
+ if (fs.statSync(file).size > 65536) throw new Error('MODEL_INTERFACE_SNAPSHOT_INVALID');
+ const value: Pin = JSON.parse(fs.readFileSync(file, 'utf8'));
+ if (!value || typeof value.providerId !== 'string' || typeof value.modelId !== 'string' ||
+ !['claude-code', 'codex', 'pi'].includes(value.agent) || !value.selection ||
+ typeof value.selection.profileId !== 'string' || typeof value.selection.route?.baseUrl !== 'string' ||
+ !Array.isArray(value.selection.compatibility)) throw new Error('MODEL_INTERFACE_SNAPSHOT_INVALID');
+ cache.set(key, value);
+ return value;
+}
+export function assertModelInterfaceAvailable(selection: ModelInterfaceSnapshot, modelId: string, registry?: ModelRegistry): void {
+ // An old-server compatibility response cannot revoke a previously accepted V6
+ // snapshot. In V6, deletion/retirement is authoritative; bundled data cannot revive it.
+ if (!registry || registry.schemaVersion < 6) return;
+ const profile = registry.interfaceProfiles?.find(p => p.id === selection.profileId);
+ const matches = registry.models.flatMap(entry => entry.routes
+ .filter(r => r.providerId === selection.providerId && r.modelId === modelId).map(route => ({ entry, route })));
+ const binding = matches[0]?.route.interfaces?.find(b => b.profileId === selection.profileId);
+ if (!profile || (profile.requires ?? []).some(c => !(MODEL_INTERFACE_CAPABILITIES as readonly string[]).includes(c)) ||
+ (binding?.requires ?? []).some(c => !(MODEL_INTERFACE_CAPABILITIES as readonly string[]).includes(c)) || profile.retired || profile.providerId !== selection.providerId ||
+ profile.api !== selection.api || new URL(profile.baseUrl).origin !== new URL(selection.route.baseUrl).origin ||
+ matches.length > 1 || matches[0]?.entry.status === 'retired' || binding?.retired ||
+ (matches[0]?.route.interfaces && !binding) ||
+ (!matches[0]?.route.interfaces && profile.modelIds && !profile.modelIds.includes(modelId))) throw new Error('MODEL_INTERFACE_RETIRED');
+}
+
+/** First dispatch captures a complete choice. Catalog refreshes and app restart
+ * reuse it; an explicit provider/model change captures a new choice. No network retry. */
+export function sessionModelInterface(
+ sessionId: string, providerId: string, agent: AgentKind, model: CatalogModel,
+ registry?: ModelRegistry, legacyWire?: string,
+): ModelInterfaceSnapshot | undefined {
+ const { key, file } = location(sessionId, JSON.stringify([providerId, agent, model.id]));
+ const previous = readPin(key, file);
+ if (previous?.providerId === providerId && previous.agent === agent && previous.modelId === model.id) {
+ assertModelInterfaceAvailable(previous.selection, model.id, registry);
+ return structuredClone(previous.selection);
+ }
+ if (model.interfaceUnavailable) throw new Error('MODEL_INTERFACE_UNAVAILABLE');
+ let selection = model.selectedInterface;
+ // A resumed pre-V6 task has no snapshot. Keep its saved transport on first migration.
+ if (legacyWire && !model.userModelConfig?.interfaceId && !model.userModelConfig?.api && !model.userModelConfig?.piApi && !model.userModelConfig?.route) {
+ const legacy = model.availableInterfaces?.find(p => p.route.wireProtocol === legacyWire);
+ if (legacy) selection = { ...legacy, defaults: { ...selection?.defaults, ...legacy.defaults } };
+ }
+ if (!selection) return;
+ assertModelInterfaceAvailable(selection, model.id, registry);
+ const pin = { providerId, agent, modelId: model.id, selection: structuredClone(selection) };
+ if (file) {
+ fs.mkdirSync(path.dirname(file), { recursive: true });
+ const temporary = `${file}.${randomUUID()}.tmp`;
+ try {
+ fs.writeFileSync(temporary, JSON.stringify(pin), { mode: 0o600, flag: 'wx' });
+ fs.renameSync(temporary, file);
+ } finally { if (fs.existsSync(temporary)) fs.unlinkSync(temporary); }
+ }
+ cache.set(key, pin);
+ return structuredClone(selection);
+}
+
+export function removeSessionModelInterface(sessionId: string): void {
+ const root = storageRoot();
+ const name = createHash('sha256').update(sessionId).digest('hex');
+ for (const key of cache.keys()) if (key.startsWith(`${root ?? 'memory'}:${name}:`)) cache.delete(key);
+ if (root) fs.rmSync(path.join(root, name), { recursive: true, force: true });
+}
diff --git a/apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx b/apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx
index d1761b3f5a..f8ec1f9a36 100644
--- a/apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx
+++ b/apps/desktop/src/renderer/components/settings/ModelAdvancedDrawer.tsx
@@ -318,23 +318,29 @@ export function ModelAdvancedDrawer({
} catch { toast.error(t('settings.providers.custom.toast.saveFailed')); }
finally { setImageCapabilitySaving(false); }
};
- const setModelApi = async (agent: AgentKind, api: PiModelApi) => {
+ const setModelApi = async (agent: AgentKind, api: string) => {
if (protocolSaving || !canEditProtocol || !row?.byAgent[agent]) return;
const config = providerViewToCustomProviderConfig(provider);
const runtime = config.runtimes[agent];
const model = runtime?.models.find(m => m.id === row.byAgent[agent]!.id);
if (!runtime || !model) return;
- model.api = api;
- if (agent === 'pi') model.piApi = api;
- const wire = providerWireProtocolForApi(api);
- if (!wire) return;
- const existingRoute = { ...(model.route ?? {}) };
- delete existingRoute.requestPath;
- model.route = {
- ...existingRoute,
- baseUrl: providerBaseUrlForApi(model.route?.baseUrl ?? runtime.baseUrl, api),
- wireProtocol: wire,
- };
+ const choice = row.byAgent[agent]?.availableInterfaces?.find(item => item.profileId === api);
+ if (api === 'auto' || choice) {
+ model.interfaceId = api;
+ delete model.api;
+ delete model.piApi;
+ delete model.route;
+ } else {
+ delete model.interfaceId;
+ model.api = api as PiModelApi;
+ if (agent === 'pi') model.piApi = api as PiModelApi;
+ const wire = providerWireProtocolForApi(api);
+ if (!wire) return;
+ model.route = {
+ baseUrl: providerBaseUrlForApi(model.route?.baseUrl ?? runtime.baseUrl, api),
+ wireProtocol: wire,
+ };
+ }
setProtocolSaving(true);
try {
const result = await updateCustomProvider(config, {}, { source: 'manual-settings' });
@@ -610,7 +616,7 @@ export function ModelAdvancedDrawer({
id={protocolId}
className="mt-0.5 text-11 leading-4 text-[var(--text-tertiary)]"
>
- {canEditProtocol && !model?.catalogPresetId && supported ? (
+ {canEditProtocol && (!model?.catalogPresetId || !!model.availableInterfaces?.length) && supported ? (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button type="button" disabled={protocolSaving}
@@ -620,9 +626,12 @@ export function ModelAdvancedDrawer({
</button>
</DropdownMenuTrigger>
<DropdownMenuContent className="z-[10003]" align="start">
- <DropdownMenuRadioGroup value={protocol.outbound ?? ''}
- onValueChange={value => void setModelApi(agent, value as PiModelApi)}>
- {MODEL_PROTOCOL_OPTIONS.map(([api, label]) => <DropdownMenuRadioItem key={api} value={api}>{label}</DropdownMenuRadioItem>)}
+ <DropdownMenuRadioGroup value={model?.availableInterfaces?.length ? model.userModelConfig?.interfaceId ?? ((model.userModelConfig?.api || model.userModelConfig?.piApi || model.userModelConfig?.route) ? model.selectedInterface?.profileId : 'auto') : protocol.outbound ?? ''}
+ onValueChange={value => void setModelApi(agent, value)}>
+ {model?.availableInterfaces?.length ? <>
+ <DropdownMenuRadioItem value="auto">{t('settings.providers.models.advanced.protocol.automatic')}</DropdownMenuRadioItem>
+ {model.availableInterfaces.map(item => <DropdownMenuRadioItem key={item.profileId} value={item.profileId}>{protocolLabel(item.api)}</DropdownMenuRadioItem>)}
+ </> : MODEL_PROTOCOL_OPTIONS.map(([api, label]) => <DropdownMenuRadioItem key={api} value={api}>{label}</DropdownMenuRadioItem>)}
</DropdownMenuRadioGroup>
</DropdownMenuContent>
</DropdownMenu>
diff --git a/apps/desktop/src/renderer/components/settings/ProviderConnectionDialog.tsx b/apps/desktop/src/renderer/components/settings/ProviderConnectionDialog.tsx
index 859d98cd4a..54116a389a 100644
--- a/apps/desktop/src/renderer/components/settings/ProviderConnectionDialog.tsx
+++ b/apps/desktop/src/renderer/components/settings/ProviderConnectionDialog.tsx
@@ -861,6 +861,7 @@ export function ProviderConnectionDialog({
...(m.mode ? { mode: m.mode } : {}),
...(m.modalities ? { modalities: { input: [...m.modalities.input], output: [...m.modalities.output] } } : {}),
...(m.officialDocs ? { officialDocs: m.officialDocs } : {}),
+ ...(m.interfaceId ? { interfaceId: m.interfaceId } : {}),
...(m.api ? { api: m.api } : {}),
...(m.piApi ? { piApi: m.piApi } : {}),
...(m.route ? { route: m.route } : {}),
@@ -1397,7 +1398,8 @@ export function ProviderConnectionDialog({
discoveredMetadata: m.discoveredMetadata,
discoveredCost: m.discoveredCost,
nameExplicit: m.nameExplicit,
- ...(m.api ? { api: m.api } : {}),
+ ...(m.interfaceId ? { interfaceId: m.interfaceId } : {}),
+ ...(m.api ? { api: m.api } : {}),
...(agent === 'pi' && m.piApi ? { piApi: m.piApi } : {}),
...(m.route ? { route: { ...m.route } } : {}),
...(m.contextWindow !== undefined ? { contextWindow: m.contextWindow } : {}),
@@ -1440,6 +1442,7 @@ export function ProviderConnectionDialog({
modalities: cur?.modalities,
officialDocs: cur?.officialDocs,
nameExplicit: cur ? (cur.nameExplicit ?? !cur.discoveredMetadata) : undefined,
+ ...(cur?.interfaceId ? { interfaceId: cur.interfaceId } : {}),
...(cur?.api ? { api: cur.api } : {}),
...(agent === 'pi' && cur?.piApi ? { piApi: cur.piApi } : {}),
...(cur?.route ? { route: { ...cur.route } } : {}),
@@ -1515,6 +1518,7 @@ export function ProviderConnectionDialog({
const supportsImageInput = latest ? latest.supportsImageInput : m.supportsImageInput;
const reasoning = latest ? latest.reasoning : m.reasoning;
const reasoningEfforts = latest ? latest.reasoningEfforts : m.reasoningEfforts;
+ const interfaceId = latest ? latest.interfaceId : m.interfaceId;
const api = latest ? latest.api : m.api;
const piApi = latest ? latest.piApi : m.piApi;
const reasoningDefaultEffort = latest
@@ -1530,6 +1534,7 @@ export function ProviderConnectionDialog({
discoveredMetadata: m.discoveredMetadata ?? latest?.discoveredMetadata,
discoveredCost: m.discoveredCost ?? latest?.discoveredCost,
nameExplicit: latest?.nameExplicit ?? m.nameExplicit,
+ ...(interfaceId ? { interfaceId } : {}),
...(api ? { api } : {}),
...(picker.agent === 'pi' && piApi ? { piApi } : {}),
...((latest?.route ?? m.route) ? { route: { ...(latest?.route ?? m.route)! } } : {}),
@@ -1558,6 +1563,7 @@ export function ProviderConnectionDialog({
discoveredMetadata: m.discoveredMetadata,
discoveredCost: m.discoveredCost,
nameExplicit: m.nameExplicit,
+ ...(m.interfaceId ? { interfaceId: m.interfaceId } : {}),
...(m.api ? { api: m.api } : {}),
...(picker.agent === 'pi' && m.piApi ? { piApi: m.piApi } : {}),
...(m.route ? { route: { ...m.route } } : {}),
@@ -1660,6 +1666,7 @@ export function ProviderConnectionDialog({
discoveredMetadata: m.discoveredMetadata,
discoveredCost: m.discoveredCost,
nameExplicit: m.nameExplicit,
+ ...(m.interfaceId ? { interfaceId: m.interfaceId } : {}),
...(m.api ? { api: m.api } : {}),
...(a === 'pi' && m.piApi ? { piApi: m.piApi } : {}),
...(m.route ? { route: { ...m.route } } : {}),
diff --git a/apps/desktop/src/renderer/components/settings/__tests__/ModelAdvancedDrawer.test.tsx b/apps/desktop/src/renderer/components/settings/__tests__/ModelAdvancedDrawer.test.tsx
index a8a1aeaffe..9505c81ad2 100644
--- a/apps/desktop/src/renderer/components/settings/__tests__/ModelAdvancedDrawer.test.tsx
+++ b/apps/desktop/src/renderer/components/settings/__tests__/ModelAdvancedDrawer.test.tsx
@@ -289,6 +289,26 @@ describe('model advanced editor', () => {
} finally { Object.defineProperty(window, 'electronAPI', { configurable: true, value: previous }); }
});
+ // V6 selection is a user intent, not a copy of today's resolved route/limits.
+ it.each(['auto', 'moonshot-kimi-code-openai-responses'])('persists Kimi interface %s without locking catalog defaults', async (interfaceId) => {
+ const update = vi.fn(async (..._args: unknown[]) => ({ ok: true }));
+ const previous = window.electronAPI;
+ Object.defineProperty(window, 'electronAPI', { configurable: true, value: { maker: { updateCustomProvider: update } } });
+ const source = { ...buildUserProvider({ id: 'kimi-user', name: 'Kimi', runtimes: {
+ codex: { catalogPresetId: 'moonshot-kimi-code', baseUrl: 'https://api.kimi.com/coding/v1', wireProtocol: 'openai-chat',
+ models: [{ id: 'k3.1-pro', name: 'K3.1', interfaceId: 'moonshot-kimi-code-openai-completions' }] },
+ } }), connected: true } as ProviderView;
+ try {
+ render(drawer(source.models.codex![0], 'high', ['high'], source));
+ fireEvent.keyDown(screen.getByRole('button', { name: 'Codex · settings.providers.custom.fields.wireProtocol' }), { key: 'ArrowDown' });
+ fireEvent.click(await screen.findByRole('menuitemradio', { name: interfaceId === 'auto' ? 'settings.providers.models.advanced.protocol.automatic' : 'Responses' }));
+ await waitFor(() => expect(update).toHaveBeenCalledOnce());
+ const config = update.mock.calls[0]![0] as Parameters<typeof buildUserProvider>[0];
+ expect(config.runtimes.codex!.models).toEqual([{ id: 'k3.1-pro', name: 'K3.1', interfaceId }]);
+ expect(buildUserProvider(config).models.codex![0].selectedInterface?.api).toBe('openai-responses');
+ } finally { Object.defineProperty(window, 'electronAPI', { configurable: true, value: previous }); }
+ });
+
it('saves Google selection with its matching wire and official endpoint', async () => {
const update = vi.fn(async (..._args: unknown[]) => ({ ok: true }));
const previous = window.electronAPI;
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index ce30375330..b59f3d01b5 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -3517,6 +3517,7 @@
},
"effortMixed": "Effort differs by engine. A selection applies to engines that support that level.",
"protocol": {
+ "automatic": "Automatic",
"reference": "Native API",
"compatibility": "Compatibility mode",
"compatibilityHint": "Compatibility mode may be unstable or behave unexpectedly. Recommended for experienced users.",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index ed696a135b..673e71cf13 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -3487,6 +3487,7 @@
},
"effortMixed": "推論強度はエンジンごとに異なります。選択した強度に対応するエンジンに適用します。",
"protocol": {
+ "automatic": "自動選択",
"reference": "ネイティブAPI",
"compatibility": "互換モード",
"compatibilityHint": "互換モードでは動作が不安定になったり、一部の機能が正常に動作しない場合があります。経験のあるユーザー向けです。",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 888844108a..b16dc3334d 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -3487,6 +3487,7 @@
},
"effortMixed": "엔진마다 추론 강도가 다릅니다. 선택한 단계를 지원하는 엔진에 적용합니다.",
"protocol": {
+ "automatic": "자동 선택",
"reference": "기본 API",
"compatibility": "호환 모드",
"compatibilityHint": "호환 모드에서는 작동이 불안정하거나 일부 기능에 문제가 생길 수 있습니다. 숙련된 사용자에게 권장합니다.",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 19159ad529..53039b6ae9 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -3487,6 +3487,7 @@
},
"effortMixed": "各引擎的档位不同;选择后应用于支持该档位的引擎。",
"protocol": {
+ "automatic": "自动选择",
"reference": "原生协议",
"compatibility": "兼容模式",
"compatibilityHint": "兼容模式可能出现运行不稳定或功能异常,建议有经验的用户使用。",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
index de2da30c1d..b3008ee89c 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
@@ -3487,6 +3487,7 @@
},
"effortMixed": "各引擎的檔位不同;選擇後套用至支援該檔位的引擎。",
"protocol": {
+ "automatic": "自動選擇",
"reference": "原生協定",
"compatibility": "相容模式",
"compatibilityHint": "相容模式可能出現執行不穩定或功能異常,建議有經驗的使用者使用。",
diff --git a/apps/desktop/src/renderer/lib/customProviders.ts b/apps/desktop/src/renderer/lib/customProviders.ts
index 0eef65a63a..f43ae6d02a 100644
--- a/apps/desktop/src/renderer/lib/customProviders.ts
+++ b/apps/desktop/src/renderer/lib/customProviders.ts
@@ -88,6 +88,7 @@ export function customProviderModelConfigFromCatalogModel(
: [];
return {
...capabilities,
+ ...(model.selectedInterface ? { interfaceId: "auto" } : {}),
...(model.api ? { api: model.api } : {}),
id: model.id,
name: model.name,
diff --git a/docs/dev-rules/model-catalog-maintenance.md b/docs/dev-rules/model-catalog-maintenance.md
index 50c12951d0..5be27a191d 100644
--- a/docs/dev-rules/model-catalog-maintenance.md
+++ b/docs/dev-rules/model-catalog-maintenance.md
@@ -30,6 +30,7 @@ Catalog (version)
├─ providers[] 内置接入、授权、routing、各引擎 models
├─ presets[].runtimes 新建连接的地址、协议和默认资料
└─ modelRegistry (schemaVersion / updatedAt)
+ ├─ interfaceProfiles[] V6:产品作用域内的接口模板
├─ baseModels[] 公共型号
├─ models[] 接入条目:modelRef → baseModels;perAgent 与 routes 同级
├─ nativeApiRules[] 原生协议判定
@@ -57,6 +58,49 @@ Catalog (version)
Pi 走 `providers[].models.pi`(用户补丁 perAgent.pi 另属合法 schema)。媒体 route 使用 `agents: []`。
`contextWindowMax` 是客户端容量投影,不能填进 Registry;容量与工作预算见 [运行时细则](model-catalog-runtime.md)。
+### 多接口目录(Registry V6)
+
+一个模型的身份与其接口绑定分开维护。`interfaceProfiles` 正本位于 Server 的
+`source/registry/interface-profiles.json`:`id/providerId/api/baseUrl/inputBaseUrls` 声明接口与精确
+凭证作用域;`requestPath` 为可选相对路径;`defaults` 为通道能力;`compatibility/requires`
+只引用客户端已实现的具名能力。`inputBaseUrls` 必须与目标同源,不能借目录把密钥换域发送。
+`modelIds` 限制旧配置自动采用该模板的成员,显式 `routes[].interfaces` 为新模型绑定已有模板。
+
+`routes[].interfaces[]` 通过 `profileId` 绑定模板,可声明 `wireModelId/defaults/compatibility/requires/retired`;
+`preferredInterfaces` 按 Claude Code、Codex、Pi 分别列优先级。模板被撤回、绑定被撤回或必需能力未知时,
+该绑定不可执行;不能回填离线数据复活。`nativeApis` 是经核实的型号原生协议集合(`null` 明确未知),
+不从 Pi adapter 或代理协议反推。保留 `nativeApi` 作为旧客户端的稳定声明。
+
+三引擎共用 `availableModelInterfaces/providerInterfaceModelRoute`。能力覆盖依次为公共/产品默认、
+接口默认、引擎差异、实报、`forceOverrides`、用户覆盖;数组整体替换,`false/null/[]` 不丢失。
+界面展示当前接口的能力,输入不支持时不自动重放到另一协议。`interfaceId: "auto"` 跟随目录默认;
+显式 profile ID 固定用户选择。旧 `api/piApi/route/requestPath` 保留;仅已声明的旧导入修正规则
+通过 `legacyApis` 迁移。用户配置只保存原始选择,不保存解析后的 API、模板或完整快照。
+高级模型设置沿用既有入口显示自动与可用接口;手机/设备互联仍使用执行端投影,不在控制端重新选路。
+
+任务首次派发把非敏感接口、模型 ID 与能力快照存入 owner-scoped `model-interface-snapshots/`,
+同一任务/来源/引擎/型号在目录刷新与重启后保留接口。旧任务首次恢复按保存的 transport 迁移。
+鉴权、来源是否存在、暂停与撤回仍实时检查;快照不存 Key/headers。删除任务清理其快照;
+归档和关闭不清理。SSH 由执行宿主复用选路结果;新接口若不能由既有远端协议表达,沿用启动前明确报错。
+
+V6 请求使用 `registrySchemaVersion=6&registryMedia=1&registryLocalRuntimes=1`;旧服务端返回低版本时,
+在同一时间预算内重试一次 V5。缓存按实际 URL 变体隔离;同 revision 的 V5→V6 只有旧形状完全相等
+才视为升级,反向不覆盖 V6。服务端 V5/V4/冻结 legacy 投影不泄漏新字段或新默认接口。
+
+维护步骤:
+
+1. 在 Server 正本修改模型绑定/通道能力/优先级,增加 `updatedAt`,运行 `pnpm --filter model-access-server catalog:generate`。
+2. 更新离线副本时,在客户端运行 `node packages/model-providers/scripts/sync-registry.mjs <Server生成的providers.json>`;
+ 运行解析、目录一致性及受影响路由回归。旧 `provider-interface-models.json` 与客户端硬编码接口表已删除。
+3. 新型号绑定已有模板可以只发目录。新增/改变模板端点、鉴权边界或兼容行为走常规服务发布;
+ 新执行行为还必须发布客户端。发布门比较组装后的模板,不能通过换分片绕过。
+4. 回撤用新的完整 revision 和 `retired`,不回发旧日期快照。先部署可兼容投影的 Server,再发布客户端,
+ 最后调整目录默认;目录发布与真实上游推理验收分别记录。
+
+回归入口:`providerInterfaceRoutes`、`source-registry`、`modelAccessValidator`、Desktop `providerRoute`
+(真实 HTTP 目录→解析→三接口出站、快照冷恢复)、`codexProxyHost`、`piProviderTransport`。
+“客户端已实现”“服务已部署”“账号真实推理通过”是三个独立结论。
+
### Gateway 复杂价目展示
Model Access V5 通过 `X-Cindy-Model-Capabilities: display_pricing` 协商可选 `displayPricing`。
diff --git a/packages/anthropic-compat-proxy/src/server.test.ts b/packages/anthropic-compat-proxy/src/server.test.ts
index f42da19760..1ef24f55c4 100644
--- a/packages/anthropic-compat-proxy/src/server.test.ts
+++ b/packages/anthropic-compat-proxy/src/server.test.ts
@@ -4148,10 +4148,12 @@ describe('per-thread 已见 id 缓存(codex-connector P1:请求体缺席历史 i
// per-thread 缓存需要**同一 proxy 实例**跨请求累积(每个请求独立建 proxy 会丢缓存),
// 因此 postAs 复用同一个 upstream + proxy。
- async function setupSingleProxy(): Promise<void> {
+ async function setupSingleProxy(compatibilityProfiles?: string[]): Promise<void> {
const upstream = await mintingUpstream();
upstreamClose = upstream.close;
- proxy = await createAnthropicCompatProxy({ upstream: upstream.url, transformRequest: [] });
+ proxy = await createAnthropicCompatProxy({ upstream: upstream.url, transformRequest: [],
+ ...(compatibilityProfiles ? { routingTransform: () => ({ upstreamOverride: upstream.url, compatibilityProfiles }) } : {}),
+ });
}
async function postAs(sessionId: string, body: unknown): Promise<string> {
@@ -4184,8 +4186,8 @@ describe('per-thread 已见 id 缓存(codex-connector P1:请求体缺席历史 i
expect(r2).toMatch(/Bash_210_dup\d+/);
});
- it.each(['k3', 'k3-256k', 'k3.1-pro', 'k3.1-pro-highspeed'])('Kimi Code 的 %s 首次工具流在 rewind 后仍去重 (#7005)', async (model) => {
- await setupSingleProxy();
+ it.each(['k3', 'k3-256k', 'k3.1-pro', 'k3.1-pro-highspeed', 'future-catalog-model'])('Kimi Code 的 %s 首次工具流在 rewind 后仍去重 (#7005)', async (model) => {
+ await setupSingleProxy(model === 'future-catalog-model' ? ['kimi-tool-ids-v1'] : undefined);
// Coding ID 不带 kimi 前缀;小数版本也必须记录首个 streamed id。
const r1 = await postAs('sess-k3', {
model,
diff --git a/packages/anthropic-compat-proxy/src/server.ts b/packages/anthropic-compat-proxy/src/server.ts
index 2e9cf029bb..b9e30b7899 100644
--- a/packages/anthropic-compat-proxy/src/server.ts
+++ b/packages/anthropic-compat-proxy/src/server.ts
@@ -2676,7 +2676,9 @@ export async function createAnthropicCompatProxy(opts: ProxyOptions): Promise<Pr
// 被接管记录(codex-connector review: Cache first streamed Kimi tool IDs)。
// Coding Plan 的 k3 / k3.1-pro 等 ID 不带 kimi 前缀,小数版本也必须命中。
const isKimiRequest =
- isRecord(parsedForRewrite) && typeof parsedForRewrite.model === 'string'
+ decision?.compatibilityProfiles !== undefined
+ ? decision.compatibilityProfiles.includes('kimi-tool-ids-v1')
+ : isRecord(parsedForRewrite) && typeof parsedForRewrite.model === 'string'
? /(^|[/_-])(kimi|k3(?:\.\d+)?)([/_-]|$)/i.test(parsedForRewrite.model)
: false;
diff --git a/packages/anthropic-compat-proxy/src/types.ts b/packages/anthropic-compat-proxy/src/types.ts
index 66b2a489bf..014bfc0865 100644
--- a/packages/anthropic-compat-proxy/src/types.ts
+++ b/packages/anthropic-compat-proxy/src/types.ts
@@ -65,6 +65,8 @@ export type LocalRequestHandler = (args: {
* 与 RequestTransform 职责分离:RequestTransform 改 body,RoutingTransform 只读、决定路由。
*/
export interface RoutingDecision {
+ /** Trusted host-selected, versioned stream behavior (never a request header). */
+ compatibilityProfiles?: readonly string[];
/** 覆盖本次请求的上游 URL(完整 `http(s)://host[:port][/basePath]`);省略 = 用默认 `opts.upstream`。 */
upstreamOverride?: string;
/**
diff --git a/packages/maker-core/src/agents/base-agent.ts b/packages/maker-core/src/agents/base-agent.ts
index 74e83b45a8..28b0be7cbb 100644
--- a/packages/maker-core/src/agents/base-agent.ts
+++ b/packages/maker-core/src/agents/base-agent.ts
@@ -872,6 +872,7 @@ export interface AgentDeps {
resumeSessionId?: string;
/** Preview must not prepare global skills or start a local model service. */
purpose?: 'startup' | 'preview' | 'live-refresh';
+ sessionId?: string;
},
) => Promise<PiNativeProvidersResult | null>;
@@ -1569,6 +1570,7 @@ export interface AgentDeps {
* 「远端恒用网关」行为。
*/
resolveRemoteClaudeRoute?: (opts: {
+ sessionId?: string;
providerId?: string | null;
model: string;
}) => Promise<RemoteClaudeRoute | null>;
diff --git a/packages/maker-core/src/agents/claude-code/index.ts b/packages/maker-core/src/agents/claude-code/index.ts
index 63496f2e72..6a8304548e 100644
--- a/packages/maker-core/src/agents/claude-code/index.ts
+++ b/packages/maker-core/src/agents/claude-code/index.ts
@@ -1436,6 +1436,7 @@ export class ClaudeCodeAgent extends BaseAgent {
const remoteRoute =
opts.remoteHostId && this.deps.resolveRemoteClaudeRoute
? await this.deps.resolveRemoteClaudeRoute({
+ sessionId: opts.sessionId,
providerId: opts.providerId,
model: opts.model,
})
@@ -7357,6 +7358,7 @@ export class ClaudeCodeAgent extends BaseAgent {
// providerId 用调用方给的目标来源(可能正在切 provider),缺省回落会话启动值。
if (opts.remoteHostId && resolveRemoteClaudeRoute) {
const nextRoute = await resolveRemoteClaudeRoute({
+ sessionId: opts.sessionId,
providerId: targetProviderId,
model: newModel,
});
diff --git a/packages/maker-core/src/agents/pi/index.ts b/packages/maker-core/src/agents/pi/index.ts
index 563baa47a8..4021ffee9d 100644
--- a/packages/maker-core/src/agents/pi/index.ts
+++ b/packages/maker-core/src/agents/pi/index.ts
@@ -2702,8 +2702,11 @@ export class PiAgent extends BaseAgent {
const guestOmitsGateway = guestProviderId !== undefined && !piGuestUsesGateway(guestProviderId);
const sessionNativeProviderResolver = (): AgentDeps['resolvePiNativeProviders'] => {
const resolve = this.deps.resolvePiNativeProviders;
- if (!resolve || !guestProviderId) return resolve?.bind(this.deps);
- return async (input) => restrictPiGuestNativeProviders(await resolve.call(this.deps, input), guestProviderId, hosted?.guestProvider?.modelIds);
+ if (!resolve) return undefined;
+ return async (input) => {
+ const result = await resolve.call(this.deps, { ...input, sessionId: opts.sessionId });
+ return guestProviderId ? restrictPiGuestNativeProviders(result, guestProviderId, hosted?.guestProvider?.modelIds) : result;
+ };
};
const resolvePiNativeProviders = sessionNativeProviderResolver();
const sessionPiAutoCompactPct = this.deps.runtimeConfig.piAutoCompactThresholdPct;
diff --git a/packages/model-providers/catalog/model-registry.json b/packages/model-providers/catalog/model-registry.json
index 6ee2caee7f..ae17bd4d9c 100644
--- a/packages/model-providers/catalog/model-registry.json
+++ b/packages/model-providers/catalog/model-registry.json
@@ -1,6 +1,6 @@
{
- "schemaVersion": 5,
- "updatedAt": "2026-10-23T18:29:15.626Z",
+ "schemaVersion": 6,
+ "updatedAt": "2026-10-23T18:56:11.521Z",
"models": [
{
"id": "openai/gpt-6.1-sol",
@@ -57,7 +57,10 @@
{
"providerId": "openai",
"modelId": "gpt-6-sol",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global",
"defaults": {
"supportsFastMode": true
@@ -69,7 +72,14 @@
"perAgent": {
"codex": {
"contextWindow": 272000,
- "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"]
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultra"
+ ]
},
"claude-code": {
"contextWindow": 272000
@@ -85,7 +95,10 @@
{
"providerId": "openai",
"modelId": "gpt-6-luna",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global",
"defaults": {
"supportsFastMode": true
@@ -112,7 +125,10 @@
{
"providerId": "anthropic",
"modelId": "claude-opus-5-5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -128,7 +144,10 @@
{
"providerId": "anthropic",
"modelId": "claude-sonnet-5-5",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "anthropic-messages",
@@ -143,7 +162,10 @@
{
"providerId": "anthropic",
"modelId": "claude-haiku-5-5",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "anthropic-messages",
@@ -156,7 +178,14 @@
"sortOrder": 18,
"perAgent": {
"codex": {
- "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultra"
+ ],
"contextWindow": 272000
},
"claude-code": {
@@ -167,12 +196,21 @@
{
"providerId": "openai",
"modelId": "gpt-5.6-sol",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "GPT-5.6-Sol for coding tasks",
"group": "gpt",
"contextWindow": 1050000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"supportsFastMode": true
},
"referencePriceGroup": "global"
@@ -191,13 +229,20 @@
{
"providerId": "openai",
"modelId": "gpt-5.6-sol",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"name": "GPT-5.6-Sol (1M · Higher usage)",
"description": "Explicit 1M context opt-in; inputs above 272K use higher long-context rates for the entire request",
"group": "gpt",
"contextWindow": 1000000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"supportsFastMode": true
},
"referencePriceGroup": "global"
@@ -218,19 +263,35 @@
},
"codex": {
"contextWindow": 272000,
- "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"]
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultra"
+ ]
}
},
"routes": [
{
"providerId": "xd",
"modelId": "gpt-5.6-sol",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "GPT-5.6-Sol for coding tasks",
"group": "gpt",
"contextWindow": 1050000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"supportsFastMode": true
}
}
@@ -245,7 +306,14 @@
"sortOrder": 19,
"perAgent": {
"codex": {
- "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultra"
+ ],
"contextWindow": 272000
},
"claude-code": {
@@ -256,7 +324,10 @@
{
"providerId": "openai",
"modelId": "gpt-5.6-terra",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"group": "gpt",
"contextWindow": 1050000,
@@ -280,14 +351,24 @@
},
"codex": {
"contextWindow": 272000,
- "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"]
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultra"
+ ]
}
},
"routes": [
{
"providerId": "xd",
"modelId": "gpt-5.6-terra",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"group": "gpt",
"contextWindow": 1050000,
@@ -307,12 +388,21 @@
{
"providerId": "openai",
"modelId": "gpt-5.6-luna",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"group": "gpt",
"contextWindow": 1050000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroup": "global"
@@ -344,12 +434,21 @@
{
"providerId": "xd",
"modelId": "gpt-5.6-luna",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"group": "gpt",
"contextWindow": 1050000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
}
}
@@ -372,7 +471,10 @@
{
"providerId": "openai",
"modelId": "gpt-5.5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "OpenAI Codex (GPT-5.5) for coding tasks",
"group": "gpt",
@@ -403,7 +505,10 @@
{
"providerId": "xd",
"modelId": "gpt-5.5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "GPT-5.5 for coding tasks",
"group": "gpt",
@@ -430,7 +535,10 @@
{
"providerId": "openai",
"modelId": "gpt-5.4",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "OpenAI Codex (GPT-5.4) for coding tasks",
"group": "gpt",
@@ -461,7 +569,10 @@
{
"providerId": "xd",
"modelId": "gpt-5.4",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "GPT-5.4 for coding tasks",
"group": "gpt",
@@ -491,7 +602,10 @@
{
"providerId": "openai",
"modelId": "gpt-5.4-mini",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "Faster, lighter Codex variant — speed-optimized for quick edits",
"group": "gpt",
@@ -522,7 +636,10 @@
{
"providerId": "xd",
"modelId": "gpt-5.4-mini",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "GPT-5.4-Mini for coding tasks",
"group": "gpt",
@@ -544,7 +661,10 @@
{
"providerId": "openai",
"modelId": "gpt-5.4-pro",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -561,7 +681,10 @@
{
"providerId": "openai",
"modelId": "gpt-5.5-pro",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -578,7 +701,10 @@
{
"providerId": "openai",
"modelId": "gpt-5.6-cyber",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -591,7 +717,14 @@
"status": "active",
"perAgent": {
"codex": {
- "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultra"
+ ],
"contextWindow": 272000
},
"claude-code": {
@@ -602,7 +735,10 @@
{
"providerId": "openai",
"modelId": "gpt-6-astra",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": true
},
@@ -620,7 +756,10 @@
{
"providerId": "anthropic",
"modelId": "claude-fable-5-1",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -636,7 +775,10 @@
{
"providerId": "anthropic",
"modelId": "claude-fable-5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -656,7 +798,9 @@
{
"providerId": "xd",
"modelId": "claude-fable-5",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -673,7 +817,10 @@
{
"providerId": "anthropic",
"modelId": "claude-mythos-5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -689,7 +836,10 @@
{
"providerId": "anthropic",
"modelId": "claude-opus-5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -709,7 +859,9 @@
{
"providerId": "xd",
"modelId": "claude-opus-5",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -727,7 +879,10 @@
{
"providerId": "anthropic",
"modelId": "claude-opus-4-8",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -747,7 +902,9 @@
{
"providerId": "xd",
"modelId": "claude-opus-4-8",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -766,7 +923,10 @@
{
"providerId": "anthropic",
"modelId": "claude-opus-4-7",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -785,7 +945,9 @@
{
"providerId": "xd",
"modelId": "claude-opus-4-7",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -805,7 +967,10 @@
{
"providerId": "anthropic",
"modelId": "claude-opus-4-6",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -824,7 +989,9 @@
{
"providerId": "xd",
"modelId": "claude-opus-4-6",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -844,7 +1011,10 @@
{
"providerId": "anthropic",
"modelId": "claude-opus-4-5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -863,7 +1033,9 @@
{
"providerId": "xd",
"modelId": "claude-opus-4-5",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -882,7 +1054,10 @@
{
"providerId": "anthropic",
"modelId": "claude-sonnet-5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -901,7 +1076,9 @@
{
"providerId": "xd",
"modelId": "claude-sonnet-5",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -920,7 +1097,10 @@
{
"providerId": "anthropic",
"modelId": "claude-sonnet-4-6",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -939,7 +1119,9 @@
{
"providerId": "xd",
"modelId": "claude-sonnet-4-6",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -959,7 +1141,10 @@
{
"providerId": "anthropic",
"modelId": "claude-sonnet-4-5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -978,7 +1163,9 @@
{
"providerId": "xd",
"modelId": "claude-sonnet-4-5",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -998,7 +1185,10 @@
{
"providerId": "anthropic",
"modelId": "claude-haiku-4-5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1017,7 +1207,9 @@
{
"providerId": "xd",
"modelId": "claude-haiku-4-5",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -1036,7 +1228,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-4.7",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global",
"forceOverrides": {
"contextWindow": 500000
@@ -1062,7 +1257,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-4.7-build-fast",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global",
"forceOverrides": {
"contextWindow": 500000
@@ -1083,7 +1281,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-4.6",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global",
"forceOverrides": {
"contextWindow": 500000
@@ -1104,7 +1305,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-4.5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global",
"forceOverrides": {
"contextWindow": 500000
@@ -1123,14 +1327,21 @@
"sortOrder": 51,
"perAgent": {
"codex": {
- "efforts": ["low", "medium", "high"]
+ "efforts": [
+ "low",
+ "medium",
+ "high"
+ ]
}
},
"routes": [
{
"providerId": "xai",
"modelId": "xai/grok-4.3",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1147,7 +1358,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-build-0.1",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1164,7 +1378,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-4.20-multi-agent-0309",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1181,7 +1398,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-4.20-0309-reasoning",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1198,7 +1418,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-4.20-0309-non-reasoning",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1215,7 +1438,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-4.20",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1232,7 +1458,10 @@
{
"providerId": "xai",
"modelId": "xai/grok-code-fast",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1247,7 +1476,10 @@
{
"providerId": "xd",
"modelId": "codex/gpt-5.6-luna",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"group": "gpt-budget"
}
@@ -1266,19 +1498,35 @@
},
"codex": {
"contextWindow": 272000,
- "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"]
- }
- },
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultra"
+ ]
+ }
+ },
"routes": [
{
"providerId": "xd",
"modelId": "codex/gpt-5.6-sol",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "GPT-5.6-Sol for coding tasks",
"group": "gpt-budget",
"contextWindow": 372000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"supportsFastMode": true
}
}
@@ -1296,14 +1544,24 @@
},
"codex": {
"contextWindow": 272000,
- "efforts": ["low", "medium", "high", "xhigh", "max", "ultra"]
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultra"
+ ]
}
},
"routes": [
{
"providerId": "xd",
"modelId": "codex/gpt-5.6-terra",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"group": "gpt-budget",
"contextWindow": 372000,
@@ -1328,7 +1586,10 @@
{
"providerId": "xd",
"modelId": "codex/gpt-5.5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "GPT-5.5 for coding tasks",
"group": "gpt-budget",
@@ -1354,7 +1615,10 @@
{
"providerId": "xd",
"modelId": "codex/gpt-5.4",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"description": "GPT-5.4 for coding tasks",
"group": "gpt-budget",
@@ -1375,7 +1639,9 @@
{
"providerId": "xd",
"modelId": "gemini-3.7-flash",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1394,7 +1660,9 @@
{
"providerId": "xd",
"modelId": "gemini-3.6-flash",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1412,7 +1680,9 @@
{
"providerId": "xd",
"modelId": "gemini-3.5-flash",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1431,7 +1701,9 @@
{
"providerId": "xd",
"modelId": "gemini-3.1-pro-preview",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -1449,7 +1721,9 @@
{
"providerId": "xd",
"modelId": "gemini-3-flash-preview",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -1467,7 +1741,9 @@
{
"providerId": "xd",
"modelId": "gemini-3.5-flash-lite",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1486,7 +1762,9 @@
{
"providerId": "xd",
"modelId": "gemini-3.1-flash-lite",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1501,14 +1779,21 @@
"name": "Seed 2.1 Pro",
"perAgent": {
"claude-code": {
- "efforts": ["low", "medium", "high"]
+ "efforts": [
+ "low",
+ "medium",
+ "high"
+ ]
}
},
"routes": [
{
"providerId": "xd",
"modelId": "bytedance-seed/seed-2.1-pro",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -1524,7 +1809,10 @@
{
"providerId": "xd",
"modelId": "qwen/qwen3.8-max",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -1541,7 +1829,10 @@
{
"providerId": "xd",
"modelId": "qwen/qwen3.8-max-preview",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -1558,7 +1849,10 @@
{
"providerId": "xd",
"modelId": "qwen/qwen3.7-max",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
}
@@ -1577,13 +1871,19 @@
{
"providerId": "moonshot-kimi-cn",
"modelId": "kimi-k2.7-code",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "moonshot-kimi-global",
"modelId": "kimi-k2.7-code",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1600,13 +1900,19 @@
{
"providerId": "moonshot-kimi-cn",
"modelId": "kimi-k2.7-code-highspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "moonshot-kimi-global",
"modelId": "kimi-k2.7-code-highspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1622,7 +1928,9 @@
{
"providerId": "xd",
"modelId": "moonshotai/kimi-k2.6",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1641,7 +1949,9 @@
{
"providerId": "xd",
"modelId": "z-ai/glm-5.1",
- "agents": ["claude-code"],
+ "agents": [
+ "claude-code"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1657,14 +1967,20 @@
"sortOrder": 43,
"perAgent": {
"claude-code": {
- "efforts": ["high", "max"]
+ "efforts": [
+ "high",
+ "max"
+ ]
}
},
"routes": [
{
"providerId": "xd",
"modelId": "z-ai/glm-5.2",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1683,7 +1999,10 @@
{
"providerId": "xd",
"modelId": "z-ai/glm-5.3",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1701,12 +2020,18 @@
{
"providerId": "zhipu-glm-cn",
"modelId": "glm-5.3-flash",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "zhipu-glm-global",
"modelId": "glm-5.3-flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1721,9 +2046,17 @@
{
"providerId": "xd",
"modelId": "z-ai/glm-5.3-flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
- "efforts": ["low", "medium", "high", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroup": "global"
@@ -1740,7 +2073,10 @@
{
"providerId": "deepseek",
"modelId": "deepseek-v4-pro",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1758,7 +2094,10 @@
{
"providerId": "xd",
"modelId": "deepseek/deepseek-v4-pro",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1776,7 +2115,10 @@
{
"providerId": "deepseek",
"modelId": "deepseek-v4-flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1794,7 +2136,10 @@
{
"providerId": "xd",
"modelId": "deepseek/deepseek-v4-flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -1814,7 +2159,10 @@
{
"providerId": "openai",
"modelId": "gpt-5.4-nano",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1830,7 +2178,10 @@
{
"providerId": "xd",
"modelId": "gpt-5.4-nano",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-responses",
@@ -1846,7 +2197,10 @@
{
"providerId": "xd",
"modelId": "codex/gpt-5.4-mini",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"group": "gpt-budget",
"contextWindow": 272000
@@ -1866,12 +2220,18 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M3",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M3",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "anthropic-messages",
@@ -1887,13 +2247,19 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M2.7",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M2.7",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1910,13 +2276,19 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M2.7-highspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M2.7-highspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1933,13 +2305,19 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M2.5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M2.5",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1956,13 +2334,19 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M2.5-highspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M2.5-highspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -1979,13 +2363,19 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M2.1",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M2.1",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -2002,13 +2392,19 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M2.1-highspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M2.1-highspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -2025,13 +2421,19 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M2",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M2",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -2046,11 +2448,42 @@
{
"providerId": "moonshot-kimi-code",
"modelId": "kimi-for-coding",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
+ "interfaces": [
+ {
+ "profileId": "moonshot-kimi-code-anthropic-messages"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-completions"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-responses"
+ }
+ ],
+ "preferredInterfaces": {
+ "claude-code": [
+ "moonshot-kimi-code-anthropic-messages"
+ ],
+ "codex": [
+ "moonshot-kimi-code-openai-responses",
+ "moonshot-kimi-code-openai-completions"
+ ],
+ "pi": [
+ "moonshot-kimi-code-anthropic-messages"
+ ]
+ }
}
],
"nativeApi": "anthropic-messages",
- "modelRef": "moonshotai/kimi-k2.8-preview"
+ "modelRef": "moonshotai/kimi-k2.8-preview",
+ "nativeApis": [
+ "anthropic-messages",
+ "openai-responses",
+ "openai-completions"
+ ]
},
{
"id": "moonshotai/kimi-k3",
@@ -2060,7 +2493,10 @@
{
"providerId": "moonshot-kimi-cn",
"modelId": "kimi-k3",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -2069,7 +2505,10 @@
{
"providerId": "moonshot-kimi-global",
"modelId": "kimi-k3",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -2087,12 +2526,18 @@
{
"providerId": "moonshot-kimi-cn",
"modelId": "kimi-k3.1-pro",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "moonshot-kimi-global",
"modelId": "kimi-k3.1-pro",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2106,15 +2551,46 @@
{
"providerId": "moonshot-kimi-code",
"modelId": "k3.1-pro",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"contextWindow": 262144,
"maxOutputTokens": 262144
+ },
+ "interfaces": [
+ {
+ "profileId": "moonshot-kimi-code-anthropic-messages"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-completions"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-responses"
+ }
+ ],
+ "preferredInterfaces": {
+ "claude-code": [
+ "moonshot-kimi-code-anthropic-messages"
+ ],
+ "codex": [
+ "moonshot-kimi-code-openai-responses",
+ "moonshot-kimi-code-openai-completions"
+ ],
+ "pi": [
+ "moonshot-kimi-code-anthropic-messages"
+ ]
}
}
],
"nativeApi": "anthropic-messages",
- "modelRef": "moonshotai/kimi-k3.1-pro"
+ "modelRef": "moonshotai/kimi-k3.1-pro",
+ "nativeApis": [
+ "anthropic-messages",
+ "openai-responses",
+ "openai-completions"
+ ]
},
{
"id": "moonshotai/kimi-k3.1-pro-highspeed",
@@ -2124,12 +2600,18 @@
{
"providerId": "moonshot-kimi-cn",
"modelId": "kimi-k3.1-pro-highspeed",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "moonshot-kimi-global",
"modelId": "kimi-k3.1-pro-highspeed",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2143,14 +2625,45 @@
{
"providerId": "moonshot-kimi-code",
"modelId": "k3.1-pro-highspeed",
- "agents": ["claude-code", "codex"],
- "defaults": {
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
+ "defaults": {
"contextWindow": 1048576
+ },
+ "interfaces": [
+ {
+ "profileId": "moonshot-kimi-code-anthropic-messages"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-completions"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-responses"
+ }
+ ],
+ "preferredInterfaces": {
+ "claude-code": [
+ "moonshot-kimi-code-anthropic-messages"
+ ],
+ "codex": [
+ "moonshot-kimi-code-openai-responses",
+ "moonshot-kimi-code-openai-completions"
+ ],
+ "pi": [
+ "moonshot-kimi-code-anthropic-messages"
+ ]
}
}
],
"nativeApi": "anthropic-messages",
- "modelRef": "moonshotai/kimi-k3.1-pro-highspeed"
+ "modelRef": "moonshotai/kimi-k3.1-pro-highspeed",
+ "nativeApis": [
+ "anthropic-messages",
+ "openai-responses",
+ "openai-completions"
+ ]
},
{
"id": "minimax/minimax-m3.1-flash",
@@ -2160,12 +2673,18 @@
{
"providerId": "minimax-cn",
"modelId": "MiniMax-M3.1-Flash",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "minimax-global",
"modelId": "MiniMax-M3.1-Flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -2180,7 +2699,10 @@
{
"providerId": "deepseek",
"modelId": "deepseek-flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -2198,24 +2720,81 @@
{
"providerId": "moonshot-kimi-code",
"modelId": "k3",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"contextWindow": 262144,
"maxOutputTokens": 262144
+ },
+ "interfaces": [
+ {
+ "profileId": "moonshot-kimi-code-anthropic-messages"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-completions"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-responses"
+ }
+ ],
+ "preferredInterfaces": {
+ "claude-code": [
+ "moonshot-kimi-code-anthropic-messages"
+ ],
+ "codex": [
+ "moonshot-kimi-code-openai-responses",
+ "moonshot-kimi-code-openai-completions"
+ ],
+ "pi": [
+ "moonshot-kimi-code-anthropic-messages"
+ ]
}
},
{
"providerId": "moonshot-kimi-code",
"modelId": "k3-256k",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"contextWindow": 262144,
"maxOutputTokens": 262144
+ },
+ "interfaces": [
+ {
+ "profileId": "moonshot-kimi-code-anthropic-messages"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-completions"
+ },
+ {
+ "profileId": "moonshot-kimi-code-openai-responses"
+ }
+ ],
+ "preferredInterfaces": {
+ "claude-code": [
+ "moonshot-kimi-code-anthropic-messages"
+ ],
+ "codex": [
+ "moonshot-kimi-code-openai-responses",
+ "moonshot-kimi-code-openai-completions"
+ ],
+ "pi": [
+ "moonshot-kimi-code-anthropic-messages"
+ ]
}
}
],
"nativeApi": "anthropic-messages",
- "modelRef": "moonshotai/kimi-k3"
+ "modelRef": "moonshotai/kimi-k3",
+ "nativeApis": [
+ "anthropic-messages",
+ "openai-responses",
+ "openai-completions"
+ ]
},
{
"id": "qwen/qwen3.6-plus",
@@ -2226,7 +2805,9 @@
{
"providerId": "xd",
"modelId": "qwen/qwen3.6-plus",
- "agents": ["claude-code"]
+ "agents": [
+ "claude-code"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2242,12 +2823,18 @@
{
"providerId": "aliyun-model-studio-cn",
"modelId": "qwen3.6-plus",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "aliyun-model-studio-global",
"modelId": "qwen3.6-plus",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2263,12 +2850,18 @@
{
"providerId": "aliyun-model-studio-cn",
"modelId": "qwen3.7-flash",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "aliyun-model-studio-global",
"modelId": "qwen3.7-flash",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2284,13 +2877,19 @@
{
"providerId": "aliyun-model-studio-cn",
"modelId": "qwen3.8-flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "aliyun-model-studio-global",
"modelId": "qwen3.8-flash",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2306,12 +2905,18 @@
{
"providerId": "aliyun-model-studio-cn",
"modelId": "qwen3.7-plus",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "aliyun-model-studio-global",
"modelId": "qwen3.7-plus",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2327,12 +2932,18 @@
{
"providerId": "aliyun-model-studio-cn",
"modelId": "qwen3.6-flash",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
},
{
"providerId": "aliyun-model-studio-global",
"modelId": "qwen3.6-flash",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2347,7 +2958,10 @@
{
"providerId": "xd",
"modelId": "codex/gpt-5.5:auto",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-responses",
@@ -2360,7 +2974,10 @@
{
"providerId": "xd",
"modelId": "qwen/qwen3.8-27b",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2373,7 +2990,10 @@
{
"providerId": "xd",
"modelId": "tencent/hy3",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2387,7 +3007,10 @@
{
"providerId": "xd",
"modelId": "meta/muse-spark-1.2",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -2401,7 +3024,10 @@
{
"providerId": "xd",
"modelId": "meta/muse-wonder-1.0",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "global"
}
],
@@ -2414,7 +3040,10 @@
{
"providerId": "xd",
"modelId": "moonshot/kimi-k3",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -2423,7 +3052,10 @@
{
"providerId": "xd",
"modelId": "moonshotai/kimi-k3",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"defaults": {
"supportsFastMode": false
},
@@ -2441,7 +3073,10 @@
{
"providerId": "xd",
"modelId": "deepseek/deepseek-v4-flash-vision-exp",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-completions",
@@ -2454,7 +3089,10 @@
{
"providerId": "xd",
"modelId": "tencent/hy4-preview",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
}
],
@@ -2590,13 +3228,19 @@
{
"providerId": "xiaomi-mimo-api-cn",
"modelId": "mimo-v2.6-pro",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "xiaomi-mimo-token-plan-cn",
"modelId": "mimo-v2.6-pro",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
}
],
@@ -2612,13 +3256,19 @@
{
"providerId": "xiaomi-mimo-api-cn",
"modelId": "mimo-v2.6-flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
},
{
"providerId": "xiaomi-mimo-token-plan-cn",
"modelId": "mimo-v2.6-flash",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
}
],
@@ -2634,7 +3284,10 @@
{
"providerId": "xiaomi-mimo-api-cn",
"modelId": "mimo-v2.6-pro-ultraspeed",
- "agents": ["claude-code", "codex"],
+ "agents": [
+ "claude-code",
+ "codex"
+ ],
"referencePriceGroup": "cn"
}
],
@@ -2650,7 +3303,10 @@
{
"providerId": "xd",
"modelId": "auto",
- "agents": ["claude-code", "codex"]
+ "agents": [
+ "claude-code",
+ "codex"
+ ]
}
],
"nativeApi": "openai-responses",
@@ -2801,7 +3457,10 @@
],
"localModels": {
"version": 1,
- "featuredIds": ["qwen38-flash-next", "qwen38-27b"],
+ "featuredIds": [
+ "qwen38-flash-next",
+ "qwen38-27b"
+ ],
"models": [
{
"id": "qwen38-27b",
@@ -2871,7 +3530,14 @@
{
"id": "qwen35-4b",
"name": "Qwen3.5 4B",
- "aliases": ["qwen", "qwen3.5", "通义", "通義", "千问", "千問"],
+ "aliases": [
+ "qwen",
+ "qwen3.5",
+ "通义",
+ "通義",
+ "千问",
+ "千問"
+ ],
"variants": [
{
"libraryName": "qwen3.5:4b-mlx",
@@ -2918,7 +3584,14 @@
{
"id": "qwen35-9b",
"name": "Qwen3.5 9B",
- "aliases": ["qwen", "qwen3.5", "通义", "通義", "千问", "千問"],
+ "aliases": [
+ "qwen",
+ "qwen3.5",
+ "通义",
+ "通義",
+ "千问",
+ "千問"
+ ],
"variants": [
{
"libraryName": "qwen3.5:9b-mlx",
@@ -2965,7 +3638,13 @@
{
"id": "gemma4-12b",
"name": "Gemma 4 12B",
- "aliases": ["gemma", "gemma4", "google", "宝石", "寶石"],
+ "aliases": [
+ "gemma",
+ "gemma4",
+ "google",
+ "宝石",
+ "寶石"
+ ],
"variants": [
{
"libraryName": "gemma4:12b-mlx",
@@ -3012,7 +3691,13 @@
{
"id": "qwen36-35b",
"name": "Qwen3.6 35B A3B",
- "aliases": ["qwen", "qwen3.6", "通义", "通義", "moe"],
+ "aliases": [
+ "qwen",
+ "qwen3.6",
+ "通义",
+ "通義",
+ "moe"
+ ],
"variants": [
{
"libraryName": "qwen3.6:35b-mlx",
@@ -3059,7 +3744,12 @@
{
"id": "nemotron35-30b",
"name": "Nemotron 3.5 Lightning 30B",
- "aliases": ["nemotron", "nvidia", "lightning", "moe"],
+ "aliases": [
+ "nemotron",
+ "nvidia",
+ "lightning",
+ "moe"
+ ],
"variants": [
{
"libraryName": "nemotron-3.5-lightning:30b-mlx",
@@ -3106,7 +3796,13 @@
{
"id": "qwen38-flash-next",
"name": "Qwen3.8 Flash-Next",
- "aliases": ["qwen", "flash-next", "通义", "通義", "moe"],
+ "aliases": [
+ "qwen",
+ "flash-next",
+ "通义",
+ "通義",
+ "moe"
+ ],
"variants": [
{
"libraryName": "qwen3.8-flash-next:125b-mlx",
@@ -3159,7 +3855,13 @@
"id": "laguna-s21-118b",
"modelRef": "poolside/laguna-s-2.1",
"name": "Laguna S 2.1 118B A8B",
- "aliases": ["laguna", "poolside", "laguna-s-2.1", "118b", "moe"],
+ "aliases": [
+ "laguna",
+ "poolside",
+ "laguna-s-2.1",
+ "118b",
+ "moe"
+ ],
"variants": [
{
"libraryName": "laguna-s-2.1:nvfp4",
@@ -3212,7 +3914,9 @@
"baseModels": [
{
"id": "openai/gpt-6.1-sol",
- "aliases": ["gpt-6.1-sol"],
+ "aliases": [
+ "gpt-6.1-sol"
+ ],
"defaults": {
"name": "GPT-6.1 Sol",
"group": "gpt",
@@ -3339,13 +4043,21 @@
},
{
"id": "openai/gpt-6-sol",
- "aliases": ["gpt-6-sol"],
+ "aliases": [
+ "gpt-6-sol"
+ ],
"defaults": {
"name": "GPT-6 Sol",
"group": "gpt",
"contextWindow": 1050000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium",
"supportsImageInput": true
},
@@ -3419,13 +4131,21 @@
},
{
"id": "openai/gpt-6-luna",
- "aliases": ["gpt-6-luna"],
+ "aliases": [
+ "gpt-6-luna"
+ ],
"defaults": {
"name": "GPT-6 Luna",
"group": "gpt",
"contextWindow": 1050000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium",
"supportsImageInput": true
},
@@ -3499,13 +4219,21 @@
},
{
"id": "anthropic/claude-opus-5-5",
- "aliases": ["claude-opus-5-5"],
+ "aliases": [
+ "claude-opus-5-5"
+ ],
"defaults": {
"name": "Opus 5.5",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium",
"supportsImageInput": true
},
@@ -3549,27 +4277,43 @@
},
{
"id": "anthropic/claude-sonnet-5-5",
- "aliases": ["claude-sonnet-5-5"],
+ "aliases": [
+ "claude-sonnet-5-5"
+ ],
"defaults": {
"name": "Sonnet 5.5",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium",
"supportsImageInput": true
}
},
{
"id": "anthropic/claude-haiku-5-5",
- "aliases": ["claude-haiku-5-5"],
+ "aliases": [
+ "claude-haiku-5-5"
+ ],
"defaults": {
"name": "Haiku 5.5",
"description": "Fastest for quick answers",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium",
"supportsImageInput": true
}
@@ -3587,7 +4331,13 @@
"maxOutputTokens": 128000,
"defaultEffort": "medium",
"name": "GPT-5.6-Sol",
- "efforts": ["low", "medium", "high", "xhigh", "max"]
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ]
},
"referencePriceGroups": [
{
@@ -3701,7 +4451,13 @@
"name": "GPT-5.6-Terra",
"description": "GPT-5.6-Terra for coding tasks",
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -3814,7 +4570,13 @@
],
"defaults": {
"name": "GPT-5.6-Luna",
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -3919,12 +4681,22 @@
},
{
"id": "openai/gpt-5.5",
- "aliases": ["gpt-5.5", "xd/gpt-5.5", "xd/codex-gpt-5.5", "codex/gpt-5.5"],
+ "aliases": [
+ "gpt-5.5",
+ "xd/gpt-5.5",
+ "xd/codex-gpt-5.5",
+ "codex/gpt-5.5"
+ ],
"defaults": {
"name": "GPT-5.5",
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh"],
- "defaultEffort": "medium"
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
+ "defaultEffort": "medium"
},
"referencePriceGroups": [
{
@@ -3964,11 +4736,21 @@
},
{
"id": "openai/gpt-5.4",
- "aliases": ["gpt-5.4", "xd/gpt-5.4", "xd/codex-gpt-5.4", "codex/gpt-5.4"],
+ "aliases": [
+ "gpt-5.4",
+ "xd/gpt-5.4",
+ "xd/codex-gpt-5.4",
+ "codex/gpt-5.4"
+ ],
"defaults": {
"name": "GPT-5.4",
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4018,7 +4800,12 @@
"defaults": {
"name": "GPT-5.4-Mini",
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4044,14 +4831,20 @@
},
{
"id": "openai/gpt-5.4-pro",
- "aliases": ["gpt-5.4-pro"],
+ "aliases": [
+ "gpt-5.4-pro"
+ ],
"defaults": {
"name": "GPT-5.4 Pro",
"description": "OpenAI GPT-5.4 Pro for demanding reasoning tasks",
"group": "gpt",
"contextWindow": 1050000,
"maxOutputTokens": 128000,
- "efforts": ["medium", "high", "xhigh"],
+ "efforts": [
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4090,14 +4883,20 @@
},
{
"id": "openai/gpt-5.5-pro",
- "aliases": ["gpt-5.5-pro"],
+ "aliases": [
+ "gpt-5.5-pro"
+ ],
"defaults": {
"name": "GPT-5.5 Pro",
"description": "OpenAI GPT-5.5 Pro for precise, high-quality reasoning",
"group": "gpt",
"contextWindow": 1050000,
"maxOutputTokens": 128000,
- "efforts": ["medium", "high", "xhigh"],
+ "efforts": [
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4123,7 +4922,9 @@
},
{
"id": "openai/gpt-5.6-cyber",
- "aliases": ["gpt-5.6-cyber"],
+ "aliases": [
+ "gpt-5.6-cyber"
+ ],
"defaults": {
"name": "GPT-5.6 Cyber",
"description": "OpenAI cyber security reasoning model; access requires approval",
@@ -4158,14 +4959,22 @@
},
{
"id": "openai/gpt-6-astra",
- "aliases": ["gpt-6-astra"],
+ "aliases": [
+ "gpt-6-astra"
+ ],
"defaults": {
"name": "GPT-6 Astra",
"description": "OpenAI GPT-6 Astra for complex reasoning, coding, computer use, research, and document creation",
"group": "gpt",
"contextWindow": 1050000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4270,14 +5079,22 @@
},
{
"id": "anthropic/claude-fable-5-1",
- "aliases": ["claude-fable-5-1"],
+ "aliases": [
+ "claude-fable-5-1"
+ ],
"defaults": {
"name": "Fable 5.1",
"description": "Claude Fable 5.1 for long-running agentic coding and research",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4305,14 +5122,22 @@
},
{
"id": "anthropic/claude-fable-5",
- "aliases": ["claude-fable-5"],
+ "aliases": [
+ "claude-fable-5"
+ ],
"defaults": {
"name": "Fable 5",
"description": "Most capable, supports xhigh effort",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4340,13 +5165,21 @@
},
{
"id": "anthropic/claude-mythos-5",
- "aliases": ["claude-mythos-5"],
+ "aliases": [
+ "claude-mythos-5"
+ ],
"defaults": {
"name": "Mythos 5",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4374,14 +5207,22 @@
},
{
"id": "anthropic/claude-opus-5",
- "aliases": ["claude-opus-5"],
+ "aliases": [
+ "claude-opus-5"
+ ],
"defaults": {
"name": "Opus 5",
"description": "Latest Opus for ambitious work",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4424,14 +5265,22 @@
},
{
"id": "anthropic/claude-opus-4-8",
- "aliases": ["claude-opus-4-8"],
+ "aliases": [
+ "claude-opus-4-8"
+ ],
"defaults": {
"name": "Opus 4.8",
"description": "Most capable, supports xhigh effort",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4474,14 +5323,22 @@
},
{
"id": "anthropic/claude-opus-4-7",
- "aliases": ["claude-opus-4-7"],
+ "aliases": [
+ "claude-opus-4-7"
+ ],
"defaults": {
"name": "Opus 4.7",
"description": "Most capable, supports xhigh effort",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4509,14 +5366,21 @@
},
{
"id": "anthropic/claude-opus-4-6",
- "aliases": ["claude-opus-4-6"],
+ "aliases": [
+ "claude-opus-4-6"
+ ],
"defaults": {
"name": "Opus 4.6",
"description": "Most capable for ambitious work",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4544,14 +5408,20 @@
},
{
"id": "anthropic/claude-opus-4-5",
- "aliases": ["claude-opus-4-5"],
+ "aliases": [
+ "claude-opus-4-5"
+ ],
"defaults": {
"name": "Opus 4.5",
"description": "Earlier Opus generation",
"group": "anthropic",
"contextWindow": 200000,
"maxOutputTokens": 64000,
- "efforts": ["low", "medium", "high"],
+ "efforts": [
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4579,14 +5449,22 @@
},
{
"id": "anthropic/claude-sonnet-5",
- "aliases": ["claude-sonnet-5"],
+ "aliases": [
+ "claude-sonnet-5"
+ ],
"defaults": {
"name": "Sonnet 5",
"description": "Latest Sonnet — fast and highly capable",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4614,14 +5492,21 @@
},
{
"id": "anthropic/claude-sonnet-4-6",
- "aliases": ["claude-sonnet-4-6"],
+ "aliases": [
+ "claude-sonnet-4-6"
+ ],
"defaults": {
"name": "Sonnet 4.6",
"description": "Most efficient for everyday tasks",
"group": "anthropic",
"contextWindow": 1000000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4649,7 +5534,9 @@
},
{
"id": "anthropic/claude-sonnet-4-5",
- "aliases": ["claude-sonnet-4-5"],
+ "aliases": [
+ "claude-sonnet-4-5"
+ ],
"defaults": {
"name": "Sonnet 4.5",
"description": "Earlier Sonnet generation",
@@ -4683,7 +5570,9 @@
},
{
"id": "anthropic/claude-haiku-4-5",
- "aliases": ["claude-haiku-4-5"],
+ "aliases": [
+ "claude-haiku-4-5"
+ ],
"defaults": {
"name": "Haiku 4.5",
"description": "Fastest for quick answers",
@@ -4722,7 +5611,12 @@
"name": "Grok 4.7",
"group": "grok",
"contextWindow": 500000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "high",
"supportsImageInput": true
},
@@ -4797,7 +5691,12 @@
"name": "Grok 4.7 Fast",
"group": "grok",
"contextWindow": 500000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "high",
"supportsImageInput": true,
"supportsFastMode": false
@@ -4846,7 +5745,12 @@
"description": "xAI Grok 4.6 新旗舰,编码/agent 任务最强,500k 上下文(SuperGrok 订阅直连)",
"group": "grok",
"contextWindow": 500000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4893,7 +5797,11 @@
"description": "xAI Grok 4.5 新旗舰,编码/agent 任务最强,500k 上下文(SuperGrok 订阅直连)",
"group": "grok",
"contextWindow": 500000,
- "efforts": ["low", "medium", "high"],
+ "efforts": [
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -4940,7 +5848,11 @@
"description": "xAI Grok 4.3 通用旗舰,1M 上下文(SuperGrok 订阅直连)",
"group": "grok",
"contextWindow": 1000000,
- "efforts": ["low", "medium", "high"],
+ "efforts": [
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -5033,7 +5945,12 @@
"description": "xAI Grok 4.20 multi-agent model,1M 上下文(SuperGrok 订阅直连)",
"group": "grok",
"contextWindow": 1000000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -5172,7 +6089,12 @@
"description": "旧版兼容 alias;新会话请使用明确的 Grok 4.20 model ID",
"group": "grok",
"contextWindow": 1000000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -5324,14 +6246,20 @@
},
{
"id": "google/gemini-3.7-flash",
- "aliases": ["gemini-3.7-flash"],
+ "aliases": [
+ "gemini-3.7-flash"
+ ],
"defaults": {
"name": "Gemini 3.7 Flash",
"description": "Google Gemini 3.7 Flash — agentic workflows and multimodal reasoning",
"group": "google",
"contextWindow": 1000000,
"maxOutputTokens": 65536,
- "efforts": ["low", "medium", "high"],
+ "efforts": [
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -5371,14 +6299,21 @@
},
{
"id": "google/gemini-3.6-flash",
- "aliases": ["gemini-3.6-flash"],
+ "aliases": [
+ "gemini-3.6-flash"
+ ],
"defaults": {
"name": "Gemini 3.6 Flash",
"description": "Google Gemini 3.6 Flash — frontier intelligence optimized for speed and cost",
"group": "google",
"contextWindow": 1000000,
"maxOutputTokens": 65536,
- "efforts": ["minimal", "low", "medium", "high"],
+ "efforts": [
+ "minimal",
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -5418,14 +6353,21 @@
},
{
"id": "google/gemini-3.5-flash",
- "aliases": ["gemini-3.5-flash"],
+ "aliases": [
+ "gemini-3.5-flash"
+ ],
"defaults": {
"name": "Gemini 3.5 Flash",
"description": "Google Gemini 3.5 Flash — upgraded Flash with stronger reasoning",
"group": "google",
"contextWindow": 1000000,
"maxOutputTokens": 65536,
- "efforts": ["minimal", "low", "medium", "high"],
+ "efforts": [
+ "minimal",
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -5451,40 +6393,60 @@
},
{
"id": "google/gemini-3.1-pro-preview",
- "aliases": ["gemini-3.1-pro-preview"],
+ "aliases": [
+ "gemini-3.1-pro-preview"
+ ],
"defaults": {
"name": "Gemini 3.1 Pro",
"description": "Google Gemini 3.1 Pro Preview — deepest reasoning, multimodal",
"group": "google",
"contextWindow": 1000000,
"maxOutputTokens": 65536,
- "efforts": ["low", "medium", "high"],
+ "efforts": [
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
}
},
{
"id": "google/gemini-3-flash-preview",
- "aliases": ["gemini-3-flash-preview"],
+ "aliases": [
+ "gemini-3-flash-preview"
+ ],
"defaults": {
"name": "Gemini 3 Flash",
"description": "Google Gemini 3 Flash Preview — fast multimodal reasoning",
"group": "google",
"contextWindow": 1000000,
"maxOutputTokens": 65536,
- "efforts": ["minimal", "low", "medium", "high"],
+ "efforts": [
+ "minimal",
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
}
},
{
"id": "google/gemini-3.5-flash-lite",
- "aliases": ["gemini-3.5-flash-lite"],
+ "aliases": [
+ "gemini-3.5-flash-lite"
+ ],
"defaults": {
"name": "Gemini 3.5 Flash-Lite",
"description": "Google Gemini 3.5 Flash-Lite — cost-efficient multimodal model for high-volume workloads",
"group": "google",
"contextWindow": 1000000,
"maxOutputTokens": 65536,
- "efforts": ["minimal", "low", "medium", "high"],
+ "efforts": [
+ "minimal",
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -5510,14 +6472,21 @@
},
{
"id": "google/gemini-3.1-flash-lite",
- "aliases": ["gemini-3.1-flash-lite"],
+ "aliases": [
+ "gemini-3.1-flash-lite"
+ ],
"defaults": {
"name": "Gemini 3.1 Flash-Lite",
"description": "Google Gemini 3.1 Flash-Lite — efficient multimodal model for large-scale tasks",
"group": "google",
"contextWindow": 1000000,
"maxOutputTokens": 65536,
- "efforts": ["minimal", "low", "medium", "high"],
+ "efforts": [
+ "minimal",
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -5549,7 +6518,12 @@
"group": "china",
"contextWindow": 256000,
"maxOutputTokens": 256000,
- "efforts": ["minimal", "low", "medium", "high"],
+ "efforts": [
+ "minimal",
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
}
},
@@ -5561,7 +6535,12 @@
"group": "china",
"contextWindow": 983616,
"maxOutputTokens": 131072,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
}
},
@@ -5572,7 +6551,11 @@
"name": "Qwen 3.8 Max Preview",
"group": "china",
"contextWindow": 983616,
- "efforts": ["low", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "high"
}
},
@@ -5590,7 +6573,9 @@
},
{
"id": "moonshotai/kimi-k2.7-code",
- "aliases": ["kimi-k2.7-code"],
+ "aliases": [
+ "kimi-k2.7-code"
+ ],
"defaults": {
"name": "Kimi K2.7 Code",
"description": "Moonshot Kimi K2.7 Code agentic coding model",
@@ -5639,7 +6624,9 @@
},
{
"id": "moonshotai/kimi-k2.7-code-highspeed",
- "aliases": ["kimi-k2.7-code-highspeed"],
+ "aliases": [
+ "kimi-k2.7-code-highspeed"
+ ],
"defaults": {
"name": "Kimi K2.7 Code Highspeed",
"description": "Moonshot Kimi K2.7 Code high-speed API variant",
@@ -5758,7 +6745,11 @@
"group": "china",
"contextWindow": 1000000,
"maxOutputTokens": 131072,
- "efforts": ["minimal", "high", "max"],
+ "efforts": [
+ "minimal",
+ "high",
+ "max"
+ ],
"defaultEffort": "high"
},
"referencePriceGroups": [
@@ -5784,14 +6775,20 @@
},
{
"id": "z-ai/glm-5.3",
- "aliases": ["glm-5.3"],
+ "aliases": [
+ "glm-5.3"
+ ],
"defaults": {
"name": "GLM-5.3",
"description": "Zhipu GLM-5.3 agentic coding model; 1M context",
"group": "china",
"contextWindow": 1000000,
"maxOutputTokens": 131072,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "high"
},
"referencePriceGroups": [
@@ -5817,14 +6814,20 @@
},
{
"id": "z-ai/glm-5.3-flash",
- "aliases": ["glm-5.3-flash"],
+ "aliases": [
+ "glm-5.3-flash"
+ ],
"defaults": {
"name": "GLM-5.3-Flash",
"description": "Zhipu GLM-5.3-Flash native multimodal coding model; 1M context",
"group": "china",
"contextWindow": 1000000,
"maxOutputTokens": 131072,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "high"
},
"referencePriceGroups": [
@@ -5858,7 +6861,11 @@
"contextWindow": 1000000,
"maxOutputTokens": 131072,
"defaultEffort": "high",
- "efforts": ["low", "high", "max"]
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ]
},
"referencePriceGroups": [
{
@@ -5883,14 +6890,20 @@
},
{
"id": "deepseek/deepseek-v4-pro",
- "aliases": ["deepseek-v4-pro"],
+ "aliases": [
+ "deepseek-v4-pro"
+ ],
"defaults": {
"name": "DeepSeek V4 Pro",
"description": "DeepSeek V4 Pro reasoning model",
"group": "china",
"contextWindow": 1048576,
"maxOutputTokens": 384000,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "high"
},
"referencePriceGroups": [
@@ -5930,14 +6943,20 @@
},
{
"id": "deepseek/deepseek-v4-flash",
- "aliases": ["deepseek-v4-flash"],
+ "aliases": [
+ "deepseek-v4-flash"
+ ],
"defaults": {
"name": "DeepSeek V4 Flash",
"description": "DeepSeek V4 Flash efficiency-optimized MoE; supports low/high/max effort",
"group": "china",
"contextWindow": 1048576,
"maxOutputTokens": 384000,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "high"
},
"referencePriceGroups": [
@@ -5991,14 +7010,21 @@
},
{
"id": "openai/gpt-5.4-nano",
- "aliases": ["gpt-5.4-nano"],
+ "aliases": [
+ "gpt-5.4-nano"
+ ],
"defaults": {
"name": "GPT-5.4-Nano",
"description": "OpenAI GPT-5.4 nano for simple, high-volume tasks",
"group": "gpt",
"contextWindow": 400000,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -6024,7 +7050,9 @@
},
{
"id": "minimax/minimax-m3",
- "aliases": ["MiniMax-M3"],
+ "aliases": [
+ "MiniMax-M3"
+ ],
"defaults": {
"name": "MiniMax M3",
"group": "china",
@@ -6033,7 +7061,9 @@
},
{
"id": "minimax/minimax-m2.7",
- "aliases": ["MiniMax-M2.7"],
+ "aliases": [
+ "MiniMax-M2.7"
+ ],
"defaults": {
"name": "MiniMax M2.7",
"group": "china",
@@ -6082,7 +7112,9 @@
},
{
"id": "minimax/minimax-m2.7-highspeed",
- "aliases": ["MiniMax-M2.7-highspeed"],
+ "aliases": [
+ "MiniMax-M2.7-highspeed"
+ ],
"defaults": {
"name": "MiniMax M2.7 Highspeed",
"group": "china",
@@ -6131,7 +7163,9 @@
},
{
"id": "minimax/minimax-m2.5",
- "aliases": ["MiniMax-M2.5"],
+ "aliases": [
+ "MiniMax-M2.5"
+ ],
"defaults": {
"name": "MiniMax M2.5",
"group": "china",
@@ -6180,7 +7214,9 @@
},
{
"id": "minimax/minimax-m2.5-highspeed",
- "aliases": ["MiniMax-M2.5-highspeed"],
+ "aliases": [
+ "MiniMax-M2.5-highspeed"
+ ],
"defaults": {
"name": "MiniMax M2.5 Highspeed",
"group": "china",
@@ -6229,7 +7265,9 @@
},
{
"id": "minimax/minimax-m2.1",
- "aliases": ["MiniMax-M2.1"],
+ "aliases": [
+ "MiniMax-M2.1"
+ ],
"defaults": {
"name": "MiniMax M2.1",
"group": "china",
@@ -6278,7 +7316,9 @@
},
{
"id": "minimax/minimax-m2.1-highspeed",
- "aliases": ["MiniMax-M2.1-highspeed"],
+ "aliases": [
+ "MiniMax-M2.1-highspeed"
+ ],
"defaults": {
"name": "MiniMax M2.1 Highspeed",
"group": "china",
@@ -6327,7 +7367,9 @@
},
{
"id": "minimax/minimax-m2",
- "aliases": ["MiniMax-M2"],
+ "aliases": [
+ "MiniMax-M2"
+ ],
"defaults": {
"name": "MiniMax M2",
"group": "china",
@@ -6376,25 +7418,37 @@
},
{
"id": "moonshotai/kimi-k2.8-preview",
- "aliases": ["kimi-for-coding"],
+ "aliases": [
+ "kimi-for-coding"
+ ],
"defaults": {
"name": "Kimi K2.8 Preview",
"group": "china",
"contextWindow": 1048576,
"supportsImageInput": true,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "max"
}
},
{
"id": "moonshotai/kimi-k3",
- "aliases": ["kimi-k3"],
+ "aliases": [
+ "kimi-k3"
+ ],
"defaults": {
"name": "Kimi K3",
"group": "china",
"contextWindow": 1048576,
"maxOutputTokens": 1048576,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "high"
},
"referencePriceGroups": [
@@ -6480,7 +7534,9 @@
},
{
"id": "qwen/qwen3.6-plus-api",
- "aliases": ["qwen3.6-plus"],
+ "aliases": [
+ "qwen3.6-plus"
+ ],
"defaults": {
"name": "Qwen 3.6 Plus API",
"group": "china",
@@ -6490,7 +7546,9 @@
},
{
"id": "qwen/qwen3.7-flash",
- "aliases": ["qwen3.7-flash"],
+ "aliases": [
+ "qwen3.7-flash"
+ ],
"defaults": {
"name": "Qwen 3.7 Flash",
"description": "Alibaba Qwen 3.7 Flash text model with provider-managed thinking",
@@ -6502,14 +7560,20 @@
},
{
"id": "qwen/qwen3.8-flash",
- "aliases": ["qwen3.8-flash"],
+ "aliases": [
+ "qwen3.8-flash"
+ ],
"defaults": {
"name": "Qwen 3.8 Flash",
"description": "Alibaba Qwen 3.8 Flash multimodal model with provider-managed thinking",
"group": "china",
"contextWindow": 991808,
"maxOutputTokens": 131072,
- "efforts": ["low", "medium", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "xhigh"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -6534,7 +7598,9 @@
},
{
"id": "qwen/qwen3.7-plus",
- "aliases": ["qwen3.7-plus"],
+ "aliases": [
+ "qwen3.7-plus"
+ ],
"defaults": {
"name": "Qwen 3.7 Plus",
"description": "Alibaba Qwen 3.7 Plus text model with provider-managed thinking",
@@ -6546,7 +7612,9 @@
},
{
"id": "qwen/qwen3.6-flash",
- "aliases": ["qwen3.6-flash"],
+ "aliases": [
+ "qwen3.6-flash"
+ ],
"defaults": {
"name": "Qwen 3.6 Flash",
"description": "Alibaba Qwen 3.6 Flash text model with provider-managed thinking",
@@ -6558,7 +7626,10 @@
},
{
"id": "openai/gpt-5.5-auto",
- "aliases": ["xd/codex-gpt-5.5-auto", "codex/gpt-5.5:auto"],
+ "aliases": [
+ "xd/codex-gpt-5.5-auto",
+ "codex/gpt-5.5:auto"
+ ],
"defaults": {
"name": "GPT-5.5-Auto",
"group": "gpt-budget",
@@ -6572,7 +7643,12 @@
"name": "Qwen3.8 27B",
"contextWindow": 991808,
"maxOutputTokens": 131072,
- "efforts": ["low", "medium", "high", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh"
+ ],
"defaultEffort": "medium"
}
},
@@ -6583,7 +7659,11 @@
"name": "Hy3",
"contextWindow": 262144,
"maxOutputTokens": 128000,
- "efforts": ["low", "medium", "high"],
+ "efforts": [
+ "low",
+ "medium",
+ "high"
+ ],
"defaultEffort": "medium"
}
},
@@ -6616,13 +7696,20 @@
},
{
"id": "xd/moonshotai-kimi-k3",
- "aliases": ["moonshot/kimi-k3"],
+ "aliases": [
+ "moonshot/kimi-k3"
+ ],
"defaults": {
"name": "Kimi K3",
"group": "china",
"contextWindow": 1048576,
"maxOutputTokens": 1048576,
- "efforts": ["low", "medium", "high", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "max"
+ ],
"defaultEffort": "medium"
},
"referencePriceGroups": [
@@ -6663,7 +7750,9 @@
},
{
"id": "xd/deepseek-deepseek-v4-flash-vision-exp",
- "aliases": ["deepseek/deepseek-v4-flash-vision-exp"],
+ "aliases": [
+ "deepseek/deepseek-v4-flash-vision-exp"
+ ],
"defaults": {
"name": "DeepSeek V4 Flash Vision Exp",
"defaultEffort": "medium"
@@ -6671,7 +7760,9 @@
},
{
"id": "xd/tencent-hy4-preview",
- "aliases": ["tencent/hy4-preview"],
+ "aliases": [
+ "tencent/hy4-preview"
+ ],
"defaults": {
"name": "Hy4 preview",
"defaultEffort": "medium"
@@ -6699,41 +7790,63 @@
},
{
"id": "moonshotai/kimi-k3.1-pro",
- "aliases": ["kimi-k3.1-pro", "k3.1-pro"],
+ "aliases": [
+ "kimi-k3.1-pro",
+ "k3.1-pro"
+ ],
"defaults": {
"name": "Kimi K3.1 Pro",
"group": "china",
"contextWindow": 1048576,
"maxOutputTokens": 1048576,
"supportsImageInput": true,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "max",
"officialDocs": "https://platform.kimi.ai/docs/guide/kimi-k3-1-pro-quickstart"
}
},
{
"id": "moonshotai/kimi-k3.1-pro-highspeed",
- "aliases": ["kimi-k3.1-pro-highspeed", "k3.1-pro-highspeed"],
+ "aliases": [
+ "kimi-k3.1-pro-highspeed",
+ "k3.1-pro-highspeed"
+ ],
"defaults": {
"name": "Kimi K3.1 Pro Highspeed",
"group": "china",
"contextWindow": 1048576,
"maxOutputTokens": 1048576,
"supportsImageInput": true,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "max",
"officialDocs": "https://platform.kimi.ai/docs/guide/kimi-k3-1-pro-quickstart"
}
},
{
"id": "minimax/minimax-m3.1-flash",
- "aliases": ["MiniMax-M3.1-Flash"],
+ "aliases": [
+ "MiniMax-M3.1-Flash"
+ ],
"defaults": {
"name": "MiniMax M3.1 Flash",
"group": "china",
"contextWindow": 1000000,
"supportsImageInput": true,
- "efforts": ["low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium",
"officialDocs": "https://platform.minimax.io/docs/api-reference/text-anthropic-api"
},
@@ -6760,13 +7873,19 @@
},
{
"id": "deepseek/deepseek-v4.1-flash",
- "aliases": ["deepseek-flash"],
+ "aliases": [
+ "deepseek-flash"
+ ],
"defaults": {
"name": "DeepSeek V4.1 Flash",
"group": "china",
"contextWindow": 1048576,
"maxOutputTokens": 384000,
- "efforts": ["low", "high", "max"],
+ "efforts": [
+ "low",
+ "high",
+ "max"
+ ],
"defaultEffort": "high",
"officialDocs": "https://api-docs.deepseek.com/updates/"
},
@@ -6859,170 +7978,262 @@
"aliases": [],
"defaults": {
"name": "Qwen3.8 Flash-Next",
- "efforts": ["low", "medium", "xhigh"],
+ "efforts": [
+ "low",
+ "medium",
+ "xhigh"
+ ],
"defaultEffort": "medium"
}
},
{
"id": "openai/gpt-image-2.5-sunburst",
- "aliases": ["gpt-image-2.5-sunburst"],
+ "aliases": [
+ "gpt-image-2.5-sunburst"
+ ],
"defaults": {
"name": "GPT Image 2.5 Sunburst",
"mode": "image_generation",
"modalities": {
- "input": ["text", "image"],
- "output": ["image"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "image"
+ ]
}
}
},
{
"id": "openai/gpt-image-2.5-flare",
- "aliases": ["gpt-image-2.5-flare"],
+ "aliases": [
+ "gpt-image-2.5-flare"
+ ],
"defaults": {
"name": "GPT Image 2.5 Flare",
"mode": "image_generation",
"modalities": {
- "input": ["text", "image"],
- "output": ["image"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "image"
+ ]
}
}
},
{
"id": "openai/gpt-image-2",
- "aliases": ["gpt-image-2"],
+ "aliases": [
+ "gpt-image-2"
+ ],
"defaults": {
"name": "GPT Image 2",
"mode": "image_generation",
"modalities": {
- "input": ["text", "image"],
- "output": ["image"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "image"
+ ]
}
}
},
{
"id": "gemini/gemini-3-pro-image",
- "aliases": ["gemini-3-pro-image"],
+ "aliases": [
+ "gemini-3-pro-image"
+ ],
"defaults": {
"name": "Gemini 3 Pro Image",
"mode": "image_generation",
"modalities": {
- "input": ["text", "image"],
- "output": ["image"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "image"
+ ]
}
}
},
{
"id": "gemini/gemini-3.1-flash-image",
- "aliases": ["gemini-3.1-flash-image"],
+ "aliases": [
+ "gemini-3.1-flash-image"
+ ],
"defaults": {
"name": "Gemini 3.1 Flash Image",
"mode": "image_generation",
"modalities": {
- "input": ["text", "image"],
- "output": ["image"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "image"
+ ]
}
}
},
{
"id": "xai/grok-imagine-image",
- "aliases": ["grok-imagine-image"],
+ "aliases": [
+ "grok-imagine-image"
+ ],
"defaults": {
"name": "Grok Imagine Image",
"mode": "image_generation",
"modalities": {
- "input": ["text", "image"],
- "output": ["image"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "image"
+ ]
}
}
},
{
"id": "xai/grok-imagine-image-quality",
- "aliases": ["grok-imagine-image-quality"],
+ "aliases": [
+ "grok-imagine-image-quality"
+ ],
"defaults": {
"name": "Grok Imagine Image (Quality)",
"mode": "image_generation",
"modalities": {
- "input": ["text", "image"],
- "output": ["image"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "image"
+ ]
}
}
},
{
"id": "xai/grok-imagine-video",
- "aliases": ["grok-imagine-video"],
+ "aliases": [
+ "grok-imagine-video"
+ ],
"defaults": {
"name": "Grok Imagine Video",
"mode": "video_generation",
"modalities": {
- "input": ["text", "image"],
- "output": ["video"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "video"
+ ]
}
}
},
{
"id": "openai/gpt-4o-mini-tts",
- "aliases": ["gpt-4o-mini-tts"],
+ "aliases": [
+ "gpt-4o-mini-tts"
+ ],
"defaults": {
"name": "GPT-4o mini TTS",
"mode": "audio_speech",
"officialDocs": "https://developers.openai.com/api/docs/models/gpt-4o-mini-tts",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
}
}
},
{
"id": "openai/whisper-1",
- "aliases": ["whisper-1"],
+ "aliases": [
+ "whisper-1"
+ ],
"defaults": {
"name": "Whisper",
"mode": "audio_transcription",
"modalities": {
- "input": ["audio"],
- "output": ["text"]
+ "input": [
+ "audio"
+ ],
+ "output": [
+ "text"
+ ]
}
}
},
{
"id": "openai/gpt-realtime-whisper",
- "aliases": ["gpt-realtime-whisper"],
+ "aliases": [
+ "gpt-realtime-whisper"
+ ],
"defaults": {
"name": "GPT Realtime Whisper",
"mode": "realtime",
"modalities": {
- "input": ["audio"],
- "output": ["text"]
+ "input": [
+ "audio"
+ ],
+ "output": [
+ "text"
+ ]
}
}
},
{
"id": "openai/text-embedding-3-small",
- "aliases": ["text-embedding-3-small"],
+ "aliases": [
+ "text-embedding-3-small"
+ ],
"defaults": {
"name": "Text Embedding 3 Small",
"mode": "embedding",
"modalities": {
- "input": ["text"],
- "output": ["embedding"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "embedding"
+ ]
}
}
},
{
"id": "openai/text-embedding-3-large",
- "aliases": ["text-embedding-3-large"],
+ "aliases": [
+ "text-embedding-3-large"
+ ],
"defaults": {
"name": "Text Embedding 3 Large",
"mode": "embedding",
"modalities": {
- "input": ["text"],
- "output": ["embedding"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "embedding"
+ ]
}
}
},
{
"id": "xiaomi/mimo-v2.6-pro",
- "aliases": ["mimo-v2.6-pro"],
+ "aliases": [
+ "mimo-v2.6-pro"
+ ],
"defaults": {
"name": "MiMo V2.6 Pro",
"description": "小米 MiMo V2.6 Pro 全模态推理模型(深度思考为开/关开关,无 reasoning_effort 档位);1M 上下文 / 128K 最大输出",
@@ -7074,7 +8285,9 @@
},
{
"id": "xiaomi/mimo-v2.6-flash",
- "aliases": ["mimo-v2.6-flash"],
+ "aliases": [
+ "mimo-v2.6-flash"
+ ],
"defaults": {
"name": "MiMo V2.6 Flash",
"description": "小米 MiMo V2.6 Flash 全模态推理模型(深度思考为开/关开关,无 reasoning_effort 档位);1M 上下文 / 128K 最大输出",
@@ -7126,7 +8339,9 @@
},
{
"id": "xiaomi/mimo-v2.6-pro-ultraspeed",
- "aliases": ["mimo-v2.6-pro-ultraspeed"],
+ "aliases": [
+ "mimo-v2.6-pro-ultraspeed"
+ ],
"defaults": {
"name": "MiMo V2.6 Pro UltraSpeed",
"description": "小米 MiMo V2.6 Pro UltraSpeed 低时延定制服务;1M 上下文 / 128K 最大输出",
@@ -7177,7 +8392,9 @@
},
{
"id": "meta/muse-spark-1.3",
- "aliases": ["muse-spark-1.3"],
+ "aliases": [
+ "muse-spark-1.3"
+ ],
"defaults": {
"name": "Muse Spark 1.3"
},
@@ -7204,17 +8421,31 @@
},
{
"id": "meta/muse-wonder-1.0",
- "aliases": ["muse-wonder-1.0"],
+ "aliases": [
+ "muse-wonder-1.0"
+ ],
"defaults": {
"name": "Muse Wonder",
- "efforts": ["minimal", "low", "medium", "high", "xhigh", "max"],
+ "efforts": [
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max"
+ ],
"defaultEffort": "medium",
"supportsImageInput": true,
"contextWindow": 1048576,
"mode": "chat",
"modalities": {
- "input": ["text", "image"],
- "output": ["text"]
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "text"
+ ]
},
"officialDocs": "https://dev.meta.ai/docs/models"
},
@@ -7241,7 +8472,9 @@
},
{
"id": "google/gemini-3.8-flash",
- "aliases": ["gemini-3.8-flash"],
+ "aliases": [
+ "gemini-3.8-flash"
+ ],
"defaults": {
"name": "Gemini 3.8 Flash"
},
@@ -7289,390 +8522,570 @@
},
{
"id": "openai/tts-1",
- "aliases": ["tts-1"],
- "defaults": {
+ "aliases": [
+ "tts-1"
+ ],
+ "defaults": {
"name": "TTS-1",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://developers.openai.com/api/docs/models/tts-1"
}
},
{
"id": "openai/tts-1-hd",
- "aliases": ["tts-1-hd"],
+ "aliases": [
+ "tts-1-hd"
+ ],
"defaults": {
"name": "TTS-1 HD",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://developers.openai.com/api/docs/models/tts-1-hd"
}
},
{
"id": "openai/gpt-4o-mini-tts-2025-03-20",
- "aliases": ["gpt-4o-mini-tts-2025-03-20"],
+ "aliases": [
+ "gpt-4o-mini-tts-2025-03-20"
+ ],
"defaults": {
"name": "GPT-4o mini TTS (2025-03-20)",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://developers.openai.com/api/docs/models/gpt-4o-mini-tts"
}
},
{
"id": "openai/gpt-4o-mini-tts-2025-12-15",
- "aliases": ["gpt-4o-mini-tts-2025-12-15"],
+ "aliases": [
+ "gpt-4o-mini-tts-2025-12-15"
+ ],
"defaults": {
"name": "GPT-4o mini TTS (2025-12-15)",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://developers.openai.com/api/docs/models/gpt-4o-mini-tts"
}
},
{
"id": "elevenlabs/eleven_v4",
- "aliases": ["eleven_v4"],
+ "aliases": [
+ "eleven_v4"
+ ],
"defaults": {
"name": "Eleven v4",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "elevenlabs/eleven_v4_turbo",
- "aliases": ["eleven_v4_turbo"],
+ "aliases": [
+ "eleven_v4_turbo"
+ ],
"defaults": {
"name": "Eleven v4 Turbo",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "elevenlabs/eleven_v3",
- "aliases": ["eleven_v3"],
+ "aliases": [
+ "eleven_v3"
+ ],
"defaults": {
"name": "Eleven v3",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "elevenlabs/eleven_v3_conversational",
- "aliases": ["eleven_v3_conversational"],
+ "aliases": [
+ "eleven_v3_conversational"
+ ],
"defaults": {
"name": "Eleven v3 Conversational",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "elevenlabs/eleven_multilingual_v2",
- "aliases": ["eleven_multilingual_v2"],
+ "aliases": [
+ "eleven_multilingual_v2"
+ ],
"defaults": {
"name": "Eleven Multilingual v2",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "elevenlabs/eleven_flash_v2_5",
- "aliases": ["eleven_flash_v2_5"],
+ "aliases": [
+ "eleven_flash_v2_5"
+ ],
"defaults": {
"name": "Eleven Flash v2.5",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "elevenlabs/eleven_flash_v2",
- "aliases": ["eleven_flash_v2"],
+ "aliases": [
+ "eleven_flash_v2"
+ ],
"defaults": {
"name": "Eleven Flash v2",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "elevenlabs/eleven_turbo_v2_5",
- "aliases": ["eleven_turbo_v2_5"],
+ "aliases": [
+ "eleven_turbo_v2_5"
+ ],
"defaults": {
"name": "Eleven Turbo v2.5",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "elevenlabs/eleven_turbo_v2",
- "aliases": ["eleven_turbo_v2"],
+ "aliases": [
+ "eleven_turbo_v2"
+ ],
"defaults": {
"name": "Eleven Turbo v2",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://elevenlabs.io/docs/overview/models"
}
},
{
"id": "minimax/speech-2.8-hd",
- "aliases": ["speech-2.8-hd"],
+ "aliases": [
+ "speech-2.8-hd"
+ ],
"defaults": {
"name": "MiniMax Speech 2.8 HD",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://platform.minimax.io/docs/api-reference/speech-t2a-http"
}
},
{
"id": "minimax/speech-2.8-turbo",
- "aliases": ["speech-2.8-turbo"],
+ "aliases": [
+ "speech-2.8-turbo"
+ ],
"defaults": {
"name": "MiniMax Speech 2.8 Turbo",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://platform.minimax.io/docs/api-reference/speech-t2a-http"
}
},
{
"id": "minimax/speech-2.6-hd",
- "aliases": ["speech-2.6-hd"],
+ "aliases": [
+ "speech-2.6-hd"
+ ],
"defaults": {
"name": "MiniMax Speech 2.6 HD",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://platform.minimax.io/docs/api-reference/speech-t2a-http"
}
},
{
"id": "minimax/speech-2.6-turbo",
- "aliases": ["speech-2.6-turbo"],
+ "aliases": [
+ "speech-2.6-turbo"
+ ],
"defaults": {
"name": "MiniMax Speech 2.6 Turbo",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://platform.minimax.io/docs/api-reference/speech-t2a-http"
}
},
{
"id": "minimax/speech-02-hd",
- "aliases": ["speech-02-hd"],
+ "aliases": [
+ "speech-02-hd"
+ ],
"defaults": {
"name": "MiniMax Speech 02 HD",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://platform.minimax.io/docs/api-reference/speech-t2a-http"
}
},
{
"id": "minimax/speech-02-turbo",
- "aliases": ["speech-02-turbo"],
+ "aliases": [
+ "speech-02-turbo"
+ ],
"defaults": {
"name": "MiniMax Speech 02 Turbo",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://platform.minimax.io/docs/api-reference/speech-t2a-http"
}
},
{
"id": "minimax/speech-01-hd",
- "aliases": ["speech-01-hd"],
+ "aliases": [
+ "speech-01-hd"
+ ],
"defaults": {
"name": "MiniMax Speech 01 HD",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://platform.minimax.io/docs/api-reference/speech-t2a-http"
}
},
{
"id": "minimax/speech-01-turbo",
- "aliases": ["speech-01-turbo"],
+ "aliases": [
+ "speech-01-turbo"
+ ],
"defaults": {
"name": "MiniMax Speech 01 Turbo",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://platform.minimax.io/docs/api-reference/speech-t2a-http"
}
},
{
"id": "qwen/qwen3-tts-flash",
- "aliases": ["qwen3-tts-flash"],
+ "aliases": [
+ "qwen3-tts-flash"
+ ],
"defaults": {
"name": "Qwen3 TTS Flash",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/qwen-tts-api"
}
},
{
"id": "qwen/qwen3-tts-flash-realtime",
- "aliases": ["qwen3-tts-flash-realtime"],
+ "aliases": [
+ "qwen3-tts-flash-realtime"
+ ],
"defaults": {
"name": "Qwen3 TTS Flash Realtime",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/realtime-tts-user-guide"
}
},
{
"id": "qwen/qwen-audio-3.0-tts-plus",
- "aliases": ["qwen-audio-3.0-tts-plus"],
+ "aliases": [
+ "qwen-audio-3.0-tts-plus"
+ ],
"defaults": {
"name": "Qwen Audio 3.0 TTS Plus",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/tts-model"
}
},
{
"id": "qwen/qwen-audio-3.0-tts-flash",
- "aliases": ["qwen-audio-3.0-tts-flash"],
+ "aliases": [
+ "qwen-audio-3.0-tts-flash"
+ ],
"defaults": {
"name": "Qwen Audio 3.0 TTS Flash",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/tts-model"
}
},
{
"id": "alibaba/cosyvoice-v3.5-plus",
- "aliases": ["cosyvoice-v3.5-plus"],
+ "aliases": [
+ "cosyvoice-v3.5-plus"
+ ],
"defaults": {
"name": "CosyVoice v3.5 Plus",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/tts-model"
}
},
{
"id": "alibaba/cosyvoice-v3.5-flash",
- "aliases": ["cosyvoice-v3.5-flash"],
+ "aliases": [
+ "cosyvoice-v3.5-flash"
+ ],
"defaults": {
"name": "CosyVoice v3.5 Flash",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/tts-model"
}
},
{
"id": "alibaba/cosyvoice-v3-plus",
- "aliases": ["cosyvoice-v3-plus"],
+ "aliases": [
+ "cosyvoice-v3-plus"
+ ],
"defaults": {
"name": "CosyVoice v3 Plus",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/tts-model"
}
},
{
"id": "alibaba/cosyvoice-v3-flash",
- "aliases": ["cosyvoice-v3-flash"],
+ "aliases": [
+ "cosyvoice-v3-flash"
+ ],
"defaults": {
"name": "CosyVoice v3 Flash",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/tts-model"
}
},
{
"id": "alibaba/cosyvoice-v2",
- "aliases": ["cosyvoice-v2"],
+ "aliases": [
+ "cosyvoice-v2"
+ ],
"defaults": {
"name": "CosyVoice v2",
"mode": "audio_speech",
"modalities": {
- "input": ["text"],
- "output": ["audio"]
+ "input": [
+ "text"
+ ],
+ "output": [
+ "audio"
+ ]
},
"officialDocs": "https://www.alibabacloud.com/help/en/model-studio/tts-model"
}
@@ -7684,5 +9097,1069 @@
"name": "Auto"
}
}
+ ],
+ "interfaceProfiles": [
+ {
+ "id": "openrouter-anthropic-messages",
+ "providerId": "openrouter",
+ "api": "anthropic-messages",
+ "baseUrl": "https://openrouter.ai/api",
+ "inputBaseUrls": [
+ "https://openrouter.ai/api",
+ "https://openrouter.ai/api/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "openrouter-openai-responses",
+ "providerId": "openrouter",
+ "api": "openai-responses",
+ "baseUrl": "https://openrouter.ai/api/v1",
+ "inputBaseUrls": [
+ "https://openrouter.ai/api",
+ "https://openrouter.ai/api/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "openrouter-openai-completions",
+ "providerId": "openrouter",
+ "api": "openai-completions",
+ "baseUrl": "https://openrouter.ai/api/v1",
+ "inputBaseUrls": [
+ "https://openrouter.ai/api",
+ "https://openrouter.ai/api/v1"
+ ],
+ "defaultFor": [
+ "pi"
+ ]
+ },
+ {
+ "id": "vercel-ai-gateway-anthropic-messages",
+ "providerId": "vercel-ai-gateway",
+ "api": "anthropic-messages",
+ "baseUrl": "https://ai-gateway.vercel.sh",
+ "inputBaseUrls": [
+ "https://ai-gateway.vercel.sh",
+ "https://ai-gateway.vercel.sh/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "vercel-ai-gateway-openai-responses",
+ "providerId": "vercel-ai-gateway",
+ "api": "openai-responses",
+ "baseUrl": "https://ai-gateway.vercel.sh/v1",
+ "inputBaseUrls": [
+ "https://ai-gateway.vercel.sh",
+ "https://ai-gateway.vercel.sh/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "vercel-ai-gateway-openai-completions",
+ "providerId": "vercel-ai-gateway",
+ "api": "openai-completions",
+ "baseUrl": "https://ai-gateway.vercel.sh/v1",
+ "inputBaseUrls": [
+ "https://ai-gateway.vercel.sh",
+ "https://ai-gateway.vercel.sh/v1"
+ ],
+ "defaultFor": [
+ "pi"
+ ]
+ },
+ {
+ "id": "deepseek-anthropic-messages",
+ "providerId": "deepseek",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.deepseek.com/anthropic",
+ "inputBaseUrls": [
+ "https://api.deepseek.com/anthropic",
+ "https://api.deepseek.com"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "deepseek-openai-completions",
+ "providerId": "deepseek",
+ "api": "openai-completions",
+ "baseUrl": "https://api.deepseek.com",
+ "inputBaseUrls": [
+ "https://api.deepseek.com/anthropic",
+ "https://api.deepseek.com"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "zhipu-glm-cn-anthropic-messages",
+ "providerId": "zhipu-glm-cn",
+ "api": "anthropic-messages",
+ "baseUrl": "https://open.bigmodel.cn/api/anthropic",
+ "inputBaseUrls": [
+ "https://open.bigmodel.cn/api/anthropic",
+ "https://open.bigmodel.cn/api/paas/v4"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "zhipu-glm-cn-openai-completions",
+ "providerId": "zhipu-glm-cn",
+ "api": "openai-completions",
+ "baseUrl": "https://open.bigmodel.cn/api/paas/v4",
+ "inputBaseUrls": [
+ "https://open.bigmodel.cn/api/anthropic",
+ "https://open.bigmodel.cn/api/paas/v4"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "zhipu-glm-global-anthropic-messages",
+ "providerId": "zhipu-glm-global",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.z.ai/api/anthropic",
+ "inputBaseUrls": [
+ "https://api.z.ai/api/anthropic",
+ "https://api.z.ai/api/paas/v4"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "zhipu-glm-global-openai-completions",
+ "providerId": "zhipu-glm-global",
+ "api": "openai-completions",
+ "baseUrl": "https://api.z.ai/api/paas/v4",
+ "inputBaseUrls": [
+ "https://api.z.ai/api/anthropic",
+ "https://api.z.ai/api/paas/v4"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "moonshot-kimi-cn-anthropic-messages",
+ "providerId": "moonshot-kimi-cn",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.moonshot.cn/anthropic",
+ "inputBaseUrls": [
+ "https://api.moonshot.cn/anthropic",
+ "https://api.moonshot.cn/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "compatibility": [
+ "kimi-tool-ids-v1"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "moonshot-kimi-cn-openai-completions",
+ "providerId": "moonshot-kimi-cn",
+ "api": "openai-completions",
+ "baseUrl": "https://api.moonshot.cn/v1",
+ "inputBaseUrls": [
+ "https://api.moonshot.cn/anthropic",
+ "https://api.moonshot.cn/v1"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ],
+ "compatibility": [
+ "chat-image-v1"
+ ],
+ "modelIds": [
+ "kimi-k3.1-pro",
+ "kimi-k3.1-pro-highspeed",
+ "kimi-k3",
+ "kimi-k2.7-code",
+ "kimi-k2.7-code-highspeed",
+ "kimi-k2.6"
+ ],
+ "defaults": {
+ "supportsImageInput": true
+ }
+ },
+ {
+ "id": "moonshot-kimi-global-anthropic-messages",
+ "providerId": "moonshot-kimi-global",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.moonshot.ai/anthropic",
+ "inputBaseUrls": [
+ "https://api.moonshot.ai/anthropic",
+ "https://api.moonshot.ai/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "compatibility": [
+ "kimi-tool-ids-v1"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "moonshot-kimi-global-openai-completions",
+ "providerId": "moonshot-kimi-global",
+ "api": "openai-completions",
+ "baseUrl": "https://api.moonshot.ai/v1",
+ "inputBaseUrls": [
+ "https://api.moonshot.ai/anthropic",
+ "https://api.moonshot.ai/v1"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ],
+ "compatibility": [
+ "chat-image-v1"
+ ],
+ "modelIds": [
+ "kimi-k3.1-pro",
+ "kimi-k3.1-pro-highspeed",
+ "kimi-k3",
+ "kimi-k2.7-code",
+ "kimi-k2.7-code-highspeed",
+ "kimi-k2.6"
+ ],
+ "defaults": {
+ "supportsImageInput": true
+ }
+ },
+ {
+ "id": "moonshot-kimi-code-anthropic-messages",
+ "providerId": "moonshot-kimi-code",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.kimi.com/coding",
+ "inputBaseUrls": [
+ "https://api.kimi.com/coding",
+ "https://api.kimi.com/coding/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "pi"
+ ],
+ "compatibility": [
+ "kimi-tool-ids-v1"
+ ]
+ },
+ {
+ "id": "moonshot-kimi-code-openai-completions",
+ "providerId": "moonshot-kimi-code",
+ "api": "openai-completions",
+ "baseUrl": "https://api.kimi.com/coding/v1",
+ "inputBaseUrls": [
+ "https://api.kimi.com/coding",
+ "https://api.kimi.com/coding/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "compatibility": [
+ "chat-image-v1"
+ ],
+ "modelIds": [
+ "k3.1-pro",
+ "k3.1-pro-highspeed",
+ "k3",
+ "k3-256k",
+ "kimi-for-coding",
+ "kimi-for-coding-highspeed"
+ ],
+ "defaults": {
+ "supportsImageInput": true
+ }
+ },
+ {
+ "id": "minimax-cn-anthropic-messages",
+ "providerId": "minimax-cn",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.minimaxi.com/anthropic",
+ "inputBaseUrls": [
+ "https://api.minimaxi.com/anthropic",
+ "https://api.minimaxi.com/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "pi"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "minimax-cn-openai-responses",
+ "providerId": "minimax-cn",
+ "api": "openai-responses",
+ "baseUrl": "https://api.minimaxi.com/v1",
+ "inputBaseUrls": [
+ "https://api.minimaxi.com/anthropic",
+ "https://api.minimaxi.com/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "minimax-global-anthropic-messages",
+ "providerId": "minimax-global",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.minimax.io/anthropic",
+ "inputBaseUrls": [
+ "https://api.minimax.io/anthropic",
+ "https://api.minimax.io/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "pi"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "minimax-global-openai-responses",
+ "providerId": "minimax-global",
+ "api": "openai-responses",
+ "baseUrl": "https://api.minimax.io/v1",
+ "inputBaseUrls": [
+ "https://api.minimax.io/anthropic",
+ "https://api.minimax.io/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "aliyun-bailian-coding-anthropic-messages",
+ "providerId": "aliyun-bailian-coding",
+ "api": "anthropic-messages",
+ "baseUrl": "https://coding.dashscope.aliyuncs.com/apps/anthropic",
+ "inputBaseUrls": [
+ "https://coding.dashscope.aliyuncs.com/apps/anthropic",
+ "https://coding.dashscope.aliyuncs.com/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "aliyun-bailian-coding-openai-completions",
+ "providerId": "aliyun-bailian-coding",
+ "api": "openai-completions",
+ "baseUrl": "https://coding.dashscope.aliyuncs.com/v1",
+ "inputBaseUrls": [
+ "https://coding.dashscope.aliyuncs.com/apps/anthropic",
+ "https://coding.dashscope.aliyuncs.com/v1"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "aliyun-bailian-token-plan-cn-anthropic-messages",
+ "providerId": "aliyun-bailian-token-plan-cn",
+ "api": "anthropic-messages",
+ "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
+ "inputBaseUrls": [
+ "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
+ "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "aliyun-bailian-token-plan-cn-openai-completions",
+ "providerId": "aliyun-bailian-token-plan-cn",
+ "api": "openai-completions",
+ "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
+ "inputBaseUrls": [
+ "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
+ "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "aliyun-bailian-token-plan-team-cn-anthropic-messages",
+ "providerId": "aliyun-bailian-token-plan-team-cn",
+ "api": "anthropic-messages",
+ "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
+ "inputBaseUrls": [
+ "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
+ "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "aliyun-bailian-token-plan-team-cn-openai-completions",
+ "providerId": "aliyun-bailian-token-plan-team-cn",
+ "api": "openai-completions",
+ "baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
+ "inputBaseUrls": [
+ "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",
+ "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "zhipu-coding-plan-cn-anthropic-messages",
+ "providerId": "zhipu-coding-plan-cn",
+ "api": "anthropic-messages",
+ "baseUrl": "https://open.bigmodel.cn/api/anthropic",
+ "inputBaseUrls": [
+ "https://open.bigmodel.cn/api/anthropic",
+ "https://open.bigmodel.cn/api/coding/paas/v4"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "zhipu-coding-plan-cn-openai-completions",
+ "providerId": "zhipu-coding-plan-cn",
+ "api": "openai-completions",
+ "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
+ "inputBaseUrls": [
+ "https://open.bigmodel.cn/api/anthropic",
+ "https://open.bigmodel.cn/api/coding/paas/v4"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "zai-coding-plan-global-anthropic-messages",
+ "providerId": "zai-coding-plan-global",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.z.ai/api/anthropic",
+ "inputBaseUrls": [
+ "https://api.z.ai/api/anthropic",
+ "https://api.z.ai/api/coding/paas/v4"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "zai-coding-plan-global-openai-completions",
+ "providerId": "zai-coding-plan-global",
+ "api": "openai-completions",
+ "baseUrl": "https://api.z.ai/api/coding/paas/v4",
+ "inputBaseUrls": [
+ "https://api.z.ai/api/anthropic",
+ "https://api.z.ai/api/coding/paas/v4"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "xiaomi-mimo-api-cn-anthropic-messages",
+ "providerId": "xiaomi-mimo-api-cn",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.xiaomimimo.com/anthropic",
+ "inputBaseUrls": [
+ "https://api.xiaomimimo.com/anthropic",
+ "https://api.xiaomimimo.com/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "xiaomi-mimo-api-cn-openai-completions",
+ "providerId": "xiaomi-mimo-api-cn",
+ "api": "openai-completions",
+ "baseUrl": "https://api.xiaomimimo.com/v1",
+ "inputBaseUrls": [
+ "https://api.xiaomimimo.com/anthropic",
+ "https://api.xiaomimimo.com/v1"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "xiaomi-mimo-token-plan-cn-anthropic-messages",
+ "providerId": "xiaomi-mimo-token-plan-cn",
+ "api": "anthropic-messages",
+ "baseUrl": "https://token-plan-cn.xiaomimimo.com/anthropic",
+ "inputBaseUrls": [
+ "https://token-plan-cn.xiaomimimo.com/anthropic",
+ "https://token-plan-cn.xiaomimimo.com/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "xiaomi-mimo-token-plan-cn-openai-completions",
+ "providerId": "xiaomi-mimo-token-plan-cn",
+ "api": "openai-completions",
+ "baseUrl": "https://token-plan-cn.xiaomimimo.com/v1",
+ "inputBaseUrls": [
+ "https://token-plan-cn.xiaomimimo.com/anthropic",
+ "https://token-plan-cn.xiaomimimo.com/v1"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "volcengine-agent-plan-anthropic-messages",
+ "providerId": "volcengine-agent-plan",
+ "api": "anthropic-messages",
+ "baseUrl": "https://ark.cn-beijing.volces.com/api/plan",
+ "inputBaseUrls": [
+ "https://ark.cn-beijing.volces.com/api/plan",
+ "https://ark.cn-beijing.volces.com/api/plan/v3"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "volcengine-agent-plan-openai-completions",
+ "providerId": "volcengine-agent-plan",
+ "api": "openai-completions",
+ "baseUrl": "https://ark.cn-beijing.volces.com/api/plan/v3",
+ "inputBaseUrls": [
+ "https://ark.cn-beijing.volces.com/api/plan",
+ "https://ark.cn-beijing.volces.com/api/plan/v3"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "volcengine-coding-plan-anthropic-messages",
+ "providerId": "volcengine-coding-plan",
+ "api": "anthropic-messages",
+ "baseUrl": "https://ark.cn-beijing.volces.com/api/coding",
+ "inputBaseUrls": [
+ "https://ark.cn-beijing.volces.com/api/coding",
+ "https://ark.cn-beijing.volces.com/api/coding/v3"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "volcengine-coding-plan-openai-completions",
+ "providerId": "volcengine-coding-plan",
+ "api": "openai-completions",
+ "baseUrl": "https://ark.cn-beijing.volces.com/api/coding/v3",
+ "inputBaseUrls": [
+ "https://ark.cn-beijing.volces.com/api/coding",
+ "https://ark.cn-beijing.volces.com/api/coding/v3"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "tencentcloud-coding-plan-anthropic-messages",
+ "providerId": "tencentcloud-coding-plan",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.lkeap.cloud.tencent.com/coding/anthropic",
+ "inputBaseUrls": [
+ "https://api.lkeap.cloud.tencent.com/coding/anthropic",
+ "https://api.lkeap.cloud.tencent.com/coding/v3"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "tencentcloud-coding-plan-openai-completions",
+ "providerId": "tencentcloud-coding-plan",
+ "api": "openai-completions",
+ "baseUrl": "https://api.lkeap.cloud.tencent.com/coding/v3",
+ "inputBaseUrls": [
+ "https://api.lkeap.cloud.tencent.com/coding/anthropic",
+ "https://api.lkeap.cloud.tencent.com/coding/v3"
+ ],
+ "defaultFor": [
+ "codex",
+ "pi"
+ ]
+ },
+ {
+ "id": "baseten-anthropic-messages",
+ "providerId": "baseten",
+ "api": "anthropic-messages",
+ "baseUrl": "https://inference.baseten.co",
+ "inputBaseUrls": [
+ "https://inference.baseten.co/v1",
+ "https://inference.baseten.co"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "groq-openai-responses",
+ "providerId": "groq",
+ "api": "openai-responses",
+ "baseUrl": "https://api.groq.com/openai/v1",
+ "inputBaseUrls": [
+ "https://api.groq.com/openai/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "huggingface-openai-responses",
+ "providerId": "huggingface",
+ "api": "openai-responses",
+ "baseUrl": "https://router.huggingface.co/v1",
+ "inputBaseUrls": [
+ "https://router.huggingface.co/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "fireworks-anthropic-messages",
+ "providerId": "fireworks",
+ "api": "anthropic-messages",
+ "baseUrl": "https://api.fireworks.ai/inference",
+ "inputBaseUrls": [
+ "https://api.fireworks.ai/inference",
+ "https://api.fireworks.ai/inference/v1"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "fireworks-openai-responses",
+ "providerId": "fireworks",
+ "api": "openai-responses",
+ "baseUrl": "https://api.fireworks.ai/inference/v1",
+ "inputBaseUrls": [
+ "https://api.fireworks.ai/inference",
+ "https://api.fireworks.ai/inference/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "lmstudio-openai-responses",
+ "providerId": "lmstudio",
+ "api": "openai-responses",
+ "baseUrl": "http://127.0.0.1:1234/v1",
+ "inputBaseUrls": [
+ "http://127.0.0.1:1234/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "litellm-anthropic-messages",
+ "providerId": "litellm",
+ "api": "anthropic-messages",
+ "baseUrl": "http://127.0.0.1:4000",
+ "inputBaseUrls": [
+ "http://127.0.0.1:4000/v1",
+ "http://127.0.0.1:4000"
+ ],
+ "defaultFor": [
+ "claude-code"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "longcat-openai-completions",
+ "providerId": "longcat",
+ "api": "openai-completions",
+ "baseUrl": "https://api.longcat.chat/openai/v1",
+ "inputBaseUrls": [
+ "https://api.longcat.chat/openai/v1"
+ ],
+ "defaultFor": [
+ "codex"
+ ]
+ },
+ {
+ "id": "opencode-openai-responses",
+ "providerId": "opencode",
+ "api": "openai-responses",
+ "baseUrl": "https://opencode.ai/zen/v1",
+ "inputBaseUrls": [
+ "https://opencode.ai/zen",
+ "https://opencode.ai/zen/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "codex",
+ "pi"
+ ],
+ "modelIds": [
+ "gpt-6-astra",
+ "gpt-5.6-sol",
+ "gpt-5.6-terra",
+ "gpt-5.6-luna",
+ "gpt-5.5",
+ "gpt-5.5-pro",
+ "gpt-5.4",
+ "gpt-5.4-pro",
+ "gpt-5.4-mini",
+ "gpt-5.4-nano",
+ "gpt-5.3-codex",
+ "gpt-5.3-codex-spark",
+ "gpt-5.2",
+ "gpt-5.2-codex",
+ "gpt-5.1",
+ "gpt-5.1-codex",
+ "gpt-5.1-codex-max",
+ "gpt-5.1-codex-mini",
+ "gpt-5",
+ "gpt-5-codex",
+ "gpt-5-nano",
+ "grok-4.6",
+ "grok-4.5",
+ "grok-build-0.1",
+ "muse-spark-1.3",
+ "muse-spark-1.2",
+ "muse-spark-1.3-contributor-free"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "opencode-anthropic-messages",
+ "providerId": "opencode",
+ "api": "anthropic-messages",
+ "baseUrl": "https://opencode.ai/zen",
+ "inputBaseUrls": [
+ "https://opencode.ai/zen",
+ "https://opencode.ai/zen/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "codex",
+ "pi"
+ ],
+ "modelIds": [
+ "claude-fable-5-1",
+ "claude-fable-5",
+ "claude-opus-5",
+ "claude-opus-4-8",
+ "claude-opus-4-7",
+ "claude-opus-4-6",
+ "claude-opus-4-5",
+ "claude-sonnet-5",
+ "claude-sonnet-4-6",
+ "claude-sonnet-4-5",
+ "claude-haiku-4-5",
+ "qwen3.7-max",
+ "qwen3.7-plus",
+ "qwen3.6-plus",
+ "qwen3.5-plus"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "opencode-google-generative-ai",
+ "providerId": "opencode",
+ "api": "google-generative-ai",
+ "baseUrl": "https://opencode.ai/zen/v1",
+ "inputBaseUrls": [
+ "https://opencode.ai/zen",
+ "https://opencode.ai/zen/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "codex",
+ "pi"
+ ],
+ "modelIds": [
+ "gemini-3.8-flash",
+ "gemini-3.7-flash",
+ "gemini-3.6-flash",
+ "gemini-3.5-flash",
+ "gemini-3.5-flash-lite",
+ "gemini-3.1-pro",
+ "gemini-3-flash"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "opencode-openai-completions",
+ "providerId": "opencode",
+ "api": "openai-completions",
+ "baseUrl": "https://opencode.ai/zen/v1",
+ "inputBaseUrls": [
+ "https://opencode.ai/zen",
+ "https://opencode.ai/zen/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "codex",
+ "pi"
+ ],
+ "modelIds": [
+ "deepseek-v4-pro",
+ "deepseek-v4-flash",
+ "deepseek-v4-flash-vision-exp",
+ "minimax-m3",
+ "minimax-m2.7",
+ "minimax-m2.5",
+ "glm-5.3-flash",
+ "glm-5.3",
+ "glm-5.2",
+ "glm-5.1",
+ "glm-5",
+ "kimi-k2.5",
+ "kimi-k2.6",
+ "kimi-k2.7-code",
+ "kimi-k3",
+ "big-pickle",
+ "mimo-v2.5-free",
+ "ling-3.0-flash-fin-free",
+ "nemotron-3-ultra-free",
+ "nemotron-3.5-lightning-free"
+ ]
+ },
+ {
+ "id": "opencode-go-openai-responses",
+ "providerId": "opencode-go",
+ "api": "openai-responses",
+ "baseUrl": "https://opencode.ai/zen/go/v1",
+ "inputBaseUrls": [
+ "https://opencode.ai/zen/go",
+ "https://opencode.ai/zen/go/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "codex",
+ "pi"
+ ],
+ "modelIds": [
+ "grok-4.6",
+ "gpt-5.6-luna",
+ "muse-spark-1.3-contributor",
+ "muse-spark-1.2-contributor"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "opencode-go-openai-completions",
+ "providerId": "opencode-go",
+ "api": "openai-completions",
+ "baseUrl": "https://opencode.ai/zen/go/v1",
+ "inputBaseUrls": [
+ "https://opencode.ai/zen/go",
+ "https://opencode.ai/zen/go/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "codex",
+ "pi"
+ ],
+ "modelIds": [
+ "glm-5.3-flash",
+ "glm-5.3",
+ "glm-5.2",
+ "glm-5.1",
+ "kimi-k3",
+ "kimi-k2.7-code",
+ "kimi-k2.6",
+ "longcat-2.0",
+ "deepseek-v4-pro",
+ "deepseek-v4-flash",
+ "deepseek-v4-flash-vision-exp",
+ "mimo-v2.5",
+ "mimo-v2.5-pro",
+ "mimo-v2.6-pro",
+ "mimo-v2.6-flash",
+ "hy4-preview",
+ "hy3",
+ "omen-alpha"
+ ]
+ },
+ {
+ "id": "opencode-go-anthropic-messages",
+ "providerId": "opencode-go",
+ "api": "anthropic-messages",
+ "baseUrl": "https://opencode.ai/zen/go",
+ "inputBaseUrls": [
+ "https://opencode.ai/zen/go",
+ "https://opencode.ai/zen/go/v1"
+ ],
+ "defaultFor": [
+ "claude-code",
+ "codex",
+ "pi"
+ ],
+ "modelIds": [
+ "minimax-m3",
+ "minimax-m2.7",
+ "minimax-m2.5",
+ "qwen3.8-max",
+ "qwen3.8-flash",
+ "qwen3.7-max",
+ "qwen3.7-plus",
+ "qwen3.6-plus"
+ ],
+ "legacyApis": [
+ "openai-completions"
+ ]
+ },
+ {
+ "id": "moonshot-kimi-code-openai-responses",
+ "providerId": "moonshot-kimi-code",
+ "api": "openai-responses",
+ "baseUrl": "https://api.kimi.com/coding/v1",
+ "inputBaseUrls": [
+ "https://api.kimi.com/coding",
+ "https://api.kimi.com/coding/v1"
+ ],
+ "defaultFor": [],
+ "defaults": {
+ "modalities": {
+ "input": [
+ "text",
+ "image"
+ ],
+ "output": [
+ "text"
+ ]
+ },
+ "supportsImageInput": true,
+ "supportsToolCalls": true
+ }
+ }
]
}
diff --git a/packages/model-providers/catalog/provider-interface-models.json b/packages/model-providers/catalog/provider-interface-models.json
deleted file mode 100644
index b2c315a470..0000000000
--- a/packages/model-providers/catalog/provider-interface-models.json
+++ /dev/null
@@ -1,410 +0,0 @@
-{
- "opencode": {
- "source": "https://opencode.ai/docs/zen/",
- "checked": "2026-09-13",
- "models": {
- "gpt-6-astra": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.6-sol": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.6-terra": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.6-luna": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.5": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.5-pro": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.4": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.4-pro": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.4-mini": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.4-nano": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.3-codex": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.3-codex-spark": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.2": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.2-codex": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.1": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.1-codex": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.1-codex-max": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5.1-codex-mini": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5-codex": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "gpt-5-nano": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "claude-fable-5-1": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-fable-5": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-opus-5": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-opus-4-8": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-opus-4-7": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-opus-4-6": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-opus-4-5": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-sonnet-5": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-sonnet-4-6": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-sonnet-4-5": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "claude-haiku-4-5": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "gemini-3.8-flash": {
- "api": "google-generative-ai",
- "endpoint": "https://opencode.ai/zen/v1/models/gemini-3.8-flash"
- },
- "gemini-3.7-flash": {
- "api": "google-generative-ai",
- "endpoint": "https://opencode.ai/zen/v1/models/gemini-3.7-flash"
- },
- "gemini-3.6-flash": {
- "api": "google-generative-ai",
- "endpoint": "https://opencode.ai/zen/v1/models/gemini-3.6-flash"
- },
- "gemini-3.5-flash": {
- "api": "google-generative-ai",
- "endpoint": "https://opencode.ai/zen/v1/models/gemini-3.5-flash"
- },
- "gemini-3.5-flash-lite": {
- "api": "google-generative-ai",
- "endpoint": "https://opencode.ai/zen/v1/models/gemini-3.5-flash-lite"
- },
- "gemini-3.1-pro": {
- "api": "google-generative-ai",
- "endpoint": "https://opencode.ai/zen/v1/models/gemini-3.1-pro"
- },
- "gemini-3-flash": {
- "api": "google-generative-ai",
- "endpoint": "https://opencode.ai/zen/v1/models/gemini-3-flash"
- },
- "grok-4.6": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "grok-4.5": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "grok-build-0.1": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "muse-spark-1.3": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "muse-spark-1.2": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- },
- "qwen3.7-max": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "qwen3.7-plus": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "qwen3.6-plus": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "qwen3.5-plus": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/v1/messages"
- },
- "deepseek-v4-pro": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "deepseek-v4-flash": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "deepseek-v4-flash-vision-exp": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "minimax-m3": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "minimax-m2.7": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "minimax-m2.5": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "glm-5.3-flash": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "glm-5.3": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "glm-5.2": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "glm-5.1": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "glm-5": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "kimi-k2.5": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "kimi-k2.6": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "kimi-k2.7-code": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "kimi-k3": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "big-pickle": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "mimo-v2.5-free": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "ling-3.0-flash-fin-free": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "nemotron-3-ultra-free": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "nemotron-3.5-lightning-free": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/v1/chat/completions"
- },
- "muse-spark-1.3-contributor-free": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/v1/responses"
- }
- }
- },
- "opencode-go": {
- "source": "https://opencode.ai/docs/go/",
- "checked": "2026-09-13",
- "models": {
- "grok-4.6": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/go/v1/responses"
- },
- "gpt-5.6-luna": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/go/v1/responses"
- },
- "glm-5.3-flash": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "glm-5.3": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "glm-5.2": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "glm-5.1": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "kimi-k3": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "kimi-k2.7-code": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "kimi-k2.6": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "longcat-2.0": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "deepseek-v4-pro": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "deepseek-v4-flash": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "deepseek-v4-flash-vision-exp": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "mimo-v2.5": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "mimo-v2.5-pro": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "mimo-v2.6-pro": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "mimo-v2.6-flash": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "minimax-m3": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/go/v1/messages"
- },
- "minimax-m2.7": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/go/v1/messages"
- },
- "minimax-m2.5": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/go/v1/messages"
- },
- "muse-spark-1.3-contributor": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/go/v1/responses"
- },
- "muse-spark-1.2-contributor": {
- "api": "openai-responses",
- "endpoint": "https://opencode.ai/zen/go/v1/responses"
- },
- "qwen3.8-max": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/go/v1/messages"
- },
- "qwen3.8-flash": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/go/v1/messages"
- },
- "qwen3.7-max": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/go/v1/messages"
- },
- "qwen3.7-plus": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/go/v1/messages"
- },
- "qwen3.6-plus": {
- "api": "anthropic-messages",
- "endpoint": "https://opencode.ai/zen/go/v1/messages"
- },
- "hy4-preview": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "hy3": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- },
- "omen-alpha": {
- "api": "openai-completions",
- "endpoint": "https://opencode.ai/zen/go/v1/chat/completions"
- }
- }
- }
-}
diff --git a/packages/model-providers/scripts/sync-registry.mjs b/packages/model-providers/scripts/sync-registry.mjs
new file mode 100644
index 0000000000..f130802902
--- /dev/null
+++ b/packages/model-providers/scripts/sync-registry.mjs
@@ -0,0 +1,25 @@
+/** Copy the Server-generated registry atomically as data; never merge membership.
+ * Usage: node packages/model-providers/scripts/sync-registry.mjs /path/to/providers.json
+ */
+import { readFile, writeFile, rename } from 'node:fs/promises';
+const source = process.argv[2];
+if (!source) throw new Error('Pass the Server-generated providers.json path');
+const target = new URL('../catalog/model-registry.json', import.meta.url);
+const incoming = JSON.parse(await readFile(source, 'utf8')).modelRegistry;
+if (!incoming || incoming.schemaVersion !== 6 || !Array.isArray(incoming.interfaceProfiles)) {
+ throw new Error('Expected a complete V6 registry');
+}
+// Presentation order only: every value, deletion and array order comes from Server.
+function ordered(old, next) {
+ if (Array.isArray(next)) return next.map((item, index) => ordered(
+ Array.isArray(old) ? old.find(v => (item?.id && v?.id === item.id) ||
+ (item?.modelId && v?.modelId === item.modelId && v?.providerId === item.providerId)) ?? old[index] : undefined, item));
+ if (next && typeof next === 'object') return Object.fromEntries(
+ [...new Set([...Object.keys(old ?? {}), ...Object.keys(next)])].filter(key => key in next)
+ .map(key => [key, ordered(old?.[key], next[key])]),
+ );
+ return next;
+}
+const temporary = new URL(`../catalog/model-registry.${process.pid}.tmp`, import.meta.url);
+await writeFile(temporary, `${JSON.stringify(ordered(JSON.parse(await readFile(target, 'utf8')), incoming), null, 2)}\n`);
+await rename(temporary, target);
diff --git a/packages/model-providers/src/__tests__/modelAccessValidator.test.ts b/packages/model-providers/src/__tests__/modelAccessValidator.test.ts
index 773f64cbf7..dc0f440c7c 100644
--- a/packages/model-providers/src/__tests__/modelAccessValidator.test.ts
+++ b/packages/model-providers/src/__tests__/modelAccessValidator.test.ts
@@ -1215,3 +1215,28 @@ describe('V5 display pricing extension', () => {
expect(parseListModelsResponse({ ...VALID_V4_RESPONSE, models: [{ ...VALID_V4_RESPONSE.models[0], displayPricing }] }).ok).toBe(false);
});
});
+
+// Tier: unit. Reject an entire malformed V6 snapshot before cache/route activation.
+describe('V6 interface contract', () => {
+ const registry = (): ModelRegistry => ({ schemaVersion: 6, updatedAt: '2099-01-01T00:00:00.000Z',
+ interfaceProfiles: [{ id: 'messages', providerId: 'vendor', api: 'anthropic-messages',
+ baseUrl: 'https://vendor.example/messages', inputBaseUrls: ['https://vendor.example/v1'] }],
+ models: [{ id: 'model', name: 'Model', nativeApis: ['anthropic-messages', 'openai-responses'],
+ routes: [{ providerId: 'vendor', modelId: 'model', agents: ['codex'],
+ interfaces: [{ profileId: 'messages' }], preferredInterfaces: { codex: ['messages'] } }] }],
+ });
+ it.each([
+ (value: ModelRegistry) => { value.interfaceProfiles![0].baseUrl = 'https://other.example'; },
+ (value: ModelRegistry) => { value.interfaceProfiles![0].requestPath = '/%2e%2e/private'; },
+ (value: ModelRegistry) => { value.interfaceProfiles!.push(value.interfaceProfiles![0]); },
+ (value: ModelRegistry) => { value.models[0].routes[0].interfaces![0].profileId = 'missing'; },
+ (value: ModelRegistry) => { value.models[0].routes[0].preferredInterfaces!.codex = ['missing']; },
+ ])('rejects malformed references or credential scope', mutate => {
+ const value = registry(); mutate(value);
+ expect(parseModelRegistry(value).ok).toBe(false);
+ });
+ it('retains unknown required capabilities as data for execution-time exclusion', () => {
+ const value = registry(); value.interfaceProfiles![0].requires = ['future-runtime-v99'];
+ expect(parseModelRegistry(value)).toEqual({ ok: true, value });
+ });
+});
diff --git a/packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts b/packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts
index c6bbbc28fd..49337980e0 100644
--- a/packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts
+++ b/packages/model-providers/src/__tests__/providerInterfaceRoutes.test.ts
@@ -131,3 +131,43 @@ it('keeps a preset API reference with a declared custom request path', () => {
expect(provider.models.codex![0].userModelConfig).toEqual(raw.runtimes.codex.models[0]);
expect(provider.routing.codex!.requestPath).toBe('/tenant/infer');
});
+
+// Tier: unit. Production import/projection must follow a new directory revision
+// without materializing automatic choices into saved API overrides.
+describe('V6 remote interface bindings', () => {
+ function connection(model: Record<string, unknown> = {}) {
+ return { id: 'kimi-v6', name: 'Kimi', runtimes: { codex: {
+ catalogPresetId: 'moonshot-kimi-code', baseUrl: 'https://api.kimi.com/coding/v1',
+ wireProtocol: 'openai-chat' as const, models: [{ id: 'k3.1-pro', name: 'K3.1', ...model }],
+ } } };
+ }
+ it('follows new defaults, keeps explicit selections and preserves the Coding limit', () => {
+ const registry = structuredClone(BUNDLED_CATALOG.modelRegistry!);
+ const options = { modelRegistry: registry, presets: BUNDLED_CATALOG.presets };
+ const automatic = buildUserProvider(connection(), options).models.codex![0];
+ expect(automatic).toMatchObject({ api: 'openai-responses', contextWindow: 262144, maxOutput: 262144 });
+ expect(automatic.availableInterfaces).toHaveLength(3);
+ expect(automatic.userModelConfig).not.toHaveProperty('api');
+ const route = registry.models.flatMap(e => e.routes).find(r => r.providerId === 'moonshot-kimi-code' && r.modelId === 'k3.1-pro')!;
+ route.preferredInterfaces!.codex = ['moonshot-kimi-code-anthropic-messages'];
+ expect(buildUserProvider(connection(), options).models.codex![0].api).toBe('anthropic-messages');
+ expect(buildUserProvider(connection({ interfaceId: 'moonshot-kimi-code-openai-completions' }), options).models.codex![0].api).toBe('openai-completions');
+ expect(buildUserProvider(connection({ route: { baseUrl: 'https://api.kimi.com/coding/v1', wireProtocol: 'openai-chat' } }), options).models.codex![0].api).toBe('openai-completions');
+ expect(buildUserProvider(connection({ api: 'openai-completions', contextWindow: 64000 }), options).models.codex![0])
+ .toMatchObject({ api: 'openai-completions', contextWindow: 64000 });
+ });
+ it('excludes unknown required behavior and keeps another supported binding', () => {
+ const registry = structuredClone(BUNDLED_CATALOG.modelRegistry!);
+ registry.interfaceProfiles!.find(p => p.id === 'moonshot-kimi-code-openai-responses')!.requires = ['future-adapter-v99'];
+ const model = buildUserProvider(connection(), { modelRegistry: registry, presets: BUNDLED_CATALOG.presets }).models.codex![0];
+ expect(model.api).toBe('openai-completions');
+ expect(model.availableInterfaces?.some(p => p.api === 'openai-responses')).toBe(false);
+ });
+ it('does not redirect a custom endpoint or request path using an official profile', () => {
+ const input = connection();
+ input.runtimes.codex.baseUrl = 'https://my-relay.example/coding/v1';
+ expect(buildUserProvider(input, { modelRegistry: BUNDLED_CATALOG.modelRegistry }).models.codex![0].selectedInterface).toBeUndefined();
+ const custom = connection({ route: { baseUrl: 'https://api.kimi.com/coding/v1', wireProtocol: 'openai-chat', requestPath: '/private/chat' } });
+ expect(buildUserProvider(custom).models.codex![0].route?.requestPath).toBe('/private/chat');
+ });
+});
diff --git a/packages/model-providers/src/__tests__/providerNativeDefaults.test.ts b/packages/model-providers/src/__tests__/providerNativeDefaults.test.ts
index af5a9373ba..148d43dfe0 100644
--- a/packages/model-providers/src/__tests__/providerNativeDefaults.test.ts
+++ b/packages/model-providers/src/__tests__/providerNativeDefaults.test.ts
@@ -156,7 +156,7 @@ describe('supplier import follows Gateway native model defaults', () => {
if (agent === 'pi') expect(model.defaultEnabled, message).toBe(true);
else if (model.defaultEnabled) {
const api = agent === 'claude-code' ? 'anthropic-messages' : 'openai-responses';
- expect(model.nativeApi, message).toBe(api);
+ expect(model.nativeApis ?? [model.nativeApi], message).toContain(api);
expect([api, ...(agent === 'codex' ? ['azure-openai-responses'] : [])], message).toContain(model.api);
}
}
diff --git a/packages/model-providers/src/__tests__/source-registry.test.ts b/packages/model-providers/src/__tests__/source-registry.test.ts
index 937431c629..f0c7124ef0 100644
--- a/packages/model-providers/src/__tests__/source-registry.test.ts
+++ b/packages/model-providers/src/__tests__/source-registry.test.ts
@@ -116,7 +116,7 @@ describe("resolveCatalogUrl", () => {
region: "cn",
registryMedia: "1",
registryLocalRuntimes: "1",
- registrySchemaVersion: "5",
+ registrySchemaVersion: "6",
});
});
@@ -125,7 +125,7 @@ describe("resolveCatalogUrl", () => {
const readCache = vi.fn().mockResolvedValue(null);
const writeCache = vi.fn();
await loadCatalog(cfg, {
- fetchText: vi.fn().mockResolvedValue(JSON.stringify(MINIMAL)),
+ fetchText: vi.fn().mockResolvedValue(JSON.stringify({ ...MINIMAL, modelRegistry: BUNDLED_CATALOG.modelRegistry })),
readCache,
writeCache,
});
@@ -135,7 +135,7 @@ describe("resolveCatalogUrl", () => {
expect.any(String),
);
expect(readCache).not.toHaveBeenCalledWith(
- "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=5",
+ "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=6",
);
});
it("prefers explicit url", () => {
@@ -147,7 +147,7 @@ describe("resolveCatalogUrl", () => {
expect(
resolveCatalogUrl({ baseUrl: "https://model-access.example.com/" }),
).toBe(
- "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=5&registryMedia=1&registryLocalRuntimes=1",
+ "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=6&registryMedia=1&registryLocalRuntimes=1",
);
});
it("builds the migration OSS fallback URL", () => {
@@ -1074,7 +1074,7 @@ describe("loadCatalog", () => {
);
expect(fetchText).toHaveBeenNthCalledWith(
1,
- "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=5&registryMedia=1&registryLocalRuntimes=1",
+ "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=6&registryMedia=1&registryLocalRuntimes=1",
15_000,
);
expect(fetchText).toHaveBeenNthCalledWith(
@@ -1134,7 +1134,7 @@ describe("loadCatalog", () => {
);
expect(fetchText).toHaveBeenNthCalledWith(
1,
- "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=5&registryMedia=1&registryLocalRuntimes=1",
+ "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=6&registryMedia=1&registryLocalRuntimes=1",
15_000,
);
expect(fetchText).toHaveBeenNthCalledWith(
@@ -1192,7 +1192,7 @@ describe("loadCatalog", () => {
);
expect(fetchText).toHaveBeenNthCalledWith(
1,
- "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=5&registryMedia=1&registryLocalRuntimes=1",
+ "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=6&registryMedia=1&registryLocalRuntimes=1",
15_000,
);
expect(fetchText).toHaveBeenNthCalledWith(
@@ -1221,7 +1221,7 @@ describe("loadCatalog", () => {
);
expect(fetchText).toHaveBeenCalledTimes(1);
expect(fetchText).toHaveBeenCalledWith(
- "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=5&registryMedia=1&registryLocalRuntimes=1",
+ "https://model-access.example.com/api/model-catalog/catalog?registrySchemaVersion=6&registryMedia=1&registryLocalRuntimes=1",
15_000,
);
expect(cat.version).toBe(BUNDLED_CATALOG.version);
@@ -1741,3 +1741,35 @@ describe("server-delivered local models", () => {
);
});
});
+
+// Tier: integration. Same loader instance/unchanged code accepts data-only updates;
+// schema negotiation uses one deadline and never blends two profile revisions.
+describe('V6 negotiation', () => {
+ it('retries a frozen unknown-version response as V5 once and caches the actual variant', async () => {
+ const old = { ...MINIMAL, modelRegistry: { schemaVersion: 5, updatedAt: '2099-01-01T00:00:00.000Z', models: [] } };
+ let clock = 0;
+ const fetchText = vi.fn(async (url: string) => { clock += 7; return JSON.stringify(url.includes('Version=6') ? MINIMAL : old); });
+ const writeCache = vi.fn(async () => {});
+ const result = await loadCatalogWithSource({ baseUrl: 'https://models.example', now: () => clock, remoteBudgetMs: 100 }, { fetchText, writeCache });
+ expect(fetchText).toHaveBeenCalledTimes(2);
+ expect(fetchText).toHaveBeenNthCalledWith(2, expect.stringContaining('registrySchemaVersion=5'), 93);
+ expect(result.catalog.modelRegistry?.schemaVersion).toBe(5);
+ expect(writeCache).toHaveBeenCalledWith(expect.stringContaining('registrySchemaVersion=5'), expect.any(String));
+ });
+});
+
+it('keeps the accepted complete V6 snapshot when an old server answers with its V5 projection', async () => {
+ const { projectRegistryV5 } = await import('../modelInterfaceContract.js');
+ const current = { ...MINIMAL, modelRegistry: structuredClone(BUNDLED_CATALOG.modelRegistry!) };
+ current.modelRegistry.updatedAt = '2099-01-01T00:00:00.000Z';
+ const legacy = { ...current, modelRegistry: projectRegistryV5(current.modelRegistry) };
+ const writeCache = vi.fn(async () => {});
+ const result = await loadCatalogWithSource({ baseUrl: 'https://models.example' }, {
+ fetchText: async () => JSON.stringify(legacy),
+ readCache: async url => url.includes('Version=6') ? JSON.stringify(current) : null,
+ writeCache,
+ });
+ expect(result.catalog.modelRegistry).toEqual(current.modelRegistry);
+ expect(result.capabilityEvidence).toBe('fallback');
+ expect(writeCache).toHaveBeenCalledWith(expect.stringContaining('Version=6'), expect.any(String));
+});
diff --git a/packages/model-providers/src/index.ts b/packages/model-providers/src/index.ts
index 4a4dff7bb6..e463992388 100644
--- a/packages/model-providers/src/index.ts
+++ b/packages/model-providers/src/index.ts
@@ -26,6 +26,7 @@ export type {
export type {
AgentKind,
+ ModelInterfaceSnapshot,
ProviderWireProtocol,
CodexCompatibilityWireProtocol,
Effort,
@@ -337,3 +338,5 @@ export { providerSetupLink } from './providerSetupLinks.js';
export { providerPresetOAuth, providerPresetOAuthRuntimes, providerOAuthContract } from './providerPresetOAuth.js';
export { alignModelApiRoute, providerWireProtocolForApi, providerBaseUrlForApi } from "./providerInterfaceRoutes.js";
+
+export { availableModelInterfaces, modelWithInterface, MODEL_INTERFACE_CAPABILITIES } from './providerInterfaceRoutes.js';
diff --git a/packages/model-providers/src/modelAccessBean.ts b/packages/model-providers/src/modelAccessBean.ts
index 4f7966521f..614a0b5e57 100644
--- a/packages/model-providers/src/modelAccessBean.ts
+++ b/packages/model-providers/src/modelAccessBean.ts
@@ -58,6 +58,7 @@ export const MODEL_REGISTRY_SCHEMA_VERSION = 2 as const;
export const MODEL_REGISTRY_V3_SCHEMA_VERSION = 3 as const;
export const MODEL_REGISTRY_V4_SCHEMA_VERSION = 4 as const;
export const MODEL_REGISTRY_V5_SCHEMA_VERSION = 5 as const;
+export const MODEL_REGISTRY_V6_SCHEMA_VERSION = 6 as const;
export const MODEL_NATIVE_APIS = [
"anthropic-messages",
"openai-responses",
@@ -115,7 +116,35 @@ export interface ModelReferencePriceGroup {
prices: ModelReferencePrice[];
}
+/** V6 product-scoped transport. No credentials or executable transforms. */
+export interface ModelInterfaceProfile {
+ id: string;
+ providerId: string;
+ api: string;
+ baseUrl: string;
+ inputBaseUrls: string[];
+ /** Proven legacy generated APIs repaired to the declared preferred interface. */
+ legacyApis?: string[];
+ requestPath?: string;
+ /** Absent: every member; present: exact wire IDs only. */
+ modelIds?: string[];
+ defaultFor?: ModelAgent[];
+ defaults?: ModelMetadata;
+ compatibility?: string[];
+ requires?: string[];
+ retired?: boolean;
+}
+export interface ModelInterfaceBinding {
+ profileId: string;
+ wireModelId?: string;
+ defaults?: ModelMetadata;
+ compatibility?: string[];
+ requires?: string[];
+ retired?: boolean;
+}
export interface ModelRegistryRoute {
+ interfaces?: ModelInterfaceBinding[];
+ preferredInterfaces?: Partial<Record<ModelAgent, string[]>>;
/** V5: explicitly selects a tariff on the entry's public model. */
referencePriceGroup?: string;
defaults?: ModelMetadata;
@@ -178,6 +207,8 @@ export interface ModelRegistryEntry
newSessionDefault?: ModelAccessV2Agent[];
/** V3: model's canonical API, independent of any harness. Null explicitly means unverified. */
nativeApi?: ModelNativeApi | null;
+ /** V6: independent manufacturer declarations, never derived from interfaces. */
+ nativeApis?: ModelNativeApi[] | null;
}
export interface ModelNativeApiRule {
@@ -196,7 +227,9 @@ export interface ModelRegistry extends ModelRegistryBase {
| typeof MODEL_REGISTRY_SCHEMA_VERSION
| typeof MODEL_REGISTRY_V3_SCHEMA_VERSION
| typeof MODEL_REGISTRY_V4_SCHEMA_VERSION
- | typeof MODEL_REGISTRY_V5_SCHEMA_VERSION;
+ | typeof MODEL_REGISTRY_V5_SCHEMA_VERSION
+ | typeof MODEL_REGISTRY_V6_SCHEMA_VERSION;
+ interfaceProfiles?: ModelInterfaceProfile[];
baseModels?: BaseModel[];
localModels?: LocalModelCatalog;
models: ModelRegistryEntry[];
diff --git a/packages/model-providers/src/modelAccessValidator.ts b/packages/model-providers/src/modelAccessValidator.ts
index 8f1a084623..f40382bb22 100644
--- a/packages/model-providers/src/modelAccessValidator.ts
+++ b/packages/model-providers/src/modelAccessValidator.ts
@@ -1,3 +1,4 @@
+import { modelInterfacesError } from './modelInterfaceContract.js';
import { parseModelDisplayPricing } from './modelDisplayPricing.js';
import {
validModelMetadata,
@@ -22,6 +23,7 @@ import {
MODEL_REGISTRY_V3_SCHEMA_VERSION,
MODEL_REGISTRY_V4_SCHEMA_VERSION,
MODEL_REGISTRY_V5_SCHEMA_VERSION,
+ MODEL_REGISTRY_V6_SCHEMA_VERSION,
MODEL_NATIVE_APIS,
MODEL_REGISTRY_STATUSES,
type ListModelsResponse,
@@ -1022,6 +1024,7 @@ function registryRouteError(
? [
...MODEL_REGISTRY_ROUTE_FIELDS,
...(schemaVersion >= 5 ? ["referencePriceGroup"] : []),
+ ...(schemaVersion >= 6 ? ["interfaces", "preferredInterfaces"] : []),
"defaults",
"forceOverrides",
"overrideReason",
@@ -1108,6 +1111,7 @@ function registryEntryError(
? [
...MODEL_REGISTRY_ENTRY_V2_FIELDS,
"nativeApi",
+ ...(schemaVersion >= 6 ? ["nativeApis"] : []),
...(schemaVersion >= 4
? [
"modelRef",
@@ -1279,12 +1283,13 @@ export function parseModelRegistry(
const unknownField = unknownFieldError(
value,
value.schemaVersion === MODEL_REGISTRY_V4_SCHEMA_VERSION ||
- value.schemaVersion === MODEL_REGISTRY_V5_SCHEMA_VERSION
+ (value.schemaVersion === MODEL_REGISTRY_V5_SCHEMA_VERSION || value.schemaVersion === MODEL_REGISTRY_V6_SCHEMA_VERSION)
? [
...MODEL_REGISTRY_FIELDS,
"nativeApiRules",
"localModels",
"baseModels",
+ ...(value.schemaVersion === 6 ? ["interfaceProfiles"] : []),
]
: value.schemaVersion === MODEL_REGISTRY_V3_SCHEMA_VERSION
? [...MODEL_REGISTRY_FIELDS, "nativeApiRules"]
@@ -1297,10 +1302,13 @@ export function parseModelRegistry(
value.schemaVersion !== MODEL_REGISTRY_SCHEMA_VERSION &&
value.schemaVersion !== MODEL_REGISTRY_V3_SCHEMA_VERSION &&
value.schemaVersion !== MODEL_REGISTRY_V4_SCHEMA_VERSION &&
- value.schemaVersion !== MODEL_REGISTRY_V5_SCHEMA_VERSION
+ value.schemaVersion !== MODEL_REGISTRY_V5_SCHEMA_VERSION &&
+ value.schemaVersion !== MODEL_REGISTRY_V6_SCHEMA_VERSION
) {
- return fail("modelRegistry.schemaVersion must be 1, 2, 3, 4 or 5");
+ return fail("modelRegistry.schemaVersion must be 1, 2, 3, 4, 5 or 6");
}
+ const interfacesError = modelInterfacesError(value);
+ if (interfacesError) return fail(interfacesError);
if (!isIsoTimestamp(value.updatedAt)) {
return fail("modelRegistry.updatedAt must be an ISO timestamp");
}
diff --git a/packages/model-providers/src/modelInterfaceContract.ts b/packages/model-providers/src/modelInterfaceContract.ts
new file mode 100644
index 0000000000..8e24370049
--- /dev/null
+++ b/packages/model-providers/src/modelInterfaceContract.ts
@@ -0,0 +1,82 @@
+import { MODEL_NATIVE_APIS } from './modelAccessBean.js';
+import type { ModelRegistry } from './modelAccessBean.js';
+import { validModelMetadata } from './modelMetadataLayers.js';
+
+const object = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v);
+const text = (v: unknown): v is string => typeof v === 'string' && v.length > 0 && v.length <= 2048;
+const strings = (v: unknown): v is string[] => Array.isArray(v) && v.length <= 4096 && v.every(text) && new Set(v).size === v.length;
+const agents = ['claude-code', 'codex', 'pi'];
+function requestPath(value: unknown): boolean {
+ if (!text(value) || !/^\/[A-Za-z0-9\-._~%!$&()*+,;=:@/]*$/.test(value) || value.startsWith('//') ||
+ /%(?![0-9A-Fa-f]{2})/.test(value) || /%(?:2f|5c)/i.test(value)) return false;
+ return !value.split('/').some(segment => ['.', '..'].includes(segment.replace(/%2e/gi, '.')));
+}
+function endpoint(v: unknown): URL | undefined {
+ if (!text(v)) return;
+ try {
+ const url = new URL(v);
+ if (!['http:', 'https:'].includes(url.protocol) || url.username || url.password || url.search || url.hash) return;
+ return url;
+ } catch { return; }
+}
+function bindingError(v: Record<string, unknown>): boolean {
+ return (v.defaults !== undefined && (!validModelMetadata(v.defaults) || 'contextWindowMax' in v.defaults)) ||
+ (v.requires !== undefined && !strings(v.requires)) ||
+ (v.compatibility !== undefined && !strings(v.compatibility)) ||
+ (v.retired !== undefined && typeof v.retired !== 'boolean');
+}
+
+/** Keep this wire validator mirrored in Server. Unknown APIs/requirements are
+ * valid data; execution excludes them. Broken references reject the whole snapshot. */
+export function modelInterfacesError(value: Record<string, unknown>): string | null {
+ if (value.schemaVersion !== 6) return null;
+ const profiles = value.interfaceProfiles ?? [];
+ if (!Array.isArray(profiles) || profiles.length > 4096) return 'interfaceProfiles must be an array';
+ const ids = new Map<string, Record<string, unknown>>();
+ for (const profile of profiles) {
+ if (!object(profile) || !text(profile.id) || profile.id.length > 256 || !text(profile.providerId) || !text(profile.api) ||
+ !strings(profile.inputBaseUrls) || !profile.inputBaseUrls.length || bindingError(profile)) return 'invalid interface profile';
+ const url = endpoint(profile.baseUrl);
+ if (!url || profile.inputBaseUrls.some(input => endpoint(input)?.origin !== url.origin)) return 'interface profile crosses credential origin';
+ if (profile.requestPath !== undefined && !requestPath(profile.requestPath)) return 'invalid interface requestPath';
+ if (profile.legacyApis !== undefined && !strings(profile.legacyApis)) return 'invalid legacyApis';
+ if (profile.modelIds !== undefined && !strings(profile.modelIds)) return 'invalid interface modelIds';
+ if (profile.defaultFor !== undefined && (!strings(profile.defaultFor) || profile.defaultFor.some(a => !agents.includes(a)))) return 'invalid interface defaultFor';
+ if (ids.has(profile.id)) return 'duplicate interface profile';
+ ids.set(profile.id, profile);
+ }
+ for (const entry of (Array.isArray(value.models) ? value.models : []) as Record<string, unknown>[]) {
+ if (!object(entry)) continue; // ordinary registry validator owns entry shape
+ if (entry.nativeApis !== undefined && entry.nativeApis !== null &&
+ (!strings(entry.nativeApis) || !entry.nativeApis.length || entry.nativeApis.some(api => !(MODEL_NATIVE_APIS as readonly string[]).includes(api)))) return 'invalid nativeApis';
+ if (!Array.isArray(entry.routes)) continue;
+ for (const route of entry.routes) {
+ if (!object(route)) continue;
+ if (route.interfaces !== undefined && !Array.isArray(route.interfaces)) return 'invalid interfaces';
+ const bound = new Set<string>();
+ for (const binding of (route.interfaces ?? []) as unknown[]) {
+ if (!object(binding) || !text(binding.profileId) || bindingError(binding) ||
+ (binding.wireModelId !== undefined && !text(binding.wireModelId))) return 'invalid interface binding';
+ const profile = ids.get(binding.profileId);
+ if (!profile || profile.providerId !== route.providerId || bound.has(binding.profileId)) return 'invalid interface reference or product';
+ bound.add(binding.profileId);
+ }
+ if (route.preferredInterfaces !== undefined) {
+ if (!object(route.preferredInterfaces)) return 'invalid preferredInterfaces';
+ for (const [agent, order] of Object.entries(route.preferredInterfaces)) {
+ if (!agents.includes(agent) || !strings(order) || order.some(id => !bound.has(id))) return 'preferredInterfaces must reference bindings';
+ }
+ }
+ }
+ }
+ return null;
+}
+
+/** Exact legacy contract: no new fields, defaults or priority changes leak into V5. */
+export function projectRegistryV5(registry: ModelRegistry): ModelRegistry {
+ if (registry.schemaVersion < 6) return registry;
+ const { interfaceProfiles: _profiles, ...legacy } = registry;
+ return { ...legacy, schemaVersion: 5, models: registry.models.map(({ nativeApis: _apis, ...entry }) => ({
+ ...entry, routes: entry.routes.map(({ interfaces: _interfaces, preferredInterfaces: _preferred, ...route }) => route),
+ })) };
+}
diff --git a/packages/model-providers/src/modelMetadataLayers.ts b/packages/model-providers/src/modelMetadataLayers.ts
index ac50047a4e..3f188ecd71 100644
--- a/packages/model-providers/src/modelMetadataLayers.ts
+++ b/packages/model-providers/src/modelMetadataLayers.ts
@@ -192,6 +192,7 @@ export function resolveModelMetadata(
providerDefaults?: ModelMetadata,
declaredDefaultEffort?: ModelMetadata["defaultEffort"],
generationDefaults?: ModelMetadata,
+ interfaceDefaults?: ModelMetadata,
): ResolvedModelMetadata {
const ids = [modelId];
if (providerId === "openai" && modelId.startsWith("chatgpt/"))
@@ -246,6 +247,8 @@ export function resolveModelMetadata(
familyDefaults,
inheritedLiveWindow ? { contextWindow: live?.contextWindow } : undefined,
defaults,
+ interfaceDefaults,
+ agent && matched ? pickModelMetadata(matched.entry.perAgent?.[agent as keyof NonNullable<typeof matched.entry.perAgent>]) : undefined,
currentLive,
// A Harness's suggested default is not a model capability. Keep the shared
// model intent (including explicit route/Harness exceptions), then adapt it
@@ -261,7 +264,7 @@ export function resolveModelMetadata(
);
// Resolve the pair only after all layers: a maximum-only report is a usable
// fallback, not a verified working-window report. Never replace a known window.
- const hasOwnWorkingWindow = [defaults, currentLive, matched?.route.forceOverrides, user]
+ const hasOwnWorkingWindow = [defaults, interfaceDefaults, currentLive, matched?.route.forceOverrides, user]
.some(source => source?.contextWindow !== undefined);
if (!hasOwnWorkingWindow && currentLive?.contextWindowMax !== undefined) {
// This model's reported maximum takes precedence over a predecessor's
diff --git a/packages/model-providers/src/modelProtocol.ts b/packages/model-providers/src/modelProtocol.ts
index f88a9a6cb9..8009eb25f6 100644
--- a/packages/model-providers/src/modelProtocol.ts
+++ b/packages/model-providers/src/modelProtocol.ts
@@ -30,6 +30,9 @@ export function modelProtocolComparison(
: provider.id === 'openai' && models.codex
? 'openai-responses'
: null;
+ const declaredApis = Object.values(models).map(m => m.nativeApis).filter(v => v !== undefined);
+ const nativeApis = declaredApis.length ? declaredApis.every(v => JSON.stringify(v) === JSON.stringify(declaredApis[0]))
+ ? declaredApis[0] : null : reference ? [reference] : null;
const forAgent = (agent: AgentKind) => {
const model = models[agent];
if (!model) return null;
@@ -51,25 +54,24 @@ export function modelProtocolComparison(
agent === 'pi' ? outbound : agent === 'codex' ? 'openai-responses' : 'anthropic-messages';
const outboundProtocol = compatibilityProtocol(outbound) ?? outbound;
const harnessProtocol = compatibilityProtocol(harness) ?? harness;
- const referenceProtocol = compatibilityProtocol(reference) ?? reference;
const localConversion = Boolean(agent !== 'pi' && outboundProtocol && harnessProtocol && outboundProtocol !== harnessProtocol);
// Pi speaks the selected upstream API directly. Fixed-protocol harnesses
// also need compatibility when the supplier converts the model's native API.
// The location of that conversion never changes the default-on decision.
const compatibility =
- localConversion || Boolean(agent !== 'pi' && referenceProtocol && outboundProtocol && referenceProtocol !== outboundProtocol);
+ localConversion || Boolean(agent !== 'pi' && nativeApis?.length && outboundProtocol && !nativeApis.some(api => (compatibilityProtocol(api) ?? api) === outboundProtocol));
return {
harness,
outbound,
localConversion,
mode: compatibility
? ('compatibility' as const)
- : outbound && (reference || agent === 'pi')
+ : outbound && (nativeApis?.length || agent === 'pi')
? ('matching' as const)
: ('unknown' as const),
};
};
- return { reference, forAgent };
+ return { reference, nativeApis, forAgent };
}
/** Default-on engines use a configured protocol without harness or provider compatibility. */
diff --git a/packages/model-providers/src/modelRegistry.ts b/packages/model-providers/src/modelRegistry.ts
index af716bb302..750b651cc2 100644
--- a/packages/model-providers/src/modelRegistry.ts
+++ b/packages/model-providers/src/modelRegistry.ts
@@ -1,3 +1,4 @@
+import { projectRegistryV5 } from './modelInterfaceContract.js';
import {
registryEntryDefaults,
findBaseModel,
@@ -135,6 +136,12 @@ export function compareModelRegistryRevisions(
if (incomingRevision > currentRevision) return "newer";
const canonicalUpdatedAt = new Date(incomingRevision).toISOString();
+ // Same revision, negotiated projection upgrade. Compare the exact old contract,
+ // never waive a conflict within one schema or downgrade an accepted V6 snapshot.
+ if (incoming.schemaVersion === 6 && current.schemaVersion === 5 &&
+ modelRegistryCanonicalJson({ ...projectRegistryV5(incoming), updatedAt: canonicalUpdatedAt }) === modelRegistryCanonicalJson({ ...current, updatedAt: canonicalUpdatedAt })) return 'newer';
+ if (incoming.schemaVersion === 5 && current.schemaVersion === 6 &&
+ modelRegistryCanonicalJson({ ...incoming, updatedAt: canonicalUpdatedAt }) === modelRegistryCanonicalJson({ ...projectRegistryV5(current), updatedAt: canonicalUpdatedAt })) return 'older';
const incomingDigest = modelRegistryCanonicalJson({
...incoming,
updatedAt: canonicalUpdatedAt,
diff --git a/packages/model-providers/src/piProviderPresets.ts b/packages/model-providers/src/piProviderPresets.ts
index 019509a5f8..4676f79e63 100644
--- a/packages/model-providers/src/piProviderPresets.ts
+++ b/packages/model-providers/src/piProviderPresets.ts
@@ -109,6 +109,7 @@ export function appendPiProviderPresets(presets: readonly ProviderPreset[]): Pro
if (!runtime) return [agent, runtime];
return [agent, { ...runtime, models: runtime.models.map(originalModel => {
const model = providerInterfaceModelRoute(originalModel, agent as 'claude-code' | 'codex' | 'pi', preset.id, runtime.baseUrl, true);
+ if ('selectedInterface' in model && model.selectedInterface) return model;
if (runtime.requestPath || (model.route && 'requestPath' in model.route && model.route.requestPath)) return model;
const routeOf = (rt: typeof runtime, m: typeof model) => {
m = alignModelApiRoute(m, rt.baseUrl, rt.wireProtocol);
diff --git a/packages/model-providers/src/providerInterfaceRoutes.ts b/packages/model-providers/src/providerInterfaceRoutes.ts
index 9b51668077..2bd9daef1f 100644
--- a/packages/model-providers/src/providerInterfaceRoutes.ts
+++ b/packages/model-providers/src/providerInterfaceRoutes.ts
@@ -1,35 +1,16 @@
-import interfaceModels from '../catalog/provider-interface-models.json';
-import raw from '../catalog/providers.json';
-import { expandPresetModels } from './presetModels.js';
+import bundled from '../catalog/model-registry.json';
import { compatibilityProtocol } from '@cindy/model-compat/protocol';
-import type { AgentKind, ProviderPreset, ProviderRuntimeModelConfig, ProviderWireProtocol } from './types.js';
+import { PI_MODEL_APIS } from './types.js';
+import { applyModelMetadata, mergeModelMetadata } from './modelMetadataLayers.js';
+import type { ModelRegistry, ModelInterfaceProfile, ModelInterfaceBinding } from './modelAccessBean.js';
+import type { AgentKind, ProviderRuntimeModelConfig, ProviderWireProtocol, ModelInterfaceSnapshot, CatalogModel } from './types.js';
-// These contracts describe supplier front doors, not a model manufacturer's API.
-// Sources and limits: docs/dev-rules/provider-interface-audit.md. Never infer an
-// endpoint from a model name, a sibling hostname, or a Pi serializer alone.
-const maintained = new Set([
- 'openrouter', 'vercel-ai-gateway', 'deepseek', 'zhipu-glm-cn', 'zhipu-glm-global',
- 'moonshot-kimi-cn', 'moonshot-kimi-global', 'moonshot-kimi-code', 'minimax-cn', 'minimax-global',
- 'aliyun-bailian-coding', 'aliyun-bailian-token-plan-cn', 'aliyun-bailian-token-plan-team-cn',
- 'zhipu-coding-plan-cn', 'zai-coding-plan-global', 'xiaomi-mimo-api-cn', 'xiaomi-mimo-token-plan-cn',
- 'volcengine-agent-plan', 'volcengine-coding-plan', 'tencentcloud-coding-plan',
-]);
-const presets = (raw.presets as ProviderPreset[]).map(expandPresetModels);
-type Route = { baseUrl: string; api: 'anthropic-messages' | 'openai-responses' | 'openai-completions'; inputs: string[] };
-const overrides: Record<string, Partial<Record<AgentKind, Route>>> = {
- baseten: { 'claude-code': { baseUrl: 'https://inference.baseten.co', api: 'anthropic-messages', inputs: ['https://inference.baseten.co/v1'] } },
- groq: { codex: { baseUrl: 'https://api.groq.com/openai/v1', api: 'openai-responses', inputs: ['https://api.groq.com/openai/v1'] } },
- huggingface: { codex: { baseUrl: 'https://router.huggingface.co/v1', api: 'openai-responses', inputs: ['https://router.huggingface.co/v1'] } },
- fireworks: {
- 'claude-code': { baseUrl: 'https://api.fireworks.ai/inference', api: 'anthropic-messages', inputs: ['https://api.fireworks.ai/inference', 'https://api.fireworks.ai/inference/v1'] },
- codex: { baseUrl: 'https://api.fireworks.ai/inference/v1', api: 'openai-responses', inputs: ['https://api.fireworks.ai/inference', 'https://api.fireworks.ai/inference/v1'] },
- },
- lmstudio: { codex: { baseUrl: 'http://127.0.0.1:1234/v1', api: 'openai-responses', inputs: ['http://127.0.0.1:1234/v1'] } },
- litellm: { 'claude-code': { baseUrl: 'http://127.0.0.1:4000', api: 'anthropic-messages', inputs: ['http://127.0.0.1:4000/v1'] } },
- longcat: { codex: { baseUrl: 'https://api.longcat.chat/openai/v1', api: 'openai-completions', inputs: ['https://api.longcat.chat/openai/v1'] } },
-};
+const bundledRegistry = bundled as unknown as ModelRegistry;
const clean = (value: string) => value.replace(/\/+$/, '');
-
+/** Executable behaviors are versioned code; directory data can only select these. */
+export const MODEL_INTERFACE_CAPABILITIES = [
+ ...PI_MODEL_APIS.map(api => `api:${api}`), 'kimi-tool-ids-v1', 'chat-image-v1',
+] as const;
/** SDK adapter names and public wire languages share one projection. */
export function providerWireProtocolForApi(api: string | null | undefined): ProviderWireProtocol | undefined {
const protocol = compatibilityProtocol(api);
@@ -65,66 +46,111 @@ export function alignModelApiRoute<T extends ProviderRuntimeModelConfig>(model:
return { ...model, route: { ...model.route, baseUrl: target, wireProtocol } };
}
-export function providerInterfaceDefaultRoute(presetId: string, agent: AgentKind, baseUrl: string) {
- const route = contract(presetId, agent);
- return route && [...route.inputs, route.baseUrl].some(input => clean(input) === clean(baseUrl))
- ? { baseUrl: route.baseUrl, wireProtocol: providerWireProtocolForApi(route.api)! } : undefined;
+
+function profileMatches(profile: ModelInterfaceProfile, presetId: string, modelId: string, baseUrl: string, explicitBinding = false): boolean {
+ return profile.providerId === presetId && !profile.retired &&
+ (explicitBinding || !profile.modelIds || profile.modelIds.includes(modelId)) &&
+ [...profile.inputBaseUrls, profile.baseUrl].some(input => clean(input) === clean(baseUrl));
+}
+
+/** Enumerate this product's transports only. Does not add account members, change
+ * auth strategy or copy credentials. Unknown required behaviors exclude one binding. */
+export function availableModelInterfaces(
+ registry: ModelRegistry | undefined, presetId: string, modelId: string,
+ baseUrl: string, agent: AgentKind, capabilities: readonly string[] = MODEL_INTERFACE_CAPABILITIES,
+): ModelInterfaceSnapshot[] {
+ if (!registry || registry.schemaVersion < 6) return [];
+ const matches = registry.models.flatMap(entry => entry.routes
+ .filter(route => route.providerId === presetId && route.modelId === modelId)
+ .map(route => ({ entry, route })));
+ if (matches.some(({entry}) => entry.status === 'retired') || matches.length > 1) return [];
+ const match = matches[0];
+ const profiles = registry.interfaceProfiles ?? [];
+ const bindings: ModelInterfaceBinding[] = match?.route.interfaces ?? profiles
+ .filter(profile => profileMatches(profile, presetId, modelId, baseUrl))
+ .map(profile => ({ profileId: profile.id }));
+ const order = match?.route.preferredInterfaces?.[agent];
+ const candidates = bindings.flatMap(binding => {
+ const profile = profiles.find(p => p.id === binding.profileId);
+ if (!profile || binding.retired || !profileMatches(profile, presetId, modelId, baseUrl, !!match?.route.interfaces) ||
+ !PI_MODEL_APIS.some(api => api === profile.api)) return [];
+ const required = [`api:${profile.api}`, ...(profile.requires ?? []), ...(binding.requires ?? []),
+ ...(binding.compatibility ?? profile.compatibility ?? [])];
+ if (required.some(capability => !capabilities.includes(capability))) return [];
+ return [{ profileId: profile.id, providerId: presetId, revision: registry.updatedAt,
+ api: profile.api as NonNullable<ProviderRuntimeModelConfig['api']>,
+ wireModelId: binding.wireModelId ?? modelId,
+ route: { baseUrl: profile.baseUrl, wireProtocol: providerWireProtocolForApi(profile.api)!,
+ ...(profile.requestPath ? { requestPath: profile.requestPath } : {}) },
+ defaults: mergeModelMetadata(match?.route.defaults, profile.defaults, binding.defaults),
+ compatibility: binding.compatibility ?? profile.compatibility ?? [],
+ preferred: order ? order.includes(profile.id) : !!profile.defaultFor?.includes(agent),
+ ...(match?.entry.nativeApis !== undefined ? { nativeApis: match.entry.nativeApis } : {}),
+ }];
+ });
+ return candidates.sort((a,b) => {
+ const rank = (p: ModelInterfaceSnapshot) => order?.includes(p.profileId) ? order.indexOf(p.profileId) : p.preferred ? 0 : 10000;
+ return rank(a)-rank(b);
+ });
}
-function contract(presetId: string, agent: AgentKind): Route | undefined {
- const override = overrides[presetId]?.[agent];
- if (override) return override;
- const rt = maintained.has(presetId) ? presets.find(p => p.id === presetId)?.runtimes[agent] : undefined;
- if (!rt) return undefined;
- const api = rt.wireProtocol === 'openai-chat' ? 'openai-completions' : rt.wireProtocol
- ?? (agent === 'claude-code' ? 'anthropic-messages' : agent === 'codex' ? 'openai-responses' : 'openai-completions');
- if (api !== 'anthropic-messages' && api !== 'openai-responses' && api !== 'openai-completions') return undefined;
- return { baseUrl: rt.baseUrl, api, inputs: Object.values(presets.find(p => p.id === presetId)!.runtimes).flatMap(value => value ? [value.baseUrl] : []) };
+
+export function providerInterfaceDefaultRoute(presetId: string, agent: AgentKind, baseUrl: string, registry: ModelRegistry = bundledRegistry) {
+ const profile = (registry.interfaceProfiles ?? []).find(p => p.providerId === presetId &&
+ !p.retired && !p.modelIds && p.defaultFor?.includes(agent) &&
+ [...p.inputBaseUrls, p.baseUrl].some(input => clean(input) === clean(baseUrl)));
+ const wireProtocol = profile && providerWireProtocolForApi(profile.api);
+ return profile && wireProtocol ? { baseUrl: profile.baseUrl, wireProtocol } : undefined;
}
-export function declaredModelInterface(presetId: string, modelId: string) {
- const declaration = (interfaceModels as Record<string, { models: Record<string, { api: string; endpoint: string }> }>)[presetId]?.models[modelId];
- if (!declaration) return undefined;
- const baseUrl = declaration.endpoint.replace(/(?:\/v1\/messages|\/chat\/completions|\/responses|\/models\/[^/]+)$/, '');
- return { api: declaration.api as NonNullable<ProviderRuntimeModelConfig['api']>, baseUrl };
+export function declaredModelInterface(presetId: string, modelId: string, registry: ModelRegistry = bundledRegistry) {
+ const profiles = (registry.interfaceProfiles ?? []).filter(p => p.providerId === presetId && !p.retired && p.modelIds?.includes(modelId));
+ if (profiles.length !== 1 || !PI_MODEL_APIS.some(api => api === profiles[0].api)) return undefined;
+ return { api: profiles[0].api as NonNullable<ProviderRuntimeModelConfig['api']>, baseUrl: profiles[0].baseUrl };
}
-/** Correct generated catalog routes and their stored imports. Explicit custom
- * paths and unrelated hosts/products (including subscription endpoints) stay put. */
+/** One selector for imports, saved connections and runtime projections. Derived
+ * selections never replace userModelConfig; explicit custom endpoints stay intact. */
export function providerInterfaceModelRoute<T extends ProviderRuntimeModelConfig>(
model: T, agent: AgentKind, presetId: string | undefined, baseUrl: string, managed = false,
+ registry: ModelRegistry = bundledRegistry,
): T {
if (!presetId || model.route?.requestPath) return model;
- const specific = declaredModelInterface(presetId, model.id);
- if (specific) {
- const product = presetId === 'opencode-go' ? 'https://opencode.ai/zen/go' : 'https://opencode.ai/zen';
- const allowed = [product, `${product}/v1`];
- if (!allowed.includes(clean(baseUrl)) || (model.route && !allowed.includes(clean(model.route.baseUrl)))) return model;
- if (!managed && ((model.api && model.api !== 'openai-completions') || (model.piApi && model.piApi !== 'openai-completions') || (model.route && model.route.wireProtocol !== 'openai-chat'))) return model;
- return { ...model, api: specific.api, ...(agent === 'pi' ? { piApi: specific.api } : {}), route: {
- baseUrl: specific.baseUrl, wireProtocol: providerWireProtocolForApi(specific.api) ?? 'openai-chat',
- } };
- }
- if (agent === 'pi') return model;
- if (managed && maintained.has(presetId) && !model.api && !model.piApi && !model.route) return model;
- const route = contract(presetId, agent);
- if (!route || ![...route.inputs, route.baseUrl].some(input => clean(input) === clean(baseUrl))) return model;
- // Stored legacy Pi projections used Chat. Do not overwrite explicit non-Chat choices.
- if (!managed && model.api && model.api !== 'openai-completions') return model;
- if (model.route) {
- if (!managed && model.route.wireProtocol !== 'openai-chat') return model;
- const declaredBases = new Set([...route.inputs, route.baseUrl,
- ...Object.values(presets.find(p => p.id === presetId)?.runtimes ?? {}).flatMap(rt => rt ? [rt.baseUrl] : []),
- ].map(clean));
- if (!declaredBases.has(clean(model.route.baseUrl))) return model;
+ const choices = availableModelInterfaces(registry, presetId, model.id, baseUrl, agent);
+ const declared = registry.models.some(e => e.routes.some(r => r.providerId === presetId && r.modelId === model.id && r.interfaces !== undefined));
+ if (!choices.length) {
+ const inScope = registry.interfaceProfiles?.some(p => p.providerId === presetId &&
+ [...p.inputBaseUrls, p.baseUrl].some(url => clean(url) === clean(baseUrl)));
+ return inScope && (declared || (model.interfaceId && model.interfaceId !== 'auto'))
+ ? { ...model, interfaceUnavailable: true, availableInterfaces: [] } : model;
}
- return { ...model, api: route.api, route: { baseUrl: route.baseUrl,
- wireProtocol: route.api === 'openai-completions' ? 'openai-chat' : route.api,
- } };
+ // Custom per-model origins/paths are outside the template's credential scope.
+ if (model.route && !choices.some(p => clean(p.route.baseUrl) === clean(model.route!.baseUrl))) return model;
+ const automatic = model.interfaceId === 'auto';
+ // Existing Pi adapter declarations remain authoritative until a Server binding
+ // explicitly replaces them; a product's generic default must not flatten them.
+ const keepManagedPiApi = managed && agent === 'pi' && !declared;
+ const explicitApi = (!managed || keepManagedPiApi) && !automatic && (model.api ?? model.piApi ??
+ (model.route?.wireProtocol === 'openai-chat' ? 'openai-completions' : model.route?.wireProtocol));
+ const legacyDefault = explicitApi && (registry.interfaceProfiles ?? []).some(p =>
+ p.legacyApis?.includes(explicitApi) && profileMatches(p, presetId, model.id, baseUrl))
+ ? choices.find(p => p.preferred) : undefined;
+ const selected = model.interfaceId && !automatic ? choices.find(p => p.profileId === model.interfaceId)
+ : explicitApi ? legacyDefault ?? choices.find(p => p.api === explicitApi)
+ : choices.find(p => p.preferred) ?? (declared ? choices[0] : undefined);
+ if (model.interfaceId && !automatic && !selected) return { ...model, interfaceUnavailable: true, availableInterfaces: choices };
+ if (!selected) return model;
+ return { ...model, ...(managed ? { interfaceId: selected.preferred ? 'auto' : selected.profileId } : {}), api: selected.api, ...(agent === 'pi' ? { piApi: selected.api } : {}),
+ route: selected.route, selectedInterface: selected, availableInterfaces: choices,
+ };
+}
+
+export function hasDeclaredProviderInterface(model: ProviderRuntimeModelConfig, agent: AgentKind, presetId: string | undefined, baseUrl: string, registry: ModelRegistry = bundledRegistry): boolean {
+ return !!presetId && availableModelInterfaces(registry, presetId, model.id, baseUrl, agent)
+ .some(p => p.api === model.api && clean(p.route.baseUrl) === clean(model.route?.baseUrl ?? baseUrl));
}
-export function hasDeclaredProviderInterface(model: ProviderRuntimeModelConfig, agent: AgentKind, presetId: string | undefined, baseUrl: string): boolean {
- const route = presetId ? contract(presetId, agent) : undefined;
- return !!route && agent !== 'pi' && model.api === route.api && !model.route?.requestPath
- && [...route.inputs, route.baseUrl].some(input => clean(input) === clean(baseUrl))
- && clean(model.route?.baseUrl ?? baseUrl) === clean(route.baseUrl);
+/** Apply one accepted execution snapshot to every bridge/SDK consumer. */
+export function modelWithInterface(model: CatalogModel, selected?: ModelInterfaceSnapshot): CatalogModel {
+ return selected ? { ...applyModelMetadata(model, selected.defaults), interfaceUnavailable: false, api: selected.api, piApi: selected.api,
+ route: selected.route, selectedInterface: selected } : model;
}
diff --git a/packages/model-providers/src/providerModelCatalog.ts b/packages/model-providers/src/providerModelCatalog.ts
index 861bb61555..bba32f369f 100644
--- a/packages/model-providers/src/providerModelCatalog.ts
+++ b/packages/model-providers/src/providerModelCatalog.ts
@@ -2,7 +2,7 @@ import { previousModelGenerations } from './modelGeneration.js';
import { sourceProviderForPreset } from './providerPresetIdentity.js';
import { providerEndpointBindings } from './providerEndpointTemplate.js';
import { declaredModelInterface } from './providerInterfaceRoutes.js';
-import interfaceModels from "../catalog/provider-interface-models.json" with { type: "json" };
+import registryData from "../catalog/model-registry.json" with { type: "json" };
import generated from "../catalog/provider-models.json" with { type: "json" };
import { pickModelMetadata, type ModelMetadata } from "./modelMetadataLayers.js";
import type { ModelCost, PiModelApi, ProviderWireProtocol } from "./types.js";
@@ -44,14 +44,13 @@ export const PROVIDER_MODEL_CATALOG = { ...sourceCatalog, providers: { ...source
// Official per-model contracts override the pinned Pi serializer choice, without
// borrowing another supplier's metadata or adding unlisted models to an account.
-for (const [provider, declaration] of Object.entries(interfaceModels)) {
- const interfaces = declaration.models as Record<string, { api: string; endpoint: string }>;
+for (const provider of new Set(registryData.interfaceProfiles.map(profile => profile.providerId))) {
const rows = PROVIDER_MODEL_CATALOG.providers[provider];
if (!rows) continue;
PROVIDER_MODEL_CATALOG.providers[provider] = rows.map(row => {
- const declared = interfaces[row.id];
- if (!declared || new URL(declared.endpoint).origin !== new URL(row.upstream).origin) return row;
- return { ...row, upstream: declaredModelInterface(provider, row.id)!.baseUrl, execution: { ...row.execution, pi: { ...row.execution.pi, api: declared.api } } };
+ const declaration = declaredModelInterface(provider, row.id);
+ if (!declaration || new URL(declaration.baseUrl).origin !== new URL(row.upstream).origin) return row;
+ return { ...row, upstream: declaration.baseUrl, execution: { ...row.execution, pi: { ...row.execution.pi, api: declaration.api } } };
});
}
diff --git a/packages/model-providers/src/source.ts b/packages/model-providers/src/source.ts
index 16b59b5d95..05f1221481 100644
--- a/packages/model-providers/src/source.ts
+++ b/packages/model-providers/src/source.ts
@@ -23,7 +23,7 @@ import type { AgentKind, Catalog, Provider, ProviderPreset } from "./types.js";
/** 公共模型目录 API 路径。发布版由 model-access-server 匿名提供完整 Catalog。 */
export const CATALOG_API_PATH =
- "/api/model-catalog/catalog?registrySchemaVersion=5&registryMedia=1&registryLocalRuntimes=1";
+ "/api/model-catalog/catalog?registrySchemaVersion=6&registryMedia=1&registryLocalRuntimes=1";
/** 旧客户端目录的 OSS 相对路径。迁移期作为公共 API 失败后的兼容回退。 */
export const CATALOG_CFG_PATH = "/cfg/providers.json";
@@ -125,7 +125,7 @@ export function resolveCatalogUrl(cfg: CatalogSourceConfig): string | null {
try {
const url = new URL(explicit);
if (url.pathname.endsWith("/api/model-catalog/catalog")) {
- url.searchParams.set("registrySchemaVersion", "5");
+ url.searchParams.set("registrySchemaVersion", "6");
url.searchParams.set("registryMedia", "1");
url.searchParams.set("registryLocalRuntimes", "1");
return url.toString();
@@ -644,55 +644,72 @@ export async function loadCatalogWithSource(
? Math.max(0, configuredBudget)
: 0;
const deadline = now() + budgetMs;
- for (const { url: remoteUrl, allowLegacyModelMeta } of remoteSources) {
+ for (const source of remoteSources) {
+ let remoteUrl = source.url;
+ const { allowLegacyModelMeta } = source;
const logUrl = catalogUrlForLog(remoteUrl);
const remainingMs = Math.max(0, deadline - now());
if (remainingMs > 0) {
try {
- const text = await io.fetchText(remoteUrl, remainingMs);
+ let text = await io.fetchText(remoteUrl, remainingMs);
let parsed = parseRemoteCatalog(text, allowLegacyModelMeta);
+ // Older servers map an unknown schema to frozen V2. Negotiate V5 once
+ // within the same deadline and keep caches scoped to the actual response.
+ if (new URL(remoteUrl).searchParams.get('registrySchemaVersion') === '6' &&
+ (parsed.modelRegistry?.schemaVersion ?? 0) < 6) {
+ const legacyUrl = new URL(remoteUrl);
+ legacyUrl.searchParams.set('registrySchemaVersion', '5');
+ remoteUrl = legacyUrl.toString();
+ const retryBudget = Math.max(0, deadline - now());
+ if (!retryBudget) throw new Error('catalog negotiation budget exhausted');
+ text = await io.fetchText(remoteUrl, retryBudget);
+ parsed = parseRemoteCatalog(text, allowLegacyModelMeta);
+ }
let capabilityEvidence: CatalogCapabilityEvidence =
allowLegacyModelMeta ? "fallback" : "current";
// Never propagate the retired compatibility block into a newly written LKG.
let cacheText = allowLegacyModelMeta ? JSON.stringify(parsed) : text;
const remoteRegistryUpdatedAt = registryUpdatedAt(parsed);
if (io.readCache) {
- try {
- const cachedText = await io.readCache(remoteUrl);
- if (cachedText !== null) {
- const cached = parseRemoteCatalog(
- cachedText,
- allowLegacyModelMeta,
- );
- const selected = preserveNewerCachedCatalog(parsed, cached);
- if (selected.catalog !== parsed) {
- parsed = selected.catalog;
- cacheText = JSON.stringify(selected.catalog);
- capabilityEvidence = "fallback";
- log(
- io,
- "warn",
- selected.tieConflict
- ? "remote registry republished the same updatedAt with different content; keeping LKG"
- : "remote catalog registry is older than LKG; preserving complete newer snapshot",
- {
- url: logUrl,
- remoteUpdatedAt: remoteRegistryUpdatedAt,
- cachedUpdatedAt: registryUpdatedAt(cached),
- },
+ for (const cacheUrl of new Set([remoteUrl, source.url])) {
+ try {
+ const cachedText = await io.readCache(cacheUrl);
+ if (cachedText !== null) {
+ const cached = parseRemoteCatalog(
+ cachedText,
+ allowLegacyModelMeta,
);
+ const selected = preserveNewerCachedCatalog(parsed, cached);
+ if (selected.catalog !== parsed) {
+ parsed = selected.catalog;
+ if (parsed.modelRegistry?.schemaVersion === 6) remoteUrl = source.url;
+ cacheText = JSON.stringify(selected.catalog);
+ capabilityEvidence = "fallback";
+ log(
+ io,
+ "warn",
+ selected.tieConflict
+ ? "remote registry republished the same updatedAt with different content; keeping LKG"
+ : "remote catalog registry is older than LKG; preserving complete newer snapshot",
+ {
+ url: logUrl,
+ remoteUpdatedAt: remoteRegistryUpdatedAt,
+ cachedUpdatedAt: registryUpdatedAt(cached),
+ },
+ );
+ }
}
+ } catch (err) {
+ log(
+ io,
+ "warn",
+ "cached catalog could not be compared with remote snapshot",
+ {
+ url: logUrl,
+ err: remoteErrorForLog(err, remoteUrl, logUrl),
+ },
+ );
}
- } catch (err) {
- log(
- io,
- "warn",
- "cached catalog could not be compared with remote snapshot",
- {
- url: logUrl,
- err: remoteErrorForLog(err, remoteUrl, logUrl),
- },
- );
}
}
if (io.writeCache) {
@@ -763,27 +780,29 @@ export async function loadCatalogWithSource(
);
}
if (io.readCache) {
- try {
- const cached = await io.readCache(remoteUrl);
- if (cached !== null) {
- const parsed = parseRemoteCatalog(cached, allowLegacyModelMeta);
- log(io, "info", "loaded last-known-good catalog snapshot", {
+ for (const cacheUrl of new Set([source.url, remoteUrl, source.url.replace('registrySchemaVersion=6', 'registrySchemaVersion=5')])) {
+ try {
+ const cached = await io.readCache(cacheUrl);
+ if (cached !== null) {
+ const parsed = parseRemoteCatalog(cached, allowLegacyModelMeta);
+ log(io, "info", "loaded last-known-good catalog snapshot", {
+ url: logUrl,
+ });
+ return {
+ catalog: mergeWithBundled(parsed),
+ // A cached legacy OSS snapshot stays below the local Pi protocol authorities.
+ authorityCatalog: allowLegacyModelMeta ? null : parsed,
+ source: "cache",
+ capabilityEvidence: "fallback",
+ unverifiedXdMediaKinds: ALL_XD_MEDIA_KINDS,
+ };
+ }
+ } catch (err) {
+ log(io, "warn", "cached catalog read/parse failed, trying fallback", {
url: logUrl,
+ err: remoteErrorForLog(err, remoteUrl, logUrl),
});
- return {
- catalog: mergeWithBundled(parsed),
- // A cached legacy OSS snapshot stays below the local Pi protocol authorities.
- authorityCatalog: allowLegacyModelMeta ? null : parsed,
- source: "cache",
- capabilityEvidence: "fallback",
- unverifiedXdMediaKinds: ALL_XD_MEDIA_KINDS,
- };
}
- } catch (err) {
- log(io, "warn", "cached catalog read/parse failed, trying fallback", {
- url: logUrl,
- err: remoteErrorForLog(err, remoteUrl, logUrl),
- });
}
}
}
diff --git a/packages/model-providers/src/types.ts b/packages/model-providers/src/types.ts
index ad13442593..48c647e803 100644
--- a/packages/model-providers/src/types.ts
+++ b/packages/model-providers/src/types.ts
@@ -184,6 +184,7 @@ export type OAuthProviderDescriptor =
* 真实上游 + 鉴权 + model id 还原。加新供应商 = 加这份数据,不改路由器代码。
*/
export interface RoutingDescriptor {
+ modelInterface?: ModelInterfaceSnapshot;
/**
* 上游 wire protocol。Claude Code / Codex 缺省保持历史语义;Pi 必须显式声明。
* Codex 的 openai-chat / anthropic-messages 会分别进入对应的本地 Responses bridge。
@@ -305,7 +306,24 @@ export interface ModelCost {
* per-agent 拆分正是为了表达这种分歧:各 agent 列表里各写各的值。同一 agent 内、同一 id
* 跨 provider(如 gpt-5.5 同时由 openai 与 xd 提供)则必须元数据一致(见 catalog.ts 校验)。
*/
+/** Non-sensitive, atomic execution selection. Stored with a running task. */
+export interface ModelInterfaceSnapshot {
+ profileId: string;
+ providerId: string;
+ revision: string;
+ api: PiModelApi;
+ wireModelId: string;
+ route: ProviderModelRouteConfig;
+ defaults: ModelMetadata;
+ compatibility: string[];
+ preferred: boolean;
+ nativeApis?: import('./modelAccessBean.js').ModelNativeApi[] | null;
+}
export interface CatalogModel {
+ interfaceUnavailable?: boolean;
+ selectedInterface?: ModelInterfaceSnapshot;
+ availableInterfaces?: ModelInterfaceSnapshot[];
+ nativeApis?: import("./modelAccessBean.js").ModelNativeApi[] | null;
/** Same-provider display-only pricing; never inherited through public model metadata. */
displayPricing?: ModelDisplayPricing;
currency?: 'USD' | 'CNY';
@@ -629,6 +647,11 @@ export interface Provider {
* 并随用户配置持久化,避免已知长上下文模型被错误降级。
*/
export interface ProviderRuntimeModelConfig extends ModelMetadata {
+ /** User override; absent follows the directory. Never persist derived snapshots. */
+ interfaceId?: string;
+ interfaceUnavailable?: boolean;
+ selectedInterface?: ModelInterfaceSnapshot;
+ availableInterfaces?: ModelInterfaceSnapshot[];
/** Current account discovery only; deliberately excluded from inheritable ModelMetadata. */
supportsUltrafastMode?: boolean;
discoveredMetadata?: ModelMetadata;
diff --git a/packages/model-providers/src/user-provider.ts b/packages/model-providers/src/user-provider.ts
index a394f36db3..f3c037c637 100644
--- a/packages/model-providers/src/user-provider.ts
+++ b/packages/model-providers/src/user-provider.ts
@@ -14,6 +14,7 @@ import {
applyModelMetadata,
mergeModelMetadata,
pickModelMetadata,
+ catalogModelMetadata,
runtimeUserModelMetadata,
findBaseModel,
type ModelMetadata,
@@ -340,7 +341,7 @@ function toCatalogModel(
const user = runtimeUserModelMetadata(m);
const resolved =
(modelRegistry?.schemaVersion ?? 0) >= 4 ||
- m.discoveredMetadata ||
+ m.discoveredMetadata || m.selectedInterface ||
providerDefaults || (generationDefaults && Object.keys(generationDefaults).length > 0)
? resolveModelMetadata(
modelRegistry ?? undefined,
@@ -352,6 +353,7 @@ function toCatalogModel(
providerDefaults,
undefined,
generationDefaults,
+ m.selectedInterface?.defaults,
)
: pickModelMetadata(user);
// 「未声明」与「明确无档位」要分开(#5535):用户/运行时 reasoning、目录继承、发现或用户
@@ -501,7 +503,7 @@ export function buildUserProvider(
models[agent] = rt.models.map((storedModel) => {
// Old ID-only imports must pick up newly known per-model interfaces too.
// An explicit model API/path remains a user choice, not a preset default.
- const interfaceDefault = followsPreset && !storedModel.api && !storedModel.piApi && !storedModel.route
+ const interfaceDefault = (options.modelRegistry?.schemaVersion ?? 0) < 6 && followsPreset && !storedModel.api && !storedModel.piApi && !storedModel.route
? presetRuntime.models.find(model => model.id === storedModel.id) : undefined;
const configuredModel = interfaceDefault ? { ...storedModel,
...(interfaceDefault.api ? { api: interfaceDefault.api } : {}),
@@ -516,7 +518,7 @@ export function buildUserProvider(
} }
: configuredModel;
const m = rt.requestPath ? boundConfiguredModel : alignModelApiRoute(
- providerInterfaceModelRoute(boundConfiguredModel, agent, rt.catalogPresetId, resolvedBaseUrl),
+ providerInterfaceModelRoute(boundConfiguredModel, agent, rt.catalogPresetId, resolvedBaseUrl, false, options.modelRegistry ?? BUNDLED_CATALOG.modelRegistry),
resolvedBaseUrl, rt.wireProtocol ?? defaultWireProtocol(agent),
);
const presetModel = followsPreset
@@ -555,7 +557,7 @@ export function buildUserProvider(
? providerModelRecord(m.id, m.route?.baseUrl ?? resolvedBaseUrl,
m.api ?? (agent === 'pi' ? m.piApi ?? wire : wire),
!m.api && !m.piApi && !m.route)
- ?? (hasDeclaredProviderInterface(m, agent, rt.catalogPresetId, resolvedBaseUrl)
+ ?? (hasDeclaredProviderInterface(m, agent, rt.catalogPresetId, resolvedBaseUrl, options.modelRegistry ?? BUNDLED_CATALOG.modelRegistry)
? providerPresetModelRecord(rt.catalogPresetId, m.id) : undefined)
?? (followsPreset && sameRoute && m.api && presetModel?.api === m.api
? providerPresetModelRecord(preset?.id, m.id, m.api) : undefined)
@@ -620,9 +622,9 @@ export function buildUserProvider(
};
const projected = toCatalogModel(
m,
- followsPreset && sameRoute ? preset!.id : config.id,
+ m.selectedInterface?.providerId ?? (followsPreset && sameRoute ? preset!.id : config.id),
agent,
- options.modelRegistry,
+ options.modelRegistry ?? (m.selectedInterface ? BUNDLED_CATALOG.modelRegistry : undefined),
defaults,
nativeCodex ? 'openai' : undefined,
generationDefaults,
@@ -640,6 +642,9 @@ export function buildUserProvider(
return {
...(imported?.cost ? { cost: imported.cost } : {}),
...projected,
+ ...(m.interfaceUnavailable ? { interfaceUnavailable: true, availableInterfaces: m.availableInterfaces } : {}),
+ ...(m.selectedInterface ? { selectedInterface: { ...m.selectedInterface, defaults: catalogModelMetadata(projected) }, availableInterfaces: m.availableInterfaces,
+ ...(m.selectedInterface.nativeApis !== undefined ? { nativeApis: m.selectedInterface.nativeApis } : {}) } : {}),
// Only this native account's latest discovery grants Ultrafast. Public
// defaults, same-name API connections and other engines cannot inherit it.
...(nativeCodex && agent === 'codex'
diff --git a/tools/model-catalog/sync-xai.mts b/tools/model-catalog/sync-xai.mts
index fd0bad9385..ee075d6d98 100644
--- a/tools/model-catalog/sync-xai.mts
+++ b/tools/model-catalog/sync-xai.mts
@@ -51,8 +51,11 @@ async function getJson(url: string, headers: Record<string, string> = {}) {
catch { throw new Error(`Invalid JSON: ${url}`); }
}
try {
- const catalogUrl = 'https://model-access.cindy.app/api/model-catalog/catalog?registrySchemaVersion=5&registryMedia=1';
- const baseline = parseCatalog(values.catalog ? await readJson(values.catalog) : await getJson(catalogUrl));
+ const catalogUrl = 'https://model-access.cindy.app/api/model-catalog/catalog?registrySchemaVersion=6&registryMedia=1';
+ let baseline = parseCatalog(values.catalog ? await readJson(values.catalog) : await getJson(catalogUrl));
+ if (!values.catalog && (baseline.modelRegistry?.schemaVersion ?? 0) < 5) {
+ baseline = parseCatalog(await getJson(catalogUrl.replace('Version=6', 'Version=5')));
+ }
let account: unknown;
let details: unknown;
if (offline) {
diff --git a/tools/model-catalog/xai-sync.ts b/tools/model-catalog/xai-sync.ts
index dd365ff057..c36bc1a3e5 100644
--- a/tools/model-catalog/xai-sync.ts
+++ b/tools/model-catalog/xai-sync.ts
@@ -93,7 +93,7 @@ function mergeTariffs(previous: ModelReferencePrice[], next: ModelReferencePrice
export function buildXaiSyncCandidate(baseline: Catalog, accountPayload: unknown, detailsPayload: unknown, observedAt: string) {
if (!Number.isFinite(Date.parse(observedAt))) throw new Error('Invalid observation timestamp');
const catalog = structuredClone(baseline);
- if (catalog.modelRegistry?.schemaVersion !== 5) throw new Error('Sync requires an existing V5 catalog');
+ if (catalog.modelRegistry?.schemaVersion !== 5 && catalog.modelRegistry?.schemaVersion !== 6) throw new Error('Sync requires an existing V5/V6 catalog');
const registry = catalog.modelRegistry;
const provider = catalog.providers.find(p => p.id === 'xai');
if (!provider) throw new Error('Catalog lacks xAI subscription routing');