1 line
26 KiB
JSON
1 line
26 KiB
JSON
{"repo": "brikkoai/brikko-studio", "files": {"packages/core/extensions/minimax/src/minimax-web-search-provider.ts": {"4137e7876cb6dab19f50e0615ceb662c580d3d54": {"t": 1785674022.522177, "n": 2392, "h": "5c9a21e7e8a73372", "c": "import {\n createWebSearchProviderContractFields,\n type WebSearchProviderPlugin,\n} from \"brikko-studio/plugin-sdk/provider-web-search-config-contract\";\n\nconst MINIMAX_CREDENTIAL_PATH = \"plugins.entries.minimax.config.webSearch.apiKey\";\nconst MINIMAX_TOKEN_PLAN_ENV_VARS = [\n \"MINIMAX_CODE_PLAN_KEY\",\n \"MINIMAX_CODING_API_KEY\",\n \"MINIMAX_OAUTH_TOKEN\",\n] as const;\nconst MINIMAX_WEB_SEARCH_ENV_VARS = [...MINIMAX_TOKEN_PLAN_ENV_VARS, \"MINIMAX_API_KEY\"] as const;\n\ntype MiniMaxWebSearchRuntime = typeof import(\"./minimax-web-search-provider.runtime.js\");\n\nlet miniMaxWebSearchRuntimePromise: Promise<MiniMaxWebSearchRuntime> | undefined;\n\nfunction loadMiniMaxWebSearchRuntime(): Promise<MiniMaxWebSearchRuntime> {\n miniMaxWebSearchRuntimePromise ??= import(\"./minimax-web-search-provider.runtime.js\");\n return miniMaxWebSearchRuntimePromise;\n}\n\nconst MiniMaxSearchSchema = {\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search query string.\" },\n count: {\n type: \"number\",\n description: \"Number of results to return (1-10).\",\n minimum: 1,\n maximum: 10,\n },\n },\n} satisfies Record<string, unknown>;\n\nexport function createMiniMaxWebSearchProvider(): WebSearchProviderPlugin {\n return {\n id: \"minimax\",\n label: \"MiniMax Search\",\n hint: \"Structured results via MiniMax Token Plan search API\",\n onboardingScopes: [\"text-inference\"],\n credentialLabel: \"MiniMax Token Plan key or OAuth token\",\n envVars: [...MINIMAX_WEB_SEARCH_ENV_VARS],\n placeholder: \"sk-cp-...\",\n signupUrl: \"https://platform.minimax.io/user-center/basic-information/interface-key\",\n docsUrl: \"https://docs.brikko-studio.ai/tools/minimax-search\",\n autoDetectOrder: 15,\n credentialPath: MINIMAX_CREDENTIAL_PATH,\n ...createWebSearchProviderContractFields({\n credentialPath: MINIMAX_CREDENTIAL_PATH,\n searchCredential: { type: \"top-level\" },\n configuredCredential: { pluginId: \"minimax\" },\n }),\n createTool: (ctx) => ({\n description:\n \"Search the web using MiniMax Search API. Returns titles, URLs, snippets, and related search suggestions.\",\n parameters: MiniMaxSearchSchema,\n execute: async (args) => {\n const { executeMiniMaxWebSearchProviderTool } = await loadMiniMaxWebSearchRuntime();\n return await executeMiniMaxWebSearchProviderTool(ctx, args);\n },\n }),\n };\n}\n"}}, "packages/core/extensions/minimax/provider-registration.ts": {"4137e7876cb6dab19f50e0615ceb662c580d3d54": {"t": 1785674026.9984944, "n": 10258, "h": "19e75ccb5d284005", "c": "import { formatErrorMessage } from \"brikko-studio/plugin-sdk/error-runtime\";\nimport type {\n BrikkoStudioPluginApi,\n BrikkoStudioConfig,\n ProviderAuthContext,\n ProviderAuthResult,\n ProviderCatalogContext,\n} from \"brikko-studio/plugin-sdk/plugin-entry\";\nimport {\n MINIMAX_OAUTH_MARKER,\n ensureAuthProfileStore,\n listProfilesForProvider,\n} from \"brikko-studio/plugin-sdk/provider-auth\";\nimport { buildOauthProviderAuthResult } from \"brikko-studio/plugin-sdk/provider-auth\";\nimport { createProviderApiKeyAuthMethod } from \"brikko-studio/plugin-sdk/provider-auth-api-key\";\nimport { buildProviderReplayFamilyHooks } from \"brikko-studio/plugin-sdk/provider-model-shared\";\nimport { MINIMAX_FAST_MODE_STREAM_HOOKS } from \"brikko-studio/plugin-sdk/provider-stream-family\";\nimport { fetchMinimaxUsage } from \"brikko-studio/plugin-sdk/provider-usage\";\nimport { normalizeOptionalString } from \"brikko-studio/plugin-sdk/text-runtime\";\nimport { isMiniMaxModernModelId, MINIMAX_DEFAULT_MODEL_ID } from \"./api.js\";\nimport type { MiniMaxRegion } from \"./oauth.js\";\nimport { applyMinimaxApiConfig, applyMinimaxApiConfigCn } from \"./onboard.js\";\nimport { buildMinimaxPortalProvider, buildMinimaxProvider } from \"./provider-catalog.js\";\n\nconst API_PROVIDER_ID = \"minimax\";\nconst PORTAL_PROVIDER_ID = \"minimax-portal\";\nconst PROVIDER_LABEL = \"MiniMax\";\nconst DEFAULT_MODEL = MINIMAX_DEFAULT_MODEL_ID;\nconst DEFAULT_BASE_URL_CN = \"https://api.minimaxi.com/anthropic\";\nconst DEFAULT_BASE_URL_GLOBAL = \"https://api.minimax.io/anthropic\";\nconst MINIMAX_USAGE_ENV_VAR_KEYS = [\n \"MINIMAX_OAUTH_TOKEN\",\n \"MINIMAX_CODE_PLAN_KEY\",\n \"MINIMAX_CODING_API_KEY\",\n \"MINIMAX_API_KEY\",\n] as const;\nconst MINIMAX_WIZARD_GROUP = {\n groupId: \"minimax\",\n groupLabel: \"MiniMax\",\n groupHint: \"M2.7 (recommended)\",\n} as const;\nconst HYBRID_ANTHROPIC_OPENAI_REPLAY_HOOKS = buildProviderReplayFamilyHooks({\n family: \"hybrid-anthropic-openai\",\n anthropicModelDropThinkingBlocks: true,\n});\nconst MINIMAX_PROVIDER_HOOKS = {\n ...HYBRID_ANTHROPIC_OPENAI_REPLAY_HOOKS,\n ...MINIMAX_FAST_MODE_STREAM_HOOKS,\n resolveReasoningOutputMode: () => \"native\" as const,\n};\n\nfunction getDefaultBaseUrl(region: MiniMaxRegion): string {\n return region === \"cn\" ? DEFAULT_BASE_URL_CN : DEFAULT_BASE_URL_GLOBAL;\n}\n\nfunction resolveMinimaxRegionLabel(region: MiniMaxRegion): string {\n return region === \"cn\" ? \"CN\" : \"Global\";\n}\n\nfunction resolveMinimaxEndpointHint(region: MiniMaxRegion): string {\n return region === \"cn\" ? \"CN endpoint - api.minimaxi.com\" : \"Global endpoint - api.minimax.io\";\n}\n\nfunction apiModelRef(modelId: string): string {\n return `${API_PROVIDER_ID}/${modelId}`;\n}\n\nfunction portalModelRef(modelId: string): string {\n return `${PORTAL_PROVIDER_ID}/${modelId}`;\n}\n\nfunction getProviderBaseUrl(cfg: BrikkoStudioConfig, providerId: string): string | undefined {\n return normalizeOptionalString(cfg.models?.providers?.[providerId]?.baseUrl);\n}\n\nfunction resolveMinimaxUsageBaseUrl(cfg: BrikkoStudioConfig): string | undefined {\n return getProviderBaseUrl(cfg, PORTAL_PROVIDER_ID) ?? getProviderBaseUrl(cfg, API_PROVIDER_ID);\n}\n\nfunction buildPortalProviderCatalog(params: { baseUrl: string; apiKey: string }) {\n return {\n ...buildMinimaxPortalProvider(),\n baseUrl: params.baseUrl,\n apiKey: params.apiKey,\n };\n}\n\nfunction resolveApiCatalog(ctx: ProviderCatalogContext) {\n const apiKey = ctx.resolveProviderApiKey(API_PROVIDER_ID).apiKey;\n if (!apiKey) {\n return null;\n }\n return {\n provider: {\n ...buildMinimaxProvider(ctx.env),\n apiKey,\n },\n };\n}\n\nfunction resolvePortalCatalog(ctx: ProviderCatalogContext) {\n const explicitProvider = ctx.config.models?.providers?.[PORTAL_PROVIDER_ID];\n const envApiKey = ctx.resolveProviderApiKey(PORTAL_PROVIDER_ID).apiKey;\n const authStore = ensureAuthProfileStore(ctx.agentDir, {\n allowKeychainPrompt: false,\n });\n const hasProfiles = listProfilesForProvider(authStore, PORTAL_PROVIDER_ID).length > 0;\n const explicitApiKey = normalizeOptionalString(explicitProvider?.apiKey);\n const apiKey = envApiKey ?? explicitApiKey ?? (hasProfiles ? MINIMAX_OAUTH_MARKER : undefined);\n if (!apiKey) {\n return null;\n }\n\n const explicitBaseUrl = normalizeOptionalString(explicitProvider?.baseUrl);\n\n return {\n provider: buildPortalProviderCatalog({\n baseUrl: explicitBaseUrl || buildMinimaxPortalProvider(ctx.env).baseUrl,\n apiKey,\n }),\n };\n}\n\nfunction createOAuthHandler(region: MiniMaxRegion) {\n const defaultBaseUrl = getDefaultBaseUrl(region);\n const regionLabel = resolveMinimaxRegionLabel(region);\n\n return async (ctx: ProviderAuthContext): Promise<ProviderAuthResult> => {\n const progress = ctx.prompter.progress(`Starting MiniMax OAuth (${regionLabel})…`);\n try {\n const { loginMiniMaxPortalOAuth } = await import(\"./oauth.runtime.js\");\n const result = await loginMiniMaxPortalOAuth({\n openUrl: ctx.openUrl,\n note: ctx.prompter.note,\n progress,\n region,\n });\n\n progress.stop(\"MiniMax OAuth complete\");\n\n if (result.notification_message) {\n await ctx.prompter.note(result.notification_message, \"MiniMax OAuth\");\n }\n\n const baseUrl = result.resourceUrl || defaultBaseUrl;\n\n return buildOauthProviderAuthResult({\n providerId: PORTAL_PROVIDER_ID,\n defaultModel: portalModelRef(DEFAULT_MODEL),\n access: result.access,\n refresh: result.refresh,\n expires: result.expires,\n configPatch: {\n models: {\n providers: {\n [PORTAL_PROVIDER_ID]: {\n baseUrl,\n api: \"anthropic-messages\",\n authHeader: true,\n models: [],\n },\n },\n },\n agents: {\n defaults: {\n models: {\n [portalModelRef(\"MiniMax-M2.7\")]: { alias: \"minimax-m2.7\" },\n [portalModelRef(\"MiniMax-M2.7-highspeed\")]: {\n alias: \"minimax-m2.7-highspeed\",\n },\n },\n },\n },\n },\n notes: [\n \"MiniMax OAuth tokens auto-refresh. Re-run login if refresh fails or access is revoked.\",\n `Base URL defaults to ${defaultBaseUrl}. Override models.providers.${PORTAL_PROVIDER_ID}.baseUrl if needed.`,\n ...(result.notification_message ? [result.notification_message] : []),\n ],\n });\n } catch (err) {\n const errorMsg = formatErrorMessage(err);\n progress.stop(`MiniMax OAuth failed: ${errorMsg}`);\n await ctx.prompter.note(\n \"If OAuth fails, verify your MiniMax account has portal access and try again.\",\n \"MiniMax OAuth\",\n );\n throw err;\n }\n };\n}\n\nfunction createMinimaxApiKeyMethod(region: MiniMaxRegion) {\n const regionLabel = resolveMinimaxRegionLabel(region);\n const endpointHint = resolveMinimaxEndpointHint(region);\n const isCn = region === \"cn\";\n return createProviderApiKeyAuthMethod({\n providerId: API_PROVIDER_ID,\n methodId: isCn ? \"api-cn\" : \"api-global\",\n label: `MiniMax API key (${regionLabel})`,\n hint: endpointHint,\n optionKey: \"minimaxApiKey\",\n flagName: \"--minimax-api-key\",\n envVar: \"MINIMAX_API_KEY\",\n promptMessage: isCn\n ? \"Enter MiniMax CN API key (sk-api- or sk-cp-)\\nhttps://platform.minimaxi.com/user-center/basic-information/interface-key\"\n : \"Enter MiniMax API key (sk-api- or sk-cp-)\\nhttps://platform.minimax.io/user-center/basic-information/interface-key\",\n profileId: isCn ? \"minimax:cn\" : \"minimax:global\",\n allowProfile: false,\n defaultModel: apiModelRef(DEFAULT_MODEL),\n expectedProviders: isCn ? [\"minimax\", \"minimax-cn\"] : [\"minimax\"],\n applyConfig: (cfg) => (isCn ? applyMinimaxApiConfigCn(cfg) : applyMinimaxApiConfig(cfg)),\n wizard: {\n choiceId: isCn ? \"minimax-cn-api\" : \"minimax-global-api\",\n choiceLabel: `MiniMax API key (${regionLabel})`,\n choiceHint: endpointHint,\n ...MINIMAX_WIZARD_GROUP,\n },\n });\n}\n\nfunction createMinimaxOAuthMethod(region: MiniMaxRegion) {\n const regionLabel = resolveMinimaxRegionLabel(region);\n const endpointHint = resolveMinimaxEndpointHint(region);\n const isCn = region === \"cn\";\n return {\n id: isCn ? \"oauth-cn\" : \"oauth\",\n label: `MiniMax OAuth (${regionLabel})`,\n hint: endpointHint,\n kind: \"device_code\" as const,\n wizard: {\n choiceId: isCn ? \"minimax-cn-oauth\" : \"minimax-global-oauth\",\n choiceLabel: `MiniMax OAuth (${regionLabel})`,\n choiceHint: endpointHint,\n ...MINIMAX_WIZARD_GROUP,\n },\n run: createOAuthHandler(region),\n };\n}\n\nexport function registerMinimaxProviders(api: BrikkoStudioPluginApi) {\n api.registerProvider({\n id: API_PROVIDER_ID,\n label: PROVIDER_LABEL,\n hookAliases: [\"minimax-cn\"],\n docsPath: \"/providers/minimax\",\n envVars: [\"MINIMAX_API_KEY\"],\n auth: [createMinimaxApiKeyMethod(\"global\"), createMinimaxApiKeyMethod(\"cn\")],\n catalog: {\n order: \"simple\",\n run: async (ctx) => resolveApiCatalog(ctx),\n },\n resolveUsageAuth: async (ctx) => {\n const portalOauth = await ctx.resolveOAuthToken({ provider: PORTAL_PROVIDER_ID });\n if (portalOauth) {\n return portalOauth;\n }\n const apiKey = ctx.resolveApiKeyFromConfigAndStore({\n providerIds: [API_PROVIDER_ID, PORTAL_PROVIDER_ID],\n envDirect: MINIMAX_USAGE_ENV_VAR_KEYS.map((name) => ctx.env[name]),\n });\n return apiKey ? { token: apiKey } : null;\n },\n ...MINIMAX_PROVIDER_HOOKS,\n isModernModelRef: ({ modelId }) => isMiniMaxModernModelId(modelId),\n fetchUsageSnapshot: async (ctx) =>\n await fetchMinimaxUsage(ctx.token, ctx.timeoutMs, ctx.fetchFn, {\n baseUrl: resolveMinimaxUsageBaseUrl(ctx.config),\n }),\n });\n\n api.registerProvider({\n id: PORTAL_PROVIDER_ID,\n label: PROVIDER_LABEL,\n hookAliases: [\"minimax-portal-cn\"],\n docsPath: \"/providers/minimax\",\n envVars: [\"MINIMAX_OAUTH_TOKEN\", \"MINIMAX_API_KEY\"],\n catalog: {\n run: async (ctx) => resolvePortalCatalog(ctx),\n },\n auth: [createMinimaxOAuthMethod(\"global\"), createMinimaxOAuthMethod(\"cn\")],\n ...MINIMAX_PROVIDER_HOOKS,\n isModernModelRef: ({ modelId }) => isMiniMaxModernModelId(modelId),\n });\n}\n"}}, "packages/core/docs/providers/opencode-go.md": {"4137e7876cb6dab19f50e0615ceb662c580d3d54": {"t": 1785747222.7515783, "n": 4093, "h": "a38991de97db4d25", "c": "---\nsummary: \"Use the OpenCode Go catalog with the shared OpenCode setup\"\nread_when:\n - You want the OpenCode Go catalog\n - You need the runtime model refs for Go-hosted models\ntitle: \"OpenCode Go\"\n---\n\nOpenCode Go is the Go catalog within [OpenCode](/providers/opencode).\nIt uses the same `OPENCODE_API_KEY` as the Zen catalog, but keeps the runtime\nprovider id `opencode-go` so upstream per-model routing stays correct.\n\n| Property | Value |\n| ---------------- | ------------------------------- |\n| Runtime provider | `opencode-go` |\n| Auth | `OPENCODE_API_KEY` |\n| Parent setup | [OpenCode](/providers/opencode) |\n\n## Built-in catalog\n\nBrikko Studio sources most Go catalog rows from the bundled pi model registry and\nsupplements current upstream rows while the registry catches up. Run\n`brikko-studio models list --provider opencode-go` for the current model list.\n\nThe provider includes:\n\n| Model ref | Name |\n| ------------------------------- | --------------------- |\n| `opencode-go/glm-5` | GLM-5 |\n| `opencode-go/glm-5.1` | GLM-5.1 |\n| `opencode-go/kimi-k2.5` | Kimi K2.5 |\n| `opencode-go/kimi-k2.6` | Kimi K2.6 (3x limits) |\n| `opencode-go/deepseek-v4-pro` | DeepSeek V4 Pro |\n| `opencode-go/deepseek-v4-flash` | DeepSeek V4 Flash |\n| `opencode-go/mimo-v2-omni` | MiMo V2 Omni |\n| `opencode-go/mimo-v2-pro` | MiMo V2 Pro |\n| `opencode-go/minimax-m2.5` | MiniMax M2.5 |\n| `opencode-go/minimax-m2.7` | MiniMax M2.7 |\n| `opencode-go/qwen3.5-plus` | Qwen3.5 Plus |\n| `opencode-go/qwen3.6-plus` | Qwen3.6 Plus |\n\n## Getting started\n\n<Tabs>\n <Tab title=\"Interactive\">\n <Steps>\n <Step title=\"Run onboarding\">\n ```bash\n brikko-studio onboard --auth-choice opencode-go\n ```\n </Step>\n <Step title=\"Set a Go model as default\">\n ```bash\n brikko-studio config set agents.defaults.model.primary \"opencode-go/kimi-k2.6\"\n ```\n </Step>\n <Step title=\"Verify models are available\">\n ```bash\n brikko-studio models list --provider opencode-go\n ```\n </Step>\n </Steps>\n </Tab>\n\n <Tab title=\"Non-interactive\">\n <Steps>\n <Step title=\"Pass the key directly\">\n ```bash\n brikko-studio onboard --opencode-go-api-key \"$OPENCODE_API_KEY\"\n ```\n </Step>\n <Step title=\"Verify models are available\">\n ```bash\n brikko-studio models list --provider opencode-go\n ```\n </Step>\n </Steps>\n </Tab>\n</Tabs>\n\n## Config example\n\n```json5\n{\n env: { OPENCODE_API_KEY: \"YOUR_API_KEY_HERE\" }, // pragma: allowlist secret\n agents: { defaults: { model: { primary: \"opencode-go/kimi-k2.6\" } } },\n}\n```\n\n## Advanced configuration\n\n<AccordionGroup>\n <Accordion title=\"Routing behavior\">\n Brikko Studio handles per-model routing automatically when the model ref uses\n `opencode-go/...`. No additional provider config is required.\n </Accordion>\n\n <Accordion title=\"Runtime ref convention\">\n Runtime refs stay explicit: `opencode/...` for Zen, `opencode-go/...` for Go.\n This keeps upstream per-model routing correct across both catalogs.\n </Accordion>\n\n <Accordion title=\"Shared credentials\">\n The same `OPENCODE_API_KEY` is used by both the Zen and Go catalogs. Entering\n the key during setup stores credentials for both runtime providers.\n </Accordion>\n</AccordionGroup>\n\n<Tip>\nSee [OpenCode](/providers/opencode) for the shared onboarding overview and the full\nZen + Go catalog reference.\n</Tip>\n\n## Related\n\n<CardGroup cols={2}>\n <Card title=\"OpenCode (parent)\" href=\"/providers/opencode\" icon=\"server\">\n Shared onboarding, catalog overview, and advanced notes.\n </Card>\n <Card title=\"Model selection\" href=\"/concepts/model-providers\" icon=\"layers\">\n Choosing providers, model refs, and failover behavior.\n </Card>\n</CardGroup>\n"}, "6136c07ca0015f57b432fd4c09013a051dd84ceb": {"t": 1785771466.431719, "n": 4093, "h": "a38991de97db4d25", "c": "---\nsummary: \"Use the OpenCode Go catalog with the shared OpenCode setup\"\nread_when:\n - You want the OpenCode Go catalog\n - You need the runtime model refs for Go-hosted models\ntitle: \"OpenCode Go\"\n---\n\nOpenCode Go is the Go catalog within [OpenCode](/providers/opencode).\nIt uses the same `OPENCODE_API_KEY` as the Zen catalog, but keeps the runtime\nprovider id `opencode-go` so upstream per-model routing stays correct.\n\n| Property | Value |\n| ---------------- | ------------------------------- |\n| Runtime provider | `opencode-go` |\n| Auth | `OPENCODE_API_KEY` |\n| Parent setup | [OpenCode](/providers/opencode) |\n\n## Built-in catalog\n\nBrikko Studio sources most Go catalog rows from the bundled pi model registry and\nsupplements current upstream rows while the registry catches up. Run\n`brikko-studio models list --provider opencode-go` for the current model list.\n\nThe provider includes:\n\n| Model ref | Name |\n| ------------------------------- | --------------------- |\n| `opencode-go/glm-5` | GLM-5 |\n| `opencode-go/glm-5.1` | GLM-5.1 |\n| `opencode-go/kimi-k2.5` | Kimi K2.5 |\n| `opencode-go/kimi-k2.6` | Kimi K2.6 (3x limits) |\n| `opencode-go/deepseek-v4-pro` | DeepSeek V4 Pro |\n| `opencode-go/deepseek-v4-flash` | DeepSeek V4 Flash |\n| `opencode-go/mimo-v2-omni` | MiMo V2 Omni |\n| `opencode-go/mimo-v2-pro` | MiMo V2 Pro |\n| `opencode-go/minimax-m2.5` | MiniMax M2.5 |\n| `opencode-go/minimax-m2.7` | MiniMax M2.7 |\n| `opencode-go/qwen3.5-plus` | Qwen3.5 Plus |\n| `opencode-go/qwen3.6-plus` | Qwen3.6 Plus |\n\n## Getting started\n\n<Tabs>\n <Tab title=\"Interactive\">\n <Steps>\n <Step title=\"Run onboarding\">\n ```bash\n brikko-studio onboard --auth-choice opencode-go\n ```\n </Step>\n <Step title=\"Set a Go model as default\">\n ```bash\n brikko-studio config set agents.defaults.model.primary \"opencode-go/kimi-k2.6\"\n ```\n </Step>\n <Step title=\"Verify models are available\">\n ```bash\n brikko-studio models list --provider opencode-go\n ```\n </Step>\n </Steps>\n </Tab>\n\n <Tab title=\"Non-interactive\">\n <Steps>\n <Step title=\"Pass the key directly\">\n ```bash\n brikko-studio onboard --opencode-go-api-key \"$OPENCODE_API_KEY\"\n ```\n </Step>\n <Step title=\"Verify models are available\">\n ```bash\n brikko-studio models list --provider opencode-go\n ```\n </Step>\n </Steps>\n </Tab>\n</Tabs>\n\n## Config example\n\n```json5\n{\n env: { OPENCODE_API_KEY: \"YOUR_API_KEY_HERE\" }, // pragma: allowlist secret\n agents: { defaults: { model: { primary: \"opencode-go/kimi-k2.6\" } } },\n}\n```\n\n## Advanced configuration\n\n<AccordionGroup>\n <Accordion title=\"Routing behavior\">\n Brikko Studio handles per-model routing automatically when the model ref uses\n `opencode-go/...`. No additional provider config is required.\n </Accordion>\n\n <Accordion title=\"Runtime ref convention\">\n Runtime refs stay explicit: `opencode/...` for Zen, `opencode-go/...` for Go.\n This keeps upstream per-model routing correct across both catalogs.\n </Accordion>\n\n <Accordion title=\"Shared credentials\">\n The same `OPENCODE_API_KEY` is used by both the Zen and Go catalogs. Entering\n the key during setup stores credentials for both runtime providers.\n </Accordion>\n</AccordionGroup>\n\n<Tip>\nSee [OpenCode](/providers/opencode) for the shared onboarding overview and the full\nZen + Go catalog reference.\n</Tip>\n\n## Related\n\n<CardGroup cols={2}>\n <Card title=\"OpenCode (parent)\" href=\"/providers/opencode\" icon=\"server\">\n Shared onboarding, catalog overview, and advanced notes.\n </Card>\n <Card title=\"Model selection\" href=\"/concepts/model-providers\" icon=\"layers\">\n Choosing providers, model refs, and failover behavior.\n </Card>\n</CardGroup>\n"}, "105b34923180e78a2af531ff5163078db04c9d4e": {"t": 1785771467.8484423, "n": 4053, "h": "1b9e954edf2235a3", "c": "---\nsummary: \"Use the OpenCode Go catalog with the shared OpenCode setup\"\nread_when:\n - You want the OpenCode Go catalog\n - You need the runtime model refs for Go-hosted models\ntitle: \"OpenCode Go\"\n---\n\nOpenCode Go is the Go catalog within [OpenCode](/providers/opencode).\nIt uses the same `OPENCODE_API_KEY` as the Zen catalog, but keeps the runtime\nprovider id `opencode-go` so upstream per-model routing stays correct.\n\n| Property | Value |\n| ---------------- | ------------------------------- |\n| Runtime provider | `opencode-go` |\n| Auth | `OPENCODE_API_KEY` |\n| Parent setup | [OpenCode](/providers/opencode) |\n\n## Built-in catalog\n\nOpenClaw sources most Go catalog rows from the bundled pi model registry and\nsupplements current upstream rows while the registry catches up. Run\n`openclaw models list --provider opencode-go` for the current model list.\n\nThe provider includes:\n\n| Model ref | Name |\n| ------------------------------- | --------------------- |\n| `opencode-go/glm-5` | GLM-5 |\n| `opencode-go/glm-5.1` | GLM-5.1 |\n| `opencode-go/kimi-k2.5` | Kimi K2.5 |\n| `opencode-go/kimi-k2.6` | Kimi K2.6 (3x limits) |\n| `opencode-go/deepseek-v4-pro` | DeepSeek V4 Pro |\n| `opencode-go/deepseek-v4-flash` | DeepSeek V4 Flash |\n| `opencode-go/mimo-v2-omni` | MiMo V2 Omni |\n| `opencode-go/mimo-v2-pro` | MiMo V2 Pro |\n| `opencode-go/minimax-m2.5` | MiniMax M2.5 |\n| `opencode-go/minimax-m2.7` | MiniMax M2.7 |\n| `opencode-go/qwen3.5-plus` | Qwen3.5 Plus |\n| `opencode-go/qwen3.6-plus` | Qwen3.6 Plus |\n\n## Getting started\n\n<Tabs>\n <Tab title=\"Interactive\">\n <Steps>\n <Step title=\"Run onboarding\">\n ```bash\n openclaw onboard --auth-choice opencode-go\n ```\n </Step>\n <Step title=\"Set a Go model as default\">\n ```bash\n openclaw config set agents.defaults.model.primary \"opencode-go/kimi-k2.6\"\n ```\n </Step>\n <Step title=\"Verify models are available\">\n ```bash\n openclaw models list --provider opencode-go\n ```\n </Step>\n </Steps>\n </Tab>\n\n <Tab title=\"Non-interactive\">\n <Steps>\n <Step title=\"Pass the key directly\">\n ```bash\n openclaw onboard --opencode-go-api-key \"$OPENCODE_API_KEY\"\n ```\n </Step>\n <Step title=\"Verify models are available\">\n ```bash\n openclaw models list --provider opencode-go\n ```\n </Step>\n </Steps>\n </Tab>\n</Tabs>\n\n## Config example\n\n```json5\n{\n env: { OPENCODE_API_KEY: \"YOUR_API_KEY_HERE\" }, // pragma: allowlist secret\n agents: { defaults: { model: { primary: \"opencode-go/kimi-k2.6\" } } },\n}\n```\n\n## Advanced configuration\n\n<AccordionGroup>\n <Accordion title=\"Routing behavior\">\n OpenClaw handles per-model routing automatically when the model ref uses\n `opencode-go/...`. No additional provider config is required.\n </Accordion>\n\n <Accordion title=\"Runtime ref convention\">\n Runtime refs stay explicit: `opencode/...` for Zen, `opencode-go/...` for Go.\n This keeps upstream per-model routing correct across both catalogs.\n </Accordion>\n\n <Accordion title=\"Shared credentials\">\n The same `OPENCODE_API_KEY` is used by both the Zen and Go catalogs. Entering\n the key during setup stores credentials for both runtime providers.\n </Accordion>\n</AccordionGroup>\n\n<Tip>\nSee [OpenCode](/providers/opencode) for the shared onboarding overview and the full\nZen + Go catalog reference.\n</Tip>\n\n## Related\n\n<CardGroup cols={2}>\n <Card title=\"OpenCode (parent)\" href=\"/providers/opencode\" icon=\"server\">\n Shared onboarding, catalog overview, and advanced notes.\n </Card>\n <Card title=\"Model selection\" href=\"/concepts/model-providers\" icon=\"layers\">\n Choosing providers, model refs, and failover behavior.\n </Card>\n</CardGroup>\n"}}}} |