@neurocode-ai/web 1.18.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (702) hide show
  1. package/README.md +54 -0
  2. package/astro.config.mjs +324 -0
  3. package/config.mjs +14 -0
  4. package/package.json +44 -0
  5. package/public/apple-touch-icon-v3.png +1 -0
  6. package/public/apple-touch-icon.png +1 -0
  7. package/public/favicon-96x96-v3.png +1 -0
  8. package/public/favicon-96x96.png +1 -0
  9. package/public/favicon-v3.ico +1 -0
  10. package/public/favicon-v3.svg +1 -0
  11. package/public/favicon.ico +1 -0
  12. package/public/favicon.svg +1 -0
  13. package/public/robots.txt +6 -0
  14. package/public/site.webmanifest +1 -0
  15. package/public/social-share-zen.png +1 -0
  16. package/public/social-share.png +1 -0
  17. package/public/theme.json +183 -0
  18. package/public/web-app-manifest-192x192.png +1 -0
  19. package/public/web-app-manifest-512x512.png +1 -0
  20. package/src/assets/lander/check.svg +2 -0
  21. package/src/assets/lander/copy.svg +2 -0
  22. package/src/assets/lander/screenshot-github.png +0 -0
  23. package/src/assets/lander/screenshot-splash.png +0 -0
  24. package/src/assets/lander/screenshot-vscode.png +0 -0
  25. package/src/assets/lander/screenshot.png +0 -0
  26. package/src/assets/logo-dark.svg +18 -0
  27. package/src/assets/logo-light.svg +18 -0
  28. package/src/assets/logo-ornate-dark.svg +18 -0
  29. package/src/assets/logo-ornate-light.svg +18 -0
  30. package/src/assets/web/web-homepage-active-session.png +0 -0
  31. package/src/assets/web/web-homepage-new-session.png +0 -0
  32. package/src/assets/web/web-homepage-see-servers.png +0 -0
  33. package/src/components/Footer.astro +125 -0
  34. package/src/components/Head.astro +54 -0
  35. package/src/components/Header.astro +136 -0
  36. package/src/components/Hero.astro +11 -0
  37. package/src/components/Lander.astro +721 -0
  38. package/src/components/LanguageSelect.astro +29 -0
  39. package/src/components/Share.tsx +644 -0
  40. package/src/components/SiteTitle.astro +59 -0
  41. package/src/components/icons/custom.tsx +87 -0
  42. package/src/components/icons/index.tsx +4454 -0
  43. package/src/components/share/common.tsx +128 -0
  44. package/src/components/share/content-bash.module.css +85 -0
  45. package/src/components/share/content-bash.tsx +67 -0
  46. package/src/components/share/content-code.module.css +26 -0
  47. package/src/components/share/content-code.tsx +30 -0
  48. package/src/components/share/content-diff.module.css +153 -0
  49. package/src/components/share/content-diff.tsx +240 -0
  50. package/src/components/share/content-error.module.css +64 -0
  51. package/src/components/share/content-error.tsx +25 -0
  52. package/src/components/share/content-markdown.module.css +154 -0
  53. package/src/components/share/content-markdown.tsx +74 -0
  54. package/src/components/share/content-text.module.css +63 -0
  55. package/src/components/share/content-text.tsx +38 -0
  56. package/src/components/share/copy-button.module.css +30 -0
  57. package/src/components/share/copy-button.tsx +36 -0
  58. package/src/components/share/part.module.css +428 -0
  59. package/src/components/share/part.tsx +816 -0
  60. package/src/components/share.module.css +832 -0
  61. package/src/content/docs/acp.mdx +156 -0
  62. package/src/content/docs/agents.mdx +781 -0
  63. package/src/content/docs/ar/acp.mdx +156 -0
  64. package/src/content/docs/ar/agents.mdx +754 -0
  65. package/src/content/docs/ar/cli.mdx +616 -0
  66. package/src/content/docs/ar/commands.mdx +322 -0
  67. package/src/content/docs/ar/config.mdx +685 -0
  68. package/src/content/docs/ar/custom-tools.mdx +196 -0
  69. package/src/content/docs/ar/ecosystem.mdx +78 -0
  70. package/src/content/docs/ar/enterprise.mdx +165 -0
  71. package/src/content/docs/ar/formatters.mdx +131 -0
  72. package/src/content/docs/ar/github.mdx +321 -0
  73. package/src/content/docs/ar/gitlab.mdx +195 -0
  74. package/src/content/docs/ar/go.mdx +224 -0
  75. package/src/content/docs/ar/ide.mdx +48 -0
  76. package/src/content/docs/ar/index.mdx +344 -0
  77. package/src/content/docs/ar/keybinds.mdx +194 -0
  78. package/src/content/docs/ar/lsp.mdx +207 -0
  79. package/src/content/docs/ar/mcp-servers.mdx +511 -0
  80. package/src/content/docs/ar/models.mdx +222 -0
  81. package/src/content/docs/ar/network.mdx +57 -0
  82. package/src/content/docs/ar/permissions.mdx +235 -0
  83. package/src/content/docs/ar/plugins.mdx +385 -0
  84. package/src/content/docs/ar/providers.mdx +1983 -0
  85. package/src/content/docs/ar/rules.mdx +180 -0
  86. package/src/content/docs/ar/sdk.mdx +463 -0
  87. package/src/content/docs/ar/server.mdx +287 -0
  88. package/src/content/docs/ar/share.mdx +127 -0
  89. package/src/content/docs/ar/skills.mdx +222 -0
  90. package/src/content/docs/ar/themes.mdx +369 -0
  91. package/src/content/docs/ar/tools.mdx +341 -0
  92. package/src/content/docs/ar/troubleshooting.mdx +299 -0
  93. package/src/content/docs/ar/tui.mdx +426 -0
  94. package/src/content/docs/ar/web.mdx +142 -0
  95. package/src/content/docs/ar/windows-wsl.mdx +113 -0
  96. package/src/content/docs/ar/zen.mdx +332 -0
  97. package/src/content/docs/bs/acp.mdx +156 -0
  98. package/src/content/docs/bs/agents.mdx +754 -0
  99. package/src/content/docs/bs/cli.mdx +614 -0
  100. package/src/content/docs/bs/commands.mdx +316 -0
  101. package/src/content/docs/bs/config.mdx +685 -0
  102. package/src/content/docs/bs/custom-tools.mdx +195 -0
  103. package/src/content/docs/bs/ecosystem.mdx +78 -0
  104. package/src/content/docs/bs/enterprise.mdx +165 -0
  105. package/src/content/docs/bs/formatters.mdx +124 -0
  106. package/src/content/docs/bs/github.mdx +311 -0
  107. package/src/content/docs/bs/gitlab.mdx +188 -0
  108. package/src/content/docs/bs/go.mdx +238 -0
  109. package/src/content/docs/bs/ide.mdx +47 -0
  110. package/src/content/docs/bs/index.mdx +323 -0
  111. package/src/content/docs/bs/keybinds.mdx +194 -0
  112. package/src/content/docs/bs/lsp.mdx +204 -0
  113. package/src/content/docs/bs/mcp-servers.mdx +482 -0
  114. package/src/content/docs/bs/models.mdx +201 -0
  115. package/src/content/docs/bs/network.mdx +51 -0
  116. package/src/content/docs/bs/permissions.mdx +228 -0
  117. package/src/content/docs/bs/plugins.mdx +371 -0
  118. package/src/content/docs/bs/providers.mdx +1993 -0
  119. package/src/content/docs/bs/rules.mdx +180 -0
  120. package/src/content/docs/bs/sdk.mdx +463 -0
  121. package/src/content/docs/bs/server.mdx +284 -0
  122. package/src/content/docs/bs/share.mdx +127 -0
  123. package/src/content/docs/bs/skills.mdx +222 -0
  124. package/src/content/docs/bs/themes.mdx +369 -0
  125. package/src/content/docs/bs/tools.mdx +341 -0
  126. package/src/content/docs/bs/troubleshooting.mdx +300 -0
  127. package/src/content/docs/bs/tui.mdx +432 -0
  128. package/src/content/docs/bs/web.mdx +142 -0
  129. package/src/content/docs/bs/windows-wsl.mdx +113 -0
  130. package/src/content/docs/bs/zen.mdx +350 -0
  131. package/src/content/docs/cli.mdx +733 -0
  132. package/src/content/docs/commands.mdx +323 -0
  133. package/src/content/docs/config.mdx +941 -0
  134. package/src/content/docs/custom-tools.mdx +196 -0
  135. package/src/content/docs/da/acp.mdx +156 -0
  136. package/src/content/docs/da/agents.mdx +755 -0
  137. package/src/content/docs/da/cli.mdx +617 -0
  138. package/src/content/docs/da/commands.mdx +323 -0
  139. package/src/content/docs/da/config.mdx +688 -0
  140. package/src/content/docs/da/custom-tools.mdx +196 -0
  141. package/src/content/docs/da/ecosystem.mdx +78 -0
  142. package/src/content/docs/da/enterprise.mdx +170 -0
  143. package/src/content/docs/da/formatters.mdx +131 -0
  144. package/src/content/docs/da/github.mdx +321 -0
  145. package/src/content/docs/da/gitlab.mdx +195 -0
  146. package/src/content/docs/da/go.mdx +238 -0
  147. package/src/content/docs/da/ide.mdx +48 -0
  148. package/src/content/docs/da/index.mdx +360 -0
  149. package/src/content/docs/da/keybinds.mdx +194 -0
  150. package/src/content/docs/da/lsp.mdx +208 -0
  151. package/src/content/docs/da/mcp-servers.mdx +511 -0
  152. package/src/content/docs/da/models.mdx +223 -0
  153. package/src/content/docs/da/network.mdx +57 -0
  154. package/src/content/docs/da/permissions.mdx +235 -0
  155. package/src/content/docs/da/plugins.mdx +389 -0
  156. package/src/content/docs/da/providers.mdx +1981 -0
  157. package/src/content/docs/da/rules.mdx +180 -0
  158. package/src/content/docs/da/sdk.mdx +463 -0
  159. package/src/content/docs/da/server.mdx +287 -0
  160. package/src/content/docs/da/share.mdx +128 -0
  161. package/src/content/docs/da/skills.mdx +222 -0
  162. package/src/content/docs/da/themes.mdx +369 -0
  163. package/src/content/docs/da/tools.mdx +341 -0
  164. package/src/content/docs/da/troubleshooting.mdx +300 -0
  165. package/src/content/docs/da/tui.mdx +426 -0
  166. package/src/content/docs/da/web.mdx +142 -0
  167. package/src/content/docs/da/windows-wsl.mdx +113 -0
  168. package/src/content/docs/da/zen.mdx +345 -0
  169. package/src/content/docs/de/acp.mdx +156 -0
  170. package/src/content/docs/de/agents.mdx +741 -0
  171. package/src/content/docs/de/cli.mdx +616 -0
  172. package/src/content/docs/de/commands.mdx +323 -0
  173. package/src/content/docs/de/config.mdx +684 -0
  174. package/src/content/docs/de/custom-tools.mdx +170 -0
  175. package/src/content/docs/de/ecosystem.mdx +78 -0
  176. package/src/content/docs/de/enterprise.mdx +170 -0
  177. package/src/content/docs/de/formatters.mdx +131 -0
  178. package/src/content/docs/de/github.mdx +321 -0
  179. package/src/content/docs/de/gitlab.mdx +195 -0
  180. package/src/content/docs/de/go.mdx +226 -0
  181. package/src/content/docs/de/ide.mdx +48 -0
  182. package/src/content/docs/de/index.mdx +356 -0
  183. package/src/content/docs/de/keybinds.mdx +194 -0
  184. package/src/content/docs/de/lsp.mdx +207 -0
  185. package/src/content/docs/de/mcp-servers.mdx +511 -0
  186. package/src/content/docs/de/models.mdx +223 -0
  187. package/src/content/docs/de/network.mdx +57 -0
  188. package/src/content/docs/de/permissions.mdx +235 -0
  189. package/src/content/docs/de/plugins.mdx +384 -0
  190. package/src/content/docs/de/providers.mdx +1987 -0
  191. package/src/content/docs/de/rules.mdx +190 -0
  192. package/src/content/docs/de/sdk.mdx +465 -0
  193. package/src/content/docs/de/server.mdx +291 -0
  194. package/src/content/docs/de/share.mdx +130 -0
  195. package/src/content/docs/de/skills.mdx +222 -0
  196. package/src/content/docs/de/themes.mdx +372 -0
  197. package/src/content/docs/de/tools.mdx +352 -0
  198. package/src/content/docs/de/troubleshooting.mdx +300 -0
  199. package/src/content/docs/de/tui.mdx +429 -0
  200. package/src/content/docs/de/web.mdx +142 -0
  201. package/src/content/docs/de/windows-wsl.mdx +115 -0
  202. package/src/content/docs/de/zen.mdx +327 -0
  203. package/src/content/docs/ecosystem.mdx +83 -0
  204. package/src/content/docs/enterprise.mdx +169 -0
  205. package/src/content/docs/es/acp.mdx +156 -0
  206. package/src/content/docs/es/agents.mdx +755 -0
  207. package/src/content/docs/es/cli.mdx +616 -0
  208. package/src/content/docs/es/commands.mdx +323 -0
  209. package/src/content/docs/es/config.mdx +685 -0
  210. package/src/content/docs/es/custom-tools.mdx +196 -0
  211. package/src/content/docs/es/ecosystem.mdx +78 -0
  212. package/src/content/docs/es/enterprise.mdx +170 -0
  213. package/src/content/docs/es/formatters.mdx +131 -0
  214. package/src/content/docs/es/github.mdx +321 -0
  215. package/src/content/docs/es/gitlab.mdx +195 -0
  216. package/src/content/docs/es/go.mdx +238 -0
  217. package/src/content/docs/es/ide.mdx +48 -0
  218. package/src/content/docs/es/index.mdx +345 -0
  219. package/src/content/docs/es/keybinds.mdx +194 -0
  220. package/src/content/docs/es/lsp.mdx +208 -0
  221. package/src/content/docs/es/mcp-servers.mdx +511 -0
  222. package/src/content/docs/es/models.mdx +223 -0
  223. package/src/content/docs/es/network.mdx +57 -0
  224. package/src/content/docs/es/permissions.mdx +235 -0
  225. package/src/content/docs/es/plugins.mdx +389 -0
  226. package/src/content/docs/es/providers.mdx +1989 -0
  227. package/src/content/docs/es/rules.mdx +180 -0
  228. package/src/content/docs/es/sdk.mdx +463 -0
  229. package/src/content/docs/es/server.mdx +287 -0
  230. package/src/content/docs/es/share.mdx +128 -0
  231. package/src/content/docs/es/skills.mdx +222 -0
  232. package/src/content/docs/es/themes.mdx +369 -0
  233. package/src/content/docs/es/tools.mdx +341 -0
  234. package/src/content/docs/es/troubleshooting.mdx +300 -0
  235. package/src/content/docs/es/tui.mdx +429 -0
  236. package/src/content/docs/es/web.mdx +142 -0
  237. package/src/content/docs/es/windows-wsl.mdx +113 -0
  238. package/src/content/docs/es/zen.mdx +345 -0
  239. package/src/content/docs/formatters.mdx +143 -0
  240. package/src/content/docs/fr/acp.mdx +156 -0
  241. package/src/content/docs/fr/agents.mdx +755 -0
  242. package/src/content/docs/fr/cli.mdx +617 -0
  243. package/src/content/docs/fr/commands.mdx +322 -0
  244. package/src/content/docs/fr/config.mdx +686 -0
  245. package/src/content/docs/fr/custom-tools.mdx +170 -0
  246. package/src/content/docs/fr/ecosystem.mdx +78 -0
  247. package/src/content/docs/fr/enterprise.mdx +165 -0
  248. package/src/content/docs/fr/formatters.mdx +131 -0
  249. package/src/content/docs/fr/github.mdx +322 -0
  250. package/src/content/docs/fr/gitlab.mdx +195 -0
  251. package/src/content/docs/fr/go.mdx +224 -0
  252. package/src/content/docs/fr/ide.mdx +48 -0
  253. package/src/content/docs/fr/index.mdx +344 -0
  254. package/src/content/docs/fr/keybinds.mdx +194 -0
  255. package/src/content/docs/fr/lsp.mdx +208 -0
  256. package/src/content/docs/fr/mcp-servers.mdx +511 -0
  257. package/src/content/docs/fr/models.mdx +222 -0
  258. package/src/content/docs/fr/network.mdx +57 -0
  259. package/src/content/docs/fr/permissions.mdx +235 -0
  260. package/src/content/docs/fr/plugins.mdx +384 -0
  261. package/src/content/docs/fr/providers.mdx +1996 -0
  262. package/src/content/docs/fr/rules.mdx +180 -0
  263. package/src/content/docs/fr/sdk.mdx +463 -0
  264. package/src/content/docs/fr/server.mdx +287 -0
  265. package/src/content/docs/fr/share.mdx +128 -0
  266. package/src/content/docs/fr/skills.mdx +222 -0
  267. package/src/content/docs/fr/themes.mdx +369 -0
  268. package/src/content/docs/fr/tools.mdx +341 -0
  269. package/src/content/docs/fr/troubleshooting.mdx +300 -0
  270. package/src/content/docs/fr/tui.mdx +429 -0
  271. package/src/content/docs/fr/web.mdx +142 -0
  272. package/src/content/docs/fr/windows-wsl.mdx +113 -0
  273. package/src/content/docs/fr/zen.mdx +327 -0
  274. package/src/content/docs/github.mdx +321 -0
  275. package/src/content/docs/gitlab.mdx +195 -0
  276. package/src/content/docs/go.mdx +238 -0
  277. package/src/content/docs/ide.mdx +48 -0
  278. package/src/content/docs/index.mdx +360 -0
  279. package/src/content/docs/it/acp.mdx +155 -0
  280. package/src/content/docs/it/agents.mdx +753 -0
  281. package/src/content/docs/it/cli.mdx +617 -0
  282. package/src/content/docs/it/commands.mdx +322 -0
  283. package/src/content/docs/it/config.mdx +685 -0
  284. package/src/content/docs/it/custom-tools.mdx +196 -0
  285. package/src/content/docs/it/ecosystem.mdx +78 -0
  286. package/src/content/docs/it/enterprise.mdx +165 -0
  287. package/src/content/docs/it/formatters.mdx +132 -0
  288. package/src/content/docs/it/github.mdx +321 -0
  289. package/src/content/docs/it/gitlab.mdx +195 -0
  290. package/src/content/docs/it/go.mdx +236 -0
  291. package/src/content/docs/it/ide.mdx +48 -0
  292. package/src/content/docs/it/index.mdx +344 -0
  293. package/src/content/docs/it/keybinds.mdx +194 -0
  294. package/src/content/docs/it/lsp.mdx +208 -0
  295. package/src/content/docs/it/mcp-servers.mdx +511 -0
  296. package/src/content/docs/it/models.mdx +222 -0
  297. package/src/content/docs/it/network.mdx +57 -0
  298. package/src/content/docs/it/permissions.mdx +235 -0
  299. package/src/content/docs/it/plugins.mdx +388 -0
  300. package/src/content/docs/it/providers.mdx +1964 -0
  301. package/src/content/docs/it/rules.mdx +180 -0
  302. package/src/content/docs/it/sdk.mdx +463 -0
  303. package/src/content/docs/it/server.mdx +284 -0
  304. package/src/content/docs/it/share.mdx +127 -0
  305. package/src/content/docs/it/skills.mdx +222 -0
  306. package/src/content/docs/it/themes.mdx +369 -0
  307. package/src/content/docs/it/tools.mdx +341 -0
  308. package/src/content/docs/it/troubleshooting.mdx +299 -0
  309. package/src/content/docs/it/tui.mdx +426 -0
  310. package/src/content/docs/it/web.mdx +142 -0
  311. package/src/content/docs/it/windows-wsl.mdx +113 -0
  312. package/src/content/docs/it/zen.mdx +345 -0
  313. package/src/content/docs/ja/acp.mdx +155 -0
  314. package/src/content/docs/ja/agents.mdx +751 -0
  315. package/src/content/docs/ja/cli.mdx +616 -0
  316. package/src/content/docs/ja/commands.mdx +322 -0
  317. package/src/content/docs/ja/config.mdx +684 -0
  318. package/src/content/docs/ja/custom-tools.mdx +196 -0
  319. package/src/content/docs/ja/ecosystem.mdx +78 -0
  320. package/src/content/docs/ja/enterprise.mdx +166 -0
  321. package/src/content/docs/ja/formatters.mdx +132 -0
  322. package/src/content/docs/ja/github.mdx +322 -0
  323. package/src/content/docs/ja/gitlab.mdx +195 -0
  324. package/src/content/docs/ja/go.mdx +224 -0
  325. package/src/content/docs/ja/ide.mdx +48 -0
  326. package/src/content/docs/ja/index.mdx +350 -0
  327. package/src/content/docs/ja/keybinds.mdx +194 -0
  328. package/src/content/docs/ja/lsp.mdx +208 -0
  329. package/src/content/docs/ja/mcp-servers.mdx +511 -0
  330. package/src/content/docs/ja/models.mdx +221 -0
  331. package/src/content/docs/ja/network.mdx +55 -0
  332. package/src/content/docs/ja/permissions.mdx +282 -0
  333. package/src/content/docs/ja/plugins.mdx +461 -0
  334. package/src/content/docs/ja/providers.mdx +1998 -0
  335. package/src/content/docs/ja/rules.mdx +179 -0
  336. package/src/content/docs/ja/sdk.mdx +463 -0
  337. package/src/content/docs/ja/server.mdx +282 -0
  338. package/src/content/docs/ja/share.mdx +128 -0
  339. package/src/content/docs/ja/skills.mdx +222 -0
  340. package/src/content/docs/ja/themes.mdx +667 -0
  341. package/src/content/docs/ja/tools.mdx +341 -0
  342. package/src/content/docs/ja/troubleshooting.mdx +300 -0
  343. package/src/content/docs/ja/tui.mdx +423 -0
  344. package/src/content/docs/ja/web.mdx +143 -0
  345. package/src/content/docs/ja/windows-wsl.mdx +116 -0
  346. package/src/content/docs/ja/zen.mdx +327 -0
  347. package/src/content/docs/keybinds.mdx +299 -0
  348. package/src/content/docs/ko/acp.mdx +156 -0
  349. package/src/content/docs/ko/agents.mdx +754 -0
  350. package/src/content/docs/ko/cli.mdx +616 -0
  351. package/src/content/docs/ko/commands.mdx +323 -0
  352. package/src/content/docs/ko/config.mdx +685 -0
  353. package/src/content/docs/ko/custom-tools.mdx +196 -0
  354. package/src/content/docs/ko/ecosystem.mdx +78 -0
  355. package/src/content/docs/ko/enterprise.mdx +165 -0
  356. package/src/content/docs/ko/formatters.mdx +132 -0
  357. package/src/content/docs/ko/github.mdx +321 -0
  358. package/src/content/docs/ko/gitlab.mdx +195 -0
  359. package/src/content/docs/ko/go.mdx +224 -0
  360. package/src/content/docs/ko/ide.mdx +48 -0
  361. package/src/content/docs/ko/index.mdx +344 -0
  362. package/src/content/docs/ko/keybinds.mdx +194 -0
  363. package/src/content/docs/ko/lsp.mdx +208 -0
  364. package/src/content/docs/ko/mcp-servers.mdx +511 -0
  365. package/src/content/docs/ko/models.mdx +223 -0
  366. package/src/content/docs/ko/network.mdx +57 -0
  367. package/src/content/docs/ko/permissions.mdx +235 -0
  368. package/src/content/docs/ko/plugins.mdx +388 -0
  369. package/src/content/docs/ko/providers.mdx +1984 -0
  370. package/src/content/docs/ko/rules.mdx +179 -0
  371. package/src/content/docs/ko/sdk.mdx +463 -0
  372. package/src/content/docs/ko/server.mdx +287 -0
  373. package/src/content/docs/ko/share.mdx +128 -0
  374. package/src/content/docs/ko/skills.mdx +222 -0
  375. package/src/content/docs/ko/themes.mdx +369 -0
  376. package/src/content/docs/ko/tools.mdx +341 -0
  377. package/src/content/docs/ko/troubleshooting.mdx +303 -0
  378. package/src/content/docs/ko/tui.mdx +425 -0
  379. package/src/content/docs/ko/web.mdx +142 -0
  380. package/src/content/docs/ko/windows-wsl.mdx +119 -0
  381. package/src/content/docs/ko/zen.mdx +327 -0
  382. package/src/content/docs/lsp.mdx +214 -0
  383. package/src/content/docs/mcp-servers.mdx +512 -0
  384. package/src/content/docs/models.mdx +223 -0
  385. package/src/content/docs/nb/acp.mdx +156 -0
  386. package/src/content/docs/nb/agents.mdx +754 -0
  387. package/src/content/docs/nb/cli.mdx +617 -0
  388. package/src/content/docs/nb/commands.mdx +323 -0
  389. package/src/content/docs/nb/config.mdx +688 -0
  390. package/src/content/docs/nb/custom-tools.mdx +196 -0
  391. package/src/content/docs/nb/ecosystem.mdx +78 -0
  392. package/src/content/docs/nb/enterprise.mdx +170 -0
  393. package/src/content/docs/nb/formatters.mdx +131 -0
  394. package/src/content/docs/nb/github.mdx +325 -0
  395. package/src/content/docs/nb/gitlab.mdx +195 -0
  396. package/src/content/docs/nb/go.mdx +238 -0
  397. package/src/content/docs/nb/ide.mdx +48 -0
  398. package/src/content/docs/nb/index.mdx +359 -0
  399. package/src/content/docs/nb/keybinds.mdx +194 -0
  400. package/src/content/docs/nb/lsp.mdx +208 -0
  401. package/src/content/docs/nb/mcp-servers.mdx +624 -0
  402. package/src/content/docs/nb/models.mdx +223 -0
  403. package/src/content/docs/nb/network.mdx +57 -0
  404. package/src/content/docs/nb/permissions.mdx +235 -0
  405. package/src/content/docs/nb/plugins.mdx +389 -0
  406. package/src/content/docs/nb/providers.mdx +1956 -0
  407. package/src/content/docs/nb/rules.mdx +180 -0
  408. package/src/content/docs/nb/sdk.mdx +463 -0
  409. package/src/content/docs/nb/server.mdx +287 -0
  410. package/src/content/docs/nb/share.mdx +128 -0
  411. package/src/content/docs/nb/skills.mdx +222 -0
  412. package/src/content/docs/nb/themes.mdx +369 -0
  413. package/src/content/docs/nb/tools.mdx +341 -0
  414. package/src/content/docs/nb/troubleshooting.mdx +225 -0
  415. package/src/content/docs/nb/tui.mdx +429 -0
  416. package/src/content/docs/nb/web.mdx +105 -0
  417. package/src/content/docs/nb/windows-wsl.mdx +113 -0
  418. package/src/content/docs/nb/zen.mdx +345 -0
  419. package/src/content/docs/network.mdx +57 -0
  420. package/src/content/docs/permissions.mdx +256 -0
  421. package/src/content/docs/pl/acp.mdx +158 -0
  422. package/src/content/docs/pl/agents.mdx +754 -0
  423. package/src/content/docs/pl/cli.mdx +617 -0
  424. package/src/content/docs/pl/commands.mdx +323 -0
  425. package/src/content/docs/pl/config.mdx +680 -0
  426. package/src/content/docs/pl/custom-tools.mdx +196 -0
  427. package/src/content/docs/pl/ecosystem.mdx +78 -0
  428. package/src/content/docs/pl/enterprise.mdx +170 -0
  429. package/src/content/docs/pl/formatters.mdx +131 -0
  430. package/src/content/docs/pl/github.mdx +321 -0
  431. package/src/content/docs/pl/gitlab.mdx +195 -0
  432. package/src/content/docs/pl/go.mdx +230 -0
  433. package/src/content/docs/pl/ide.mdx +48 -0
  434. package/src/content/docs/pl/index.mdx +347 -0
  435. package/src/content/docs/pl/keybinds.mdx +194 -0
  436. package/src/content/docs/pl/lsp.mdx +208 -0
  437. package/src/content/docs/pl/mcp-servers.mdx +511 -0
  438. package/src/content/docs/pl/models.mdx +223 -0
  439. package/src/content/docs/pl/network.mdx +57 -0
  440. package/src/content/docs/pl/permissions.mdx +235 -0
  441. package/src/content/docs/pl/plugins.mdx +385 -0
  442. package/src/content/docs/pl/providers.mdx +1986 -0
  443. package/src/content/docs/pl/rules.mdx +180 -0
  444. package/src/content/docs/pl/sdk.mdx +463 -0
  445. package/src/content/docs/pl/server.mdx +287 -0
  446. package/src/content/docs/pl/share.mdx +128 -0
  447. package/src/content/docs/pl/skills.mdx +222 -0
  448. package/src/content/docs/pl/themes.mdx +369 -0
  449. package/src/content/docs/pl/tools.mdx +341 -0
  450. package/src/content/docs/pl/troubleshooting.mdx +300 -0
  451. package/src/content/docs/pl/tui.mdx +429 -0
  452. package/src/content/docs/pl/web.mdx +142 -0
  453. package/src/content/docs/pl/windows-wsl.mdx +113 -0
  454. package/src/content/docs/pl/zen.mdx +344 -0
  455. package/src/content/docs/plugins.mdx +389 -0
  456. package/src/content/docs/policies.mdx +137 -0
  457. package/src/content/docs/providers.mdx +2501 -0
  458. package/src/content/docs/pt-br/acp.mdx +156 -0
  459. package/src/content/docs/pt-br/agents.mdx +755 -0
  460. package/src/content/docs/pt-br/cli.mdx +616 -0
  461. package/src/content/docs/pt-br/commands.mdx +322 -0
  462. package/src/content/docs/pt-br/config.mdx +687 -0
  463. package/src/content/docs/pt-br/custom-tools.mdx +196 -0
  464. package/src/content/docs/pt-br/ecosystem.mdx +78 -0
  465. package/src/content/docs/pt-br/enterprise.mdx +166 -0
  466. package/src/content/docs/pt-br/formatters.mdx +131 -0
  467. package/src/content/docs/pt-br/github.mdx +321 -0
  468. package/src/content/docs/pt-br/gitlab.mdx +195 -0
  469. package/src/content/docs/pt-br/go.mdx +238 -0
  470. package/src/content/docs/pt-br/ide.mdx +48 -0
  471. package/src/content/docs/pt-br/index.mdx +344 -0
  472. package/src/content/docs/pt-br/keybinds.mdx +194 -0
  473. package/src/content/docs/pt-br/lsp.mdx +208 -0
  474. package/src/content/docs/pt-br/mcp-servers.mdx +511 -0
  475. package/src/content/docs/pt-br/models.mdx +222 -0
  476. package/src/content/docs/pt-br/network.mdx +57 -0
  477. package/src/content/docs/pt-br/permissions.mdx +235 -0
  478. package/src/content/docs/pt-br/plugins.mdx +388 -0
  479. package/src/content/docs/pt-br/providers.mdx +1989 -0
  480. package/src/content/docs/pt-br/rules.mdx +180 -0
  481. package/src/content/docs/pt-br/sdk.mdx +463 -0
  482. package/src/content/docs/pt-br/server.mdx +284 -0
  483. package/src/content/docs/pt-br/share.mdx +127 -0
  484. package/src/content/docs/pt-br/skills.mdx +222 -0
  485. package/src/content/docs/pt-br/themes.mdx +369 -0
  486. package/src/content/docs/pt-br/tools.mdx +341 -0
  487. package/src/content/docs/pt-br/troubleshooting.mdx +299 -0
  488. package/src/content/docs/pt-br/tui.mdx +426 -0
  489. package/src/content/docs/pt-br/web.mdx +142 -0
  490. package/src/content/docs/pt-br/windows-wsl.mdx +113 -0
  491. package/src/content/docs/pt-br/zen.mdx +327 -0
  492. package/src/content/docs/references.mdx +157 -0
  493. package/src/content/docs/ru/acp.mdx +156 -0
  494. package/src/content/docs/ru/agents.mdx +754 -0
  495. package/src/content/docs/ru/cli.mdx +617 -0
  496. package/src/content/docs/ru/commands.mdx +323 -0
  497. package/src/content/docs/ru/config.mdx +685 -0
  498. package/src/content/docs/ru/custom-tools.mdx +170 -0
  499. package/src/content/docs/ru/ecosystem.mdx +78 -0
  500. package/src/content/docs/ru/enterprise.mdx +168 -0
  501. package/src/content/docs/ru/formatters.mdx +119 -0
  502. package/src/content/docs/ru/github.mdx +321 -0
  503. package/src/content/docs/ru/gitlab.mdx +195 -0
  504. package/src/content/docs/ru/go.mdx +238 -0
  505. package/src/content/docs/ru/ide.mdx +48 -0
  506. package/src/content/docs/ru/index.mdx +356 -0
  507. package/src/content/docs/ru/keybinds.mdx +194 -0
  508. package/src/content/docs/ru/lsp.mdx +207 -0
  509. package/src/content/docs/ru/mcp-servers.mdx +511 -0
  510. package/src/content/docs/ru/models.mdx +223 -0
  511. package/src/content/docs/ru/network.mdx +57 -0
  512. package/src/content/docs/ru/permissions.mdx +235 -0
  513. package/src/content/docs/ru/plugins.mdx +385 -0
  514. package/src/content/docs/ru/providers.mdx +1987 -0
  515. package/src/content/docs/ru/rules.mdx +180 -0
  516. package/src/content/docs/ru/sdk.mdx +463 -0
  517. package/src/content/docs/ru/server.mdx +287 -0
  518. package/src/content/docs/ru/share.mdx +128 -0
  519. package/src/content/docs/ru/skills.mdx +222 -0
  520. package/src/content/docs/ru/themes.mdx +369 -0
  521. package/src/content/docs/ru/tools.mdx +341 -0
  522. package/src/content/docs/ru/troubleshooting.mdx +300 -0
  523. package/src/content/docs/ru/tui.mdx +429 -0
  524. package/src/content/docs/ru/web.mdx +142 -0
  525. package/src/content/docs/ru/windows-wsl.mdx +113 -0
  526. package/src/content/docs/ru/zen.mdx +345 -0
  527. package/src/content/docs/rules.mdx +188 -0
  528. package/src/content/docs/sdk.mdx +463 -0
  529. package/src/content/docs/server.mdx +287 -0
  530. package/src/content/docs/share.mdx +128 -0
  531. package/src/content/docs/skills.mdx +222 -0
  532. package/src/content/docs/th/acp.mdx +156 -0
  533. package/src/content/docs/th/agents.mdx +744 -0
  534. package/src/content/docs/th/cli.mdx +618 -0
  535. package/src/content/docs/th/commands.mdx +320 -0
  536. package/src/content/docs/th/config.mdx +690 -0
  537. package/src/content/docs/th/custom-tools.mdx +196 -0
  538. package/src/content/docs/th/ecosystem.mdx +78 -0
  539. package/src/content/docs/th/enterprise.mdx +170 -0
  540. package/src/content/docs/th/formatters.mdx +131 -0
  541. package/src/content/docs/th/github.mdx +321 -0
  542. package/src/content/docs/th/gitlab.mdx +195 -0
  543. package/src/content/docs/th/go.mdx +224 -0
  544. package/src/content/docs/th/ide.mdx +48 -0
  545. package/src/content/docs/th/index.mdx +360 -0
  546. package/src/content/docs/th/keybinds.mdx +194 -0
  547. package/src/content/docs/th/lsp.mdx +208 -0
  548. package/src/content/docs/th/mcp-servers.mdx +511 -0
  549. package/src/content/docs/th/models.mdx +223 -0
  550. package/src/content/docs/th/network.mdx +57 -0
  551. package/src/content/docs/th/permissions.mdx +235 -0
  552. package/src/content/docs/th/plugins.mdx +389 -0
  553. package/src/content/docs/th/providers.mdx +2532 -0
  554. package/src/content/docs/th/rules.mdx +180 -0
  555. package/src/content/docs/th/sdk.mdx +463 -0
  556. package/src/content/docs/th/server.mdx +287 -0
  557. package/src/content/docs/th/share.mdx +128 -0
  558. package/src/content/docs/th/skills.mdx +222 -0
  559. package/src/content/docs/th/themes.mdx +369 -0
  560. package/src/content/docs/th/tools.mdx +341 -0
  561. package/src/content/docs/th/troubleshooting.mdx +300 -0
  562. package/src/content/docs/th/tui.mdx +429 -0
  563. package/src/content/docs/th/web.mdx +142 -0
  564. package/src/content/docs/th/windows-wsl.mdx +113 -0
  565. package/src/content/docs/th/zen.mdx +329 -0
  566. package/src/content/docs/themes.mdx +369 -0
  567. package/src/content/docs/tools.mdx +345 -0
  568. package/src/content/docs/tr/acp.mdx +156 -0
  569. package/src/content/docs/tr/agents.mdx +754 -0
  570. package/src/content/docs/tr/cli.mdx +617 -0
  571. package/src/content/docs/tr/commands.mdx +323 -0
  572. package/src/content/docs/tr/config.mdx +687 -0
  573. package/src/content/docs/tr/custom-tools.mdx +196 -0
  574. package/src/content/docs/tr/ecosystem.mdx +78 -0
  575. package/src/content/docs/tr/enterprise.mdx +170 -0
  576. package/src/content/docs/tr/formatters.mdx +131 -0
  577. package/src/content/docs/tr/github.mdx +321 -0
  578. package/src/content/docs/tr/gitlab.mdx +195 -0
  579. package/src/content/docs/tr/go.mdx +224 -0
  580. package/src/content/docs/tr/ide.mdx +48 -0
  581. package/src/content/docs/tr/index.mdx +347 -0
  582. package/src/content/docs/tr/keybinds.mdx +194 -0
  583. package/src/content/docs/tr/lsp.mdx +208 -0
  584. package/src/content/docs/tr/mcp-servers.mdx +511 -0
  585. package/src/content/docs/tr/models.mdx +223 -0
  586. package/src/content/docs/tr/network.mdx +57 -0
  587. package/src/content/docs/tr/permissions.mdx +235 -0
  588. package/src/content/docs/tr/plugins.mdx +388 -0
  589. package/src/content/docs/tr/providers.mdx +1988 -0
  590. package/src/content/docs/tr/rules.mdx +180 -0
  591. package/src/content/docs/tr/sdk.mdx +463 -0
  592. package/src/content/docs/tr/server.mdx +285 -0
  593. package/src/content/docs/tr/share.mdx +127 -0
  594. package/src/content/docs/tr/skills.mdx +222 -0
  595. package/src/content/docs/tr/themes.mdx +369 -0
  596. package/src/content/docs/tr/tools.mdx +341 -0
  597. package/src/content/docs/tr/troubleshooting.mdx +299 -0
  598. package/src/content/docs/tr/tui.mdx +427 -0
  599. package/src/content/docs/tr/web.mdx +142 -0
  600. package/src/content/docs/tr/windows-wsl.mdx +113 -0
  601. package/src/content/docs/tr/zen.mdx +327 -0
  602. package/src/content/docs/troubleshooting.mdx +314 -0
  603. package/src/content/docs/tui.mdx +427 -0
  604. package/src/content/docs/web.mdx +142 -0
  605. package/src/content/docs/windows-wsl.mdx +112 -0
  606. package/src/content/docs/zen.mdx +345 -0
  607. package/src/content/docs/zh-cn/acp.mdx +156 -0
  608. package/src/content/docs/zh-cn/agents.mdx +754 -0
  609. package/src/content/docs/zh-cn/cli.mdx +617 -0
  610. package/src/content/docs/zh-cn/commands.mdx +322 -0
  611. package/src/content/docs/zh-cn/config.mdx +683 -0
  612. package/src/content/docs/zh-cn/custom-tools.mdx +196 -0
  613. package/src/content/docs/zh-cn/ecosystem.mdx +78 -0
  614. package/src/content/docs/zh-cn/enterprise.mdx +165 -0
  615. package/src/content/docs/zh-cn/formatters.mdx +132 -0
  616. package/src/content/docs/zh-cn/github.mdx +321 -0
  617. package/src/content/docs/zh-cn/gitlab.mdx +194 -0
  618. package/src/content/docs/zh-cn/go.mdx +224 -0
  619. package/src/content/docs/zh-cn/ide.mdx +48 -0
  620. package/src/content/docs/zh-cn/index.mdx +343 -0
  621. package/src/content/docs/zh-cn/keybinds.mdx +194 -0
  622. package/src/content/docs/zh-cn/lsp.mdx +208 -0
  623. package/src/content/docs/zh-cn/mcp-servers.mdx +511 -0
  624. package/src/content/docs/zh-cn/models.mdx +222 -0
  625. package/src/content/docs/zh-cn/network.mdx +57 -0
  626. package/src/content/docs/zh-cn/permissions.mdx +235 -0
  627. package/src/content/docs/zh-cn/plugins.mdx +388 -0
  628. package/src/content/docs/zh-cn/providers.mdx +1949 -0
  629. package/src/content/docs/zh-cn/rules.mdx +180 -0
  630. package/src/content/docs/zh-cn/sdk.mdx +463 -0
  631. package/src/content/docs/zh-cn/server.mdx +284 -0
  632. package/src/content/docs/zh-cn/share.mdx +127 -0
  633. package/src/content/docs/zh-cn/skills.mdx +222 -0
  634. package/src/content/docs/zh-cn/themes.mdx +369 -0
  635. package/src/content/docs/zh-cn/tools.mdx +341 -0
  636. package/src/content/docs/zh-cn/troubleshooting.mdx +299 -0
  637. package/src/content/docs/zh-cn/tui.mdx +426 -0
  638. package/src/content/docs/zh-cn/web.mdx +142 -0
  639. package/src/content/docs/zh-cn/windows-wsl.mdx +112 -0
  640. package/src/content/docs/zh-cn/zen.mdx +327 -0
  641. package/src/content/docs/zh-tw/acp.mdx +156 -0
  642. package/src/content/docs/zh-tw/agents.mdx +754 -0
  643. package/src/content/docs/zh-tw/cli.mdx +617 -0
  644. package/src/content/docs/zh-tw/commands.mdx +322 -0
  645. package/src/content/docs/zh-tw/config.mdx +687 -0
  646. package/src/content/docs/zh-tw/custom-tools.mdx +196 -0
  647. package/src/content/docs/zh-tw/ecosystem.mdx +78 -0
  648. package/src/content/docs/zh-tw/enterprise.mdx +165 -0
  649. package/src/content/docs/zh-tw/formatters.mdx +132 -0
  650. package/src/content/docs/zh-tw/github.mdx +321 -0
  651. package/src/content/docs/zh-tw/gitlab.mdx +194 -0
  652. package/src/content/docs/zh-tw/go.mdx +224 -0
  653. package/src/content/docs/zh-tw/ide.mdx +48 -0
  654. package/src/content/docs/zh-tw/index.mdx +343 -0
  655. package/src/content/docs/zh-tw/keybinds.mdx +194 -0
  656. package/src/content/docs/zh-tw/lsp.mdx +208 -0
  657. package/src/content/docs/zh-tw/mcp-servers.mdx +511 -0
  658. package/src/content/docs/zh-tw/models.mdx +222 -0
  659. package/src/content/docs/zh-tw/network.mdx +57 -0
  660. package/src/content/docs/zh-tw/permissions.mdx +235 -0
  661. package/src/content/docs/zh-tw/plugins.mdx +388 -0
  662. package/src/content/docs/zh-tw/providers.mdx +1970 -0
  663. package/src/content/docs/zh-tw/rules.mdx +180 -0
  664. package/src/content/docs/zh-tw/sdk.mdx +463 -0
  665. package/src/content/docs/zh-tw/server.mdx +284 -0
  666. package/src/content/docs/zh-tw/share.mdx +127 -0
  667. package/src/content/docs/zh-tw/skills.mdx +222 -0
  668. package/src/content/docs/zh-tw/themes.mdx +369 -0
  669. package/src/content/docs/zh-tw/tools.mdx +341 -0
  670. package/src/content/docs/zh-tw/troubleshooting.mdx +299 -0
  671. package/src/content/docs/zh-tw/tui.mdx +426 -0
  672. package/src/content/docs/zh-tw/web.mdx +142 -0
  673. package/src/content/docs/zh-tw/windows-wsl.mdx +112 -0
  674. package/src/content/docs/zh-tw/zen.mdx +333 -0
  675. package/src/content/i18n/ar.json +75 -0
  676. package/src/content/i18n/bs.json +75 -0
  677. package/src/content/i18n/da.json +75 -0
  678. package/src/content/i18n/de.json +75 -0
  679. package/src/content/i18n/en.json +75 -0
  680. package/src/content/i18n/es.json +75 -0
  681. package/src/content/i18n/fr.json +75 -0
  682. package/src/content/i18n/it.json +75 -0
  683. package/src/content/i18n/ja.json +75 -0
  684. package/src/content/i18n/ko.json +75 -0
  685. package/src/content/i18n/nb.json +75 -0
  686. package/src/content/i18n/pl.json +75 -0
  687. package/src/content/i18n/pt-BR.json +75 -0
  688. package/src/content/i18n/ru.json +75 -0
  689. package/src/content/i18n/th.json +75 -0
  690. package/src/content/i18n/tr.json +75 -0
  691. package/src/content/i18n/zh-CN.json +75 -0
  692. package/src/content/i18n/zh-TW.json +75 -0
  693. package/src/content.config.ts +16 -0
  694. package/src/i18n/locales.ts +117 -0
  695. package/src/middleware.ts +94 -0
  696. package/src/pages/[...slug].md.ts +34 -0
  697. package/src/pages/s/[id].astro +164 -0
  698. package/src/styles/custom.css +405 -0
  699. package/src/types/lang-map.d.ts +27 -0
  700. package/src/types/starlight-virtual.d.ts +14 -0
  701. package/sst-env.d.ts +10 -0
  702. package/tsconfig.json +9 -0
@@ -0,0 +1,1949 @@
1
+ ---
2
+ title: 提供商
3
+ description: 在 OpenCode 中使用任意 LLM 提供商。
4
+ ---
5
+
6
+ import config from "../../../../config.mjs"
7
+ export const console = config.console
8
+
9
+ OpenCode 使用 [AI SDK](https://ai-sdk.dev/) 和 [Models.dev](https://models.dev),支持 **75+ LLM 提供商**,同时也支持运行本地模型。
10
+
11
+ 要添加提供商,你需要:
12
+
13
+ 1. 使用 `/connect` 命令添加提供商的 API 密钥。
14
+ 2. 在 OpenCode 配置中设置该提供商。
15
+
16
+ ---
17
+
18
+ ### 凭据
19
+
20
+ 使用 `/connect` 命令添加提供商的 API 密钥后,凭据会存储在
21
+ `~/.local/share/opencode/auth.json` 中。
22
+
23
+ ---
24
+
25
+ ### 配置
26
+
27
+ 你可以通过 OpenCode 配置中的 `provider` 部分来自定义提供商。
28
+
29
+ ---
30
+
31
+ #### 自定义 Base URL
32
+
33
+ 你可以通过设置 `baseURL` 选项来自定义任何提供商的 Base URL。这在使用代理服务或自定义端点时非常有用。
34
+
35
+ ```json title="opencode.json" {6}
36
+ {
37
+ "$schema": "https://opencode.ai/config.json",
38
+ "provider": {
39
+ "anthropic": {
40
+ "options": {
41
+ "baseURL": "https://api.anthropic.com/v1"
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ ---
49
+
50
+ ## OpenCode Zen
51
+
52
+ OpenCode Zen 是由 OpenCode 团队提供的模型列表,这些模型已经过测试和验证,能够与 OpenCode 良好配合使用。[了解更多](/docs/zen)。
53
+
54
+ :::tip
55
+ 如果你是新用户,我们建议从 OpenCode Zen 开始。
56
+ :::
57
+
58
+ 1. 在 TUI 中执行 `/connect` 命令,选择 opencode,然后前往 [opencode.ai/auth](https://opencode.ai/auth)。
59
+
60
+ ```txt
61
+ /connect
62
+ ```
63
+
64
+ 2. 登录后添加账单信息,然后复制你的 API 密钥。
65
+
66
+ 3. 粘贴你的 API 密钥。
67
+
68
+ ```txt
69
+ ┌ API key
70
+
71
+
72
+ └ enter
73
+ ```
74
+
75
+ 4. 在 TUI 中执行 `/models` 查看我们推荐的模型列表。
76
+
77
+ ```txt
78
+ /models
79
+ ```
80
+
81
+ 它的使用方式与 OpenCode 中的其他提供商完全相同,且完全可选。
82
+
83
+ ---
84
+
85
+ ## 目录
86
+
87
+ 下面我们来详细了解一些提供商。如果你想将某个提供商添加到列表中,欢迎提交 PR。
88
+
89
+ :::note
90
+ 没有看到你想要的提供商?欢迎提交 PR。
91
+ :::
92
+
93
+ ---
94
+
95
+ ### 302.AI
96
+
97
+ 1. 前往 [302.AI 控制台](https://302.ai/),创建账户并生成 API 密钥。
98
+
99
+ 2. 执行 `/connect` 命令并搜索 **302.AI**。
100
+
101
+ ```txt
102
+ /connect
103
+ ```
104
+
105
+ 3. 输入你的 302.AI API 密钥。
106
+
107
+ ```txt
108
+ ┌ API key
109
+
110
+
111
+ └ enter
112
+ ```
113
+
114
+ 4. 执行 `/models` 命令选择模型。
115
+
116
+ ```txt
117
+ /models
118
+ ```
119
+
120
+ ---
121
+
122
+ ### Amazon Bedrock
123
+
124
+ 要在 OpenCode 中使用 Amazon Bedrock:
125
+
126
+ 1. 前往 Amazon Bedrock 控制台中的**模型目录**,申请访问你想要使用的模型。
127
+
128
+ :::tip
129
+ 你需要先在 Amazon Bedrock 中获得对目标模型的访问权限。
130
+ :::
131
+
132
+ 2. 使用以下方法之一**配置身份验证**:
133
+
134
+ ***
135
+
136
+ #### 环境变量(快速上手)
137
+
138
+ 运行 opencode 时设置以下环境变量之一:
139
+
140
+ ```bash
141
+ # Option 1: Using AWS access keys
142
+ AWS_ACCESS_KEY_ID=XXX AWS_SECRET_ACCESS_KEY=YYY opencode
143
+
144
+ # Option 2: Using named AWS profile
145
+ AWS_PROFILE=my-profile opencode
146
+
147
+ # Option 3: Using Bedrock bearer token
148
+ AWS_BEARER_TOKEN_BEDROCK=XXX opencode
149
+ ```
150
+
151
+ 或者将它们添加到你的 bash 配置文件中:
152
+
153
+ ```bash title="~/.bash_profile"
154
+ export AWS_PROFILE=my-dev-profile
155
+ export AWS_REGION=us-east-1
156
+ ```
157
+
158
+ ***
159
+
160
+ #### 配置文件(推荐)
161
+
162
+ 如需项目级别或持久化的配置,请使用 `opencode.json`:
163
+
164
+ ```json title="opencode.json"
165
+ {
166
+ "$schema": "https://opencode.ai/config.json",
167
+ "provider": {
168
+ "amazon-bedrock": {
169
+ "options": {
170
+ "region": "us-east-1",
171
+ "profile": "my-aws-profile"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ ```
177
+
178
+ **可用选项:**
179
+ - `region` - AWS 区域(例如 `us-east-1`、`eu-west-1`)
180
+ - `profile` - `~/.aws/credentials` 中的 AWS 命名配置文件
181
+ - `endpoint` - VPC 端点的自定义端点 URL(通用 `baseURL` 选项的别名)
182
+
183
+ :::tip
184
+ 配置文件中的选项优先级高于环境变量。
185
+ :::
186
+
187
+ ***
188
+
189
+ #### 进阶:VPC 端点
190
+
191
+ 如果你使用 Bedrock 的 VPC 端点:
192
+
193
+ ```json title="opencode.json"
194
+ {
195
+ "$schema": "https://opencode.ai/config.json",
196
+ "provider": {
197
+ "amazon-bedrock": {
198
+ "options": {
199
+ "region": "us-east-1",
200
+ "profile": "production",
201
+ "endpoint": "https://bedrock-runtime.us-east-1.vpce-xxxxx.amazonaws.com"
202
+ }
203
+ }
204
+ }
205
+ }
206
+ ```
207
+
208
+ :::note
209
+ `endpoint` 选项是通用 `baseURL` 选项的别名,使用了 AWS 特有的术语。如果同时指定了 `endpoint` 和 `baseURL`,则 `endpoint` 优先。
210
+ :::
211
+
212
+ ***
213
+
214
+ #### 认证方式
215
+ - **`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`**:在 AWS 控制台中创建 IAM 用户并生成访问密钥
216
+ - **`AWS_PROFILE`**:使用 `~/.aws/credentials` 中的命名配置文件。需要先通过 `aws configure --profile my-profile` 或 `aws sso login` 进行配置
217
+ - **`AWS_BEARER_TOKEN_BEDROCK`**:从 Amazon Bedrock 控制台生成长期 API 密钥
218
+ - **`AWS_WEB_IDENTITY_TOKEN_FILE` / `AWS_ROLE_ARN`**:适用于 EKS IRSA(服务账户的 IAM 角色)或其他支持 OIDC 联合的 Kubernetes 环境。使用服务账户注解时,Kubernetes 会自动注入这些环境变量。
219
+
220
+ ***
221
+
222
+ #### 认证优先级
223
+
224
+ Amazon Bedrock 使用以下认证优先级:
225
+ 1. **Bearer Token** - `AWS_BEARER_TOKEN_BEDROCK` 环境变量或通过 `/connect` 命令获取的 Token
226
+ 2. **AWS 凭证链** - 配置文件、访问密钥、共享凭证、IAM 角色、Web Identity Token(EKS IRSA)、实例元数据
227
+
228
+ :::note
229
+ 当设置了 Bearer Token(通过 `/connect` 或 `AWS_BEARER_TOKEN_BEDROCK`)时,它的优先级高于所有 AWS 凭证方式,包括已配置的配置文件。
230
+ :::
231
+
232
+ 3. 执行 `/models` 命令选择你想要的模型。
233
+
234
+ ```txt
235
+ /models
236
+ ```
237
+
238
+ :::note
239
+ 对于自定义推理配置文件,请在 key 中使用模型名称和提供商名称,并将 `id` 属性设置为 ARN。这可以确保正确的缓存行为:
240
+
241
+ ```json title="opencode.json"
242
+ {
243
+ "$schema": "https://opencode.ai/config.json",
244
+ "provider": {
245
+ "amazon-bedrock": {
246
+ // ...
247
+ "models": {
248
+ "anthropic-claude-sonnet-4.5": {
249
+ "id": "arn:aws:bedrock:us-east-1:xxx:application-inference-profile/yyy"
250
+ }
251
+ }
252
+ }
253
+ }
254
+ }
255
+ ```
256
+
257
+ :::
258
+
259
+ ---
260
+
261
+ ### Anthropic
262
+
263
+ 1. 注册完成后,执行 `/connect` 命令并选择 Anthropic。
264
+
265
+ ```txt
266
+ /connect
267
+ ```
268
+
269
+ 2. 你可以选择 **Claude Pro/Max** 选项,浏览器会自动打开并要求你进行身份验证。
270
+
271
+ ```txt
272
+ ┌ Select auth method
273
+
274
+ │ Claude Pro/Max
275
+ │ Create an API Key
276
+ │ Manually enter API Key
277
+
278
+ ```
279
+
280
+ 3. 现在使用 `/models` 命令即可看到所有 Anthropic 模型。
281
+
282
+ ```txt
283
+ /models
284
+ ```
285
+
286
+ :::info
287
+ 在 OpenCode 中使用 Claude Pro/Max 订阅不是 [Anthropic](https://anthropic.com) 官方支持的用法。
288
+ :::
289
+
290
+ ##### 使用 API 密钥
291
+
292
+ 如果你没有 Pro/Max 订阅,也可以选择 **Create an API Key**。浏览器会自动打开并要求你登录 Anthropic,然后会提供一个代码供你粘贴到终端中。
293
+
294
+ 如果你已经有 API 密钥,可以选择 **Manually enter API Key** 并将其粘贴到终端中。
295
+
296
+ ---
297
+
298
+ ### Atomic Chat
299
+
300
+ 你可以通过 [Atomic Chat](https://atomic.chat) 配置 opencode 以使用本地模型。Atomic Chat 是一款桌面应用程序,它在 OpenAI 兼容的 API 服务器后面运行本地 LLM(默认端点 `http://127.0.0.1:1337/v1`)。
301
+
302
+ ```json title="opencode.json" "atomic-chat" {5, 6, 8, 10-14}
303
+ {
304
+ "$schema": "https://opencode.ai/config.json",
305
+ "provider": {
306
+ "atomic-chat": {
307
+ "npm": "@ai-sdk/openai-compatible",
308
+ "name": "Atomic Chat (local)",
309
+ "options": {
310
+ "baseURL": "http://127.0.0.1:1337/v1"
311
+ },
312
+ "models": {
313
+ "<your-model-id>": {
314
+ "name": "<your-model-name>"
315
+ }
316
+ }
317
+ }
318
+ }
319
+ }
320
+ ```
321
+
322
+ 在此示例中:
323
+
324
+ - `atomic-chat` 是自定义的提供商 ID。可以是任何你想要的字符串。
325
+ - `npm` 指定此提供商使用的包。这里使用 `@ai-sdk/openai-compatible` 来连接任何 OpenAI 兼容的 API。
326
+ - `name` 是提供商在界面中显示的名称。
327
+ - `options.baseURL` 是本地服务器的端点。根据你的 Atomic Chat 设置修改主机和端口。
328
+ - `models` 是模型 ID 到其显示名称的映射。每个 ID 必须与 `GET /v1/models` 返回的 `id` 匹配——运行 `curl http://127.0.0.1:1337/v1/models` 可列出 Atomic Chat 当前已加载的 ID。
329
+
330
+ :::tip
331
+ 如果工具调用工作不佳,请选择一个对 tool calling 支持较好的已加载模型(例如 Qwen-Coder 或 DeepSeek-Coder 的变体)。
332
+ :::
333
+
334
+ ---
335
+
336
+ ### Azure OpenAI
337
+
338
+ :::note
339
+ 如果遇到 "I'm sorry, but I cannot assist with that request" 错误,请尝试将 Azure 资源中的内容过滤器从 **DefaultV2** 更改为 **Default**。
340
+ :::
341
+
342
+ 1. 前往 [Azure 门户](https://portal.azure.com/)并创建 **Azure OpenAI** 资源。你需要:
343
+ - **资源名称**:这会成为你的 API 端点的一部分(`https://RESOURCE_NAME.openai.azure.com/`)
344
+ - **API 密钥**:资源中的 `KEY 1` 或 `KEY 2`
345
+
346
+ 2. 前往 [Azure AI Foundry](https://ai.azure.com/) 并部署一个模型。
347
+
348
+ :::note
349
+ 部署名称必须与模型名称一致,OpenCode 才能正常工作。
350
+ :::
351
+
352
+ 3. 执行 `/connect` 命令并搜索 **Azure**。
353
+
354
+ ```txt
355
+ /connect
356
+ ```
357
+
358
+ 4. 输入你的 API 密钥。
359
+
360
+ ```txt
361
+ ┌ API key
362
+
363
+
364
+ └ enter
365
+ ```
366
+
367
+ 5. 将资源名称设置为环境变量:
368
+
369
+ ```bash
370
+ AZURE_RESOURCE_NAME=XXX opencode
371
+ ```
372
+
373
+ 或者添加到你的 bash 配置文件中:
374
+
375
+ ```bash title="~/.bash_profile"
376
+ export AZURE_RESOURCE_NAME=XXX
377
+ ```
378
+
379
+ 6. 执行 `/models` 命令选择你已部署的模型。
380
+
381
+ ```txt
382
+ /models
383
+ ```
384
+
385
+ ---
386
+
387
+ ### Azure Cognitive Services
388
+
389
+ 1. 前往 [Azure 门户](https://portal.azure.com/)并创建 **Azure OpenAI** 资源。你需要:
390
+ - **资源名称**:这会成为你的 API 端点的一部分(`https://AZURE_COGNITIVE_SERVICES_RESOURCE_NAME.cognitiveservices.azure.com/`)
391
+ - **API 密钥**:资源中的 `KEY 1` 或 `KEY 2`
392
+
393
+ 2. 前往 [Azure AI Foundry](https://ai.azure.com/) 并部署一个模型。
394
+
395
+ :::note
396
+ 部署名称必须与模型名称一致,OpenCode 才能正常工作。
397
+ :::
398
+
399
+ 3. 执行 `/connect` 命令并搜索 **Azure Cognitive Services**。
400
+
401
+ ```txt
402
+ /connect
403
+ ```
404
+
405
+ 4. 输入你的 API 密钥。
406
+
407
+ ```txt
408
+ ┌ API key
409
+
410
+
411
+ └ enter
412
+ ```
413
+
414
+ 5. 将资源名称设置为环境变量:
415
+
416
+ ```bash
417
+ AZURE_COGNITIVE_SERVICES_RESOURCE_NAME=XXX opencode
418
+ ```
419
+
420
+ 或者添加到你的 bash 配置文件中:
421
+
422
+ ```bash title="~/.bash_profile"
423
+ export AZURE_COGNITIVE_SERVICES_RESOURCE_NAME=XXX
424
+ ```
425
+
426
+ 6. 执行 `/models` 命令选择你已部署的模型。
427
+
428
+ ```txt
429
+ /models
430
+ ```
431
+
432
+ ---
433
+
434
+ ### Baseten
435
+
436
+ 1. 前往 [Baseten](https://app.baseten.co/),创建账户并生成 API 密钥。
437
+
438
+ 2. 执行 `/connect` 命令并搜索 **Baseten**。
439
+
440
+ ```txt
441
+ /connect
442
+ ```
443
+
444
+ 3. 输入你的 Baseten API 密钥。
445
+
446
+ ```txt
447
+ ┌ API key
448
+
449
+
450
+ └ enter
451
+ ```
452
+
453
+ 4. 执行 `/models` 命令选择模型。
454
+
455
+ ```txt
456
+ /models
457
+ ```
458
+
459
+ ---
460
+
461
+ ### Cerebras
462
+
463
+ 1. 前往 [Cerebras 控制台](https://inference.cerebras.ai/),创建账户并生成 API 密钥。
464
+
465
+ 2. 执行 `/connect` 命令并搜索 **Cerebras**。
466
+
467
+ ```txt
468
+ /connect
469
+ ```
470
+
471
+ 3. 输入你的 Cerebras API 密钥。
472
+
473
+ ```txt
474
+ ┌ API key
475
+
476
+
477
+ └ enter
478
+ ```
479
+
480
+ 4. 执行 `/models` 命令选择模型,例如 _Qwen 3 Coder 480B_。
481
+
482
+ ```txt
483
+ /models
484
+ ```
485
+
486
+ ---
487
+
488
+ ### Cloudflare AI Gateway
489
+
490
+ Cloudflare AI Gateway 允许你通过统一端点访问来自 OpenAI、Anthropic、Workers AI 等提供商的模型。通过 [Unified Billing](https://developers.cloudflare.com/ai-gateway/features/unified-billing/),你无需为每个提供商单独准备 API 密钥。
491
+
492
+ 1. 前往 [Cloudflare 仪表盘](https://dash.cloudflare.com/),导航到 **AI** > **AI Gateway**,创建一个新的网关。
493
+
494
+ 2. 将你的 Account ID 和 Gateway ID 设置为环境变量。
495
+
496
+ ```bash title="~/.bash_profile"
497
+ export CLOUDFLARE_ACCOUNT_ID=your-32-character-account-id
498
+ export CLOUDFLARE_GATEWAY_ID=your-gateway-id
499
+ ```
500
+
501
+ 3. 执行 `/connect` 命令并搜索 **Cloudflare AI Gateway**。
502
+
503
+ ```txt
504
+ /connect
505
+ ```
506
+
507
+ 4. 输入你的 Cloudflare API Token。
508
+
509
+ ```txt
510
+ ┌ API key
511
+
512
+
513
+ └ enter
514
+ ```
515
+
516
+ 或者将其设置为环境变量。
517
+
518
+ ```bash title="~/.bash_profile"
519
+ export CLOUDFLARE_API_TOKEN=your-api-token
520
+ ```
521
+
522
+ 5. 执行 `/models` 命令选择模型。
523
+
524
+ ```txt
525
+ /models
526
+ ```
527
+
528
+ 你也可以通过 OpenCode 配置添加模型。
529
+
530
+ ```json title="opencode.json"
531
+ {
532
+ "$schema": "https://opencode.ai/config.json",
533
+ "provider": {
534
+ "cloudflare-ai-gateway": {
535
+ "models": {
536
+ "openai/gpt-4o": {},
537
+ "anthropic/claude-sonnet-4": {}
538
+ }
539
+ }
540
+ }
541
+ }
542
+ ```
543
+
544
+ ---
545
+
546
+ ### Cortecs
547
+
548
+ 1. 前往 [Cortecs 控制台](https://cortecs.ai/),创建账户并生成 API 密钥。
549
+
550
+ 2. 执行 `/connect` 命令并搜索 **Cortecs**。
551
+
552
+ ```txt
553
+ /connect
554
+ ```
555
+
556
+ 3. 输入你的 Cortecs API 密钥。
557
+
558
+ ```txt
559
+ ┌ API key
560
+
561
+
562
+ └ enter
563
+ ```
564
+
565
+ 4. 执行 `/models` 命令选择模型,例如 _Kimi K2 Instruct_。
566
+
567
+ ```txt
568
+ /models
569
+ ```
570
+
571
+ ---
572
+
573
+ ### DeepSeek
574
+
575
+ 1. 前往 [DeepSeek 控制台](https://platform.deepseek.com/),创建账户并点击 **Create new API key**。
576
+
577
+ 2. 执行 `/connect` 命令并搜索 **DeepSeek**。
578
+
579
+ ```txt
580
+ /connect
581
+ ```
582
+
583
+ 3. 输入你的 DeepSeek API 密钥。
584
+
585
+ ```txt
586
+ ┌ API key
587
+
588
+
589
+ └ enter
590
+ ```
591
+
592
+ 4. 执行 `/models` 命令选择 DeepSeek 模型,例如 _DeepSeek V4 Pro_。
593
+
594
+ ```txt
595
+ /models
596
+ ```
597
+
598
+ ---
599
+
600
+ ### Deep Infra
601
+
602
+ 1. 前往 [Deep Infra 仪表盘](https://deepinfra.com/dash),创建账户并生成 API 密钥。
603
+
604
+ 2. 执行 `/connect` 命令并搜索 **Deep Infra**。
605
+
606
+ ```txt
607
+ /connect
608
+ ```
609
+
610
+ 3. 输入你的 Deep Infra API 密钥。
611
+
612
+ ```txt
613
+ ┌ API key
614
+
615
+
616
+ └ enter
617
+ ```
618
+
619
+ 4. 执行 `/models` 命令选择模型。
620
+
621
+ ```txt
622
+ /models
623
+ ```
624
+
625
+ ---
626
+
627
+ ### FrogBot
628
+
629
+ 1. 前往 [FrogBot 仪表盘](https://app.frogbot.ai/signup),创建账户并生成 API 密钥。
630
+
631
+ 2. 执行 `/connect` 命令并搜索 **FrogBot**。
632
+
633
+ ```txt
634
+ /connect
635
+ ```
636
+
637
+ 3. 输入你的 FrogBot API 密钥。
638
+
639
+ ```txt
640
+ ┌ API key
641
+
642
+
643
+ └ enter
644
+ ```
645
+
646
+ 4. 执行 `/models` 命令选择模型。
647
+
648
+ ```txt
649
+ /models
650
+ ```
651
+
652
+ ---
653
+
654
+ ### Fireworks AI
655
+
656
+ 1. 前往 [Fireworks AI 控制台](https://app.fireworks.ai/),创建账户并点击 **Create API Key**。
657
+
658
+ 2. 执行 `/connect` 命令并搜索 **Fireworks AI**。
659
+
660
+ ```txt
661
+ /connect
662
+ ```
663
+
664
+ 3. 输入你的 Fireworks AI API 密钥。
665
+
666
+ ```txt
667
+ ┌ API key
668
+
669
+
670
+ └ enter
671
+ ```
672
+
673
+ 4. 执行 `/models` 命令选择模型,例如 _Kimi K2 Instruct_。
674
+
675
+ ```txt
676
+ /models
677
+ ```
678
+
679
+ ---
680
+
681
+ ### GitLab Duo
682
+
683
+ GitLab Duo 通过 GitLab 的 Anthropic 代理提供具有原生工具调用能力的 AI 驱动的代理聊天。
684
+
685
+ 1. 执行 `/connect` 命令并选择 GitLab。
686
+
687
+ ```txt
688
+ /connect
689
+ ```
690
+
691
+ 2. 选择你的身份验证方式:
692
+
693
+ ```txt
694
+ ┌ Select auth method
695
+
696
+ │ OAuth (Recommended)
697
+ │ Personal Access Token
698
+
699
+ ```
700
+
701
+ #### 使用 OAuth(推荐)
702
+
703
+ 选择 **OAuth**,浏览器会自动打开进行授权。
704
+
705
+ #### 使用个人访问令牌
706
+ 1. 前往 [GitLab 用户设置 > Access Tokens](https://gitlab.com/-/user_settings/personal_access_tokens)
707
+ 2. 点击 **Add new token**
708
+ 3. 名称填写 `OpenCode`,范围选择 `api`
709
+ 4. 复制令牌(以 `glpat-` 开头)
710
+ 5. 在终端中输入该令牌
711
+
712
+ 3. 执行 `/models` 命令查看可用模型。
713
+
714
+ ```txt
715
+ /models
716
+ ```
717
+
718
+ 提供三个基于 Claude 的模型:
719
+ - **duo-chat-haiku-4-5**(默认)- 快速响应,适合简单任务
720
+ - **duo-chat-sonnet-4-5** - 性能均衡,适合大多数工作流
721
+ - **duo-chat-opus-4-5** - 最强大,适合复杂分析
722
+
723
+ :::note
724
+ 你也可以通过指定 `GITLAB_TOKEN` 环境变量来避免将令牌存储在 OpenCode 的认证存储中。
725
+ :::
726
+
727
+ ##### 自托管 GitLab
728
+
729
+ :::note[合规说明]
730
+ OpenCode 会使用一个小模型来执行部分 AI 任务,例如生成会话标题。默认情况下使用由 Zen 托管的 gpt-5-nano。如果你需要让 OpenCode 仅使用你自己的 GitLab 托管实例,请在 `opencode.json` 文件中添加以下内容。同时建议禁用会话共享。
731
+
732
+ ```json
733
+ {
734
+ "$schema": "https://opencode.ai/config.json",
735
+ "small_model": "gitlab/duo-chat-haiku-4-5",
736
+ "share": "disabled"
737
+ }
738
+ ```
739
+
740
+ :::
741
+
742
+ 对于自托管 GitLab 实例:
743
+
744
+ ```bash
745
+ export GITLAB_INSTANCE_URL=https://gitlab.company.com
746
+ export GITLAB_TOKEN=glpat-...
747
+ ```
748
+
749
+ 如果你的实例运行了自定义 AI Gateway:
750
+
751
+ ```bash
752
+ GITLAB_AI_GATEWAY_URL=https://ai-gateway.company.com
753
+ ```
754
+
755
+ 或者添加到你的 bash 配置文件中:
756
+
757
+ ```bash title="~/.bash_profile"
758
+ export GITLAB_INSTANCE_URL=https://gitlab.company.com
759
+ export GITLAB_AI_GATEWAY_URL=https://ai-gateway.company.com
760
+ export GITLAB_TOKEN=glpat-...
761
+ ```
762
+
763
+ :::note
764
+ 你的 GitLab 管理员必须启用以下功能:
765
+
766
+ 1. 为用户、群组或实例启用 [Duo Agent Platform](https://docs.gitlab.com/user/duo_agent_platform/turn_on_off/)
767
+ 2. 功能标志(通过 Rails 控制台):
768
+ - `agent_platform_claude_code`
769
+ - `third_party_agents_enabled`
770
+ :::
771
+
772
+ ##### 自托管实例的 OAuth
773
+
774
+ 要在自托管实例上使用 OAuth,你需要创建一个新应用(设置 → 应用),回调 URL 设置为 `http://127.0.0.1:8080/callback`,并选择以下范围:
775
+
776
+ - api(代表你访问 API)
777
+ - read_user(读取你的个人信息)
778
+ - read_repository(允许对仓库进行只读访问)
779
+
780
+ 然后将应用 ID 导出为环境变量:
781
+
782
+ ```bash
783
+ export GITLAB_OAUTH_CLIENT_ID=your_application_id_here
784
+ ```
785
+
786
+ 更多文档请参阅 [opencode-gitlab-auth](https://www.npmjs.com/package/opencode-gitlab-auth) 主页。
787
+
788
+ ##### 配置
789
+
790
+ 通过 `opencode.json` 进行自定义配置:
791
+
792
+ ```json title="opencode.json"
793
+ {
794
+ "$schema": "https://opencode.ai/config.json",
795
+ "provider": {
796
+ "gitlab": {
797
+ "options": {
798
+ "instanceUrl": "https://gitlab.com"
799
+ }
800
+ }
801
+ }
802
+ }
803
+ ```
804
+
805
+ ##### GitLab API 工具(可选,但强烈推荐)
806
+
807
+ 要访问 GitLab 工具(合并请求、Issue、流水线、CI/CD 等):
808
+
809
+ ```json title="opencode.json"
810
+ {
811
+ "$schema": "https://opencode.ai/config.json",
812
+ "plugin": ["opencode-gitlab-plugin"]
813
+ }
814
+ ```
815
+
816
+ 该插件提供全面的 GitLab 仓库管理功能,包括 MR 审查、Issue 跟踪、流水线监控等。
817
+
818
+ ---
819
+
820
+ ### GitHub Copilot
821
+
822
+ 要在 OpenCode 中使用你的 GitHub Copilot 订阅:
823
+
824
+ :::note
825
+ 部分模型可能需要 [Pro+ 订阅](https://github.com/features/copilot/plans)才能使用。
826
+ :::
827
+
828
+ 1. 执行 `/connect` 命令并搜索 GitHub Copilot。
829
+
830
+ ```txt
831
+ /connect
832
+ ```
833
+
834
+ 2. 前往 [github.com/login/device](https://github.com/login/device) 并输入验证码。
835
+
836
+ ```txt
837
+ ┌ Login with GitHub Copilot
838
+
839
+ │ https://github.com/login/device
840
+
841
+ │ Enter code: 8F43-6FCF
842
+
843
+ └ Waiting for authorization...
844
+ ```
845
+
846
+ 3. 现在执行 `/models` 命令选择你想要的模型。
847
+
848
+ ```txt
849
+ /models
850
+ ```
851
+
852
+ ---
853
+
854
+ ### Google Vertex AI
855
+
856
+ 要在 OpenCode 中使用 Google Vertex AI:
857
+
858
+ 1. 前往 Google Cloud Console 中的**模型花园**,查看你所在区域可用的模型。
859
+
860
+ :::note
861
+ 你需要一个启用了 Vertex AI API 的 Google Cloud 项目。
862
+ :::
863
+
864
+ 2. 设置所需的环境变量:
865
+ - `GOOGLE_CLOUD_PROJECT`:你的 Google Cloud 项目 ID
866
+ - `VERTEX_LOCATION`(可选):Vertex AI 的区域(默认为 `global`)
867
+ - 身份验证(选择其一):
868
+ - `GOOGLE_APPLICATION_CREDENTIALS`:服务账户 JSON 密钥文件的路径
869
+ - 使用 gcloud CLI 进行身份验证:`gcloud auth application-default login`
870
+
871
+ 在运行 opencode 时设置:
872
+
873
+ ```bash
874
+ GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json GOOGLE_CLOUD_PROJECT=your-project-id opencode
875
+ ```
876
+
877
+ 或者添加到你的 bash 配置文件中:
878
+
879
+ ```bash title="~/.bash_profile"
880
+ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
881
+ export GOOGLE_CLOUD_PROJECT=your-project-id
882
+ export VERTEX_LOCATION=global
883
+ ```
884
+
885
+ :::tip
886
+ `global` 区域可以提高可用性并减少错误,且不会产生额外费用。如果有数据驻留需求,请使用区域端点(例如 `us-central1`)。[了解更多](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#regional_and_global_endpoints)
887
+ :::
888
+
889
+ 3. 执行 `/models` 命令选择你想要的模型。
890
+
891
+ ```txt
892
+ /models
893
+ ```
894
+
895
+ ---
896
+
897
+ ### Groq
898
+
899
+ 1. 前往 [Groq 控制台](https://console.groq.com/),点击 **Create API Key** 并复制密钥。
900
+
901
+ 2. 执行 `/connect` 命令并搜索 Groq。
902
+
903
+ ```txt
904
+ /connect
905
+ ```
906
+
907
+ 3. 输入该提供商的 API 密钥。
908
+
909
+ ```txt
910
+ ┌ API key
911
+
912
+
913
+ └ enter
914
+ ```
915
+
916
+ 4. 执行 `/models` 命令选择你想要的模型。
917
+
918
+ ```txt
919
+ /models
920
+ ```
921
+
922
+ ---
923
+
924
+ ### Hugging Face
925
+
926
+ [Hugging Face Inference Providers](https://huggingface.co/docs/inference-providers) 提供对由 17+ 提供商支持的开放模型的访问。
927
+
928
+ 1. 前往 [Hugging Face 设置](https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&tokenType=fineGrained),创建一个具有调用 Inference Providers 权限的令牌。
929
+
930
+ 2. 执行 `/connect` 命令并搜索 **Hugging Face**。
931
+
932
+ ```txt
933
+ /connect
934
+ ```
935
+
936
+ 3. 输入你的 Hugging Face 令牌。
937
+
938
+ ```txt
939
+ ┌ API key
940
+
941
+
942
+ └ enter
943
+ ```
944
+
945
+ 4. 执行 `/models` 命令选择模型,例如 _Kimi-K2-Instruct_ 或 _GLM-4.6_。
946
+
947
+ ```txt
948
+ /models
949
+ ```
950
+
951
+ ---
952
+
953
+ ### Helicone
954
+
955
+ [Helicone](https://helicone.ai) 是一个 LLM 可观测性平台,为你的 AI 应用提供日志记录、监控和分析功能。Helicone AI Gateway 会根据模型自动将请求路由到对应的提供商。
956
+
957
+ 1. 前往 [Helicone](https://helicone.ai),创建账户并在仪表盘中生成 API 密钥。
958
+
959
+ 2. 执行 `/connect` 命令并搜索 **Helicone**。
960
+
961
+ ```txt
962
+ /connect
963
+ ```
964
+
965
+ 3. 输入你的 Helicone API 密钥。
966
+
967
+ ```txt
968
+ ┌ API key
969
+
970
+
971
+ └ enter
972
+ ```
973
+
974
+ 4. 执行 `/models` 命令选择模型。
975
+
976
+ ```txt
977
+ /models
978
+ ```
979
+
980
+ 如需了解更多提供商以及缓存、速率限制等高级功能,请查阅 [Helicone 文档](https://docs.helicone.ai)。
981
+
982
+ #### 可选配置
983
+
984
+ 如果 Helicone 的某些功能或模型未通过 OpenCode 自动配置,你随时可以手动配置。
985
+
986
+ [Helicone 模型目录](https://helicone.ai/models)中可以找到你需要添加的模型 ID。
987
+
988
+ ```jsonc title="~/.config/opencode/opencode.jsonc"
989
+ {
990
+ "$schema": "https://opencode.ai/config.json",
991
+ "provider": {
992
+ "helicone": {
993
+ "npm": "@ai-sdk/openai-compatible",
994
+ "name": "Helicone",
995
+ "options": {
996
+ "baseURL": "https://ai-gateway.helicone.ai",
997
+ },
998
+ "models": {
999
+ "gpt-4o": {
1000
+ // Model ID (from Helicone's model directory page)
1001
+ "name": "GPT-4o", // Your own custom name for the model
1002
+ },
1003
+ "claude-sonnet-4-20250514": {
1004
+ "name": "Claude Sonnet 4",
1005
+ },
1006
+ },
1007
+ },
1008
+ },
1009
+ }
1010
+ ```
1011
+
1012
+ #### 自定义请求头
1013
+
1014
+ Helicone 支持用于缓存、用户跟踪和会话管理等功能的自定义请求头。使用 `options.headers` 将它们添加到提供商配置中:
1015
+
1016
+ ```jsonc title="~/.config/opencode/opencode.jsonc"
1017
+ {
1018
+ "$schema": "https://opencode.ai/config.json",
1019
+ "provider": {
1020
+ "helicone": {
1021
+ "npm": "@ai-sdk/openai-compatible",
1022
+ "name": "Helicone",
1023
+ "options": {
1024
+ "baseURL": "https://ai-gateway.helicone.ai",
1025
+ "headers": {
1026
+ "Helicone-Cache-Enabled": "true",
1027
+ "Helicone-User-Id": "opencode",
1028
+ },
1029
+ },
1030
+ },
1031
+ },
1032
+ }
1033
+ ```
1034
+
1035
+ ##### 会话跟踪
1036
+
1037
+ Helicone 的 [Sessions](https://docs.helicone.ai/features/sessions) 功能允许你将相关的 LLM 请求归为一组。使用 [opencode-helicone-session](https://github.com/H2Shami/opencode-helicone-session) 插件可以自动将每个 OpenCode 对话记录为 Helicone 中的一个会话。
1038
+
1039
+ ```bash
1040
+ npm install -g opencode-helicone-session
1041
+ ```
1042
+
1043
+ 将其添加到配置中。
1044
+
1045
+ ```json title="opencode.json"
1046
+ {
1047
+ "plugin": ["opencode-helicone-session"]
1048
+ }
1049
+ ```
1050
+
1051
+ 该插件会在你的请求中注入 `Helicone-Session-Id` 和 `Helicone-Session-Name` 请求头。在 Helicone 的 Sessions 页面中,你可以看到每个 OpenCode 对话都作为独立的会话列出。
1052
+
1053
+ ##### 常用 Helicone 请求头
1054
+
1055
+ | 请求头 | 描述 |
1056
+ | -------------------------- | ------------------------------------------------------ |
1057
+ | `Helicone-Cache-Enabled` | 启用响应缓存(`true`/`false`) |
1058
+ | `Helicone-User-Id` | 按用户跟踪指标 |
1059
+ | `Helicone-Property-[Name]` | 添加自定义属性(例如 `Helicone-Property-Environment`) |
1060
+ | `Helicone-Prompt-Id` | 将请求与提示词版本关联 |
1061
+
1062
+ 有关所有可用请求头,请参阅 [Helicone Header Directory](https://docs.helicone.ai/helicone-headers/header-directory)。
1063
+
1064
+ ---
1065
+
1066
+ ### llama.cpp
1067
+
1068
+ 你可以通过 [llama.cpp](https://github.com/ggml-org/llama.cpp) 的 llama-server 工具配置 OpenCode 使用本地模型。
1069
+
1070
+ ```json title="opencode.json" "llama.cpp" {5, 6, 8, 10-15}
1071
+ {
1072
+ "$schema": "https://opencode.ai/config.json",
1073
+ "provider": {
1074
+ "llama.cpp": {
1075
+ "npm": "@ai-sdk/openai-compatible",
1076
+ "name": "llama-server (local)",
1077
+ "options": {
1078
+ "baseURL": "http://127.0.0.1:8080/v1"
1079
+ },
1080
+ "models": {
1081
+ "qwen3-coder:a3b": {
1082
+ "name": "Qwen3-Coder: a3b-30b (local)",
1083
+ "limit": {
1084
+ "context": 128000,
1085
+ "output": 65536
1086
+ }
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+ }
1092
+ ```
1093
+
1094
+ 在这个示例中:
1095
+
1096
+ - `llama.cpp` 是自定义的提供商 ID,可以是任意字符串。
1097
+ - `npm` 指定该提供商使用的包。这里使用 `@ai-sdk/openai-compatible` 来兼容任何 OpenAI 兼容的 API。
1098
+ - `name` 是该提供商在 UI 中显示的名称。
1099
+ - `options.baseURL` 是本地服务器的端点地址。
1100
+ - `models` 是模型 ID 到其配置的映射。模型名称会显示在模型选择列表中。
1101
+
1102
+ ---
1103
+
1104
+ ### IO.NET
1105
+
1106
+ IO.NET 提供 17 个针对不同用例优化的模型:
1107
+
1108
+ 1. 前往 [IO.NET 控制台](https://ai.io.net/),创建账户并生成 API 密钥。
1109
+
1110
+ 2. 执行 `/connect` 命令并搜索 **IO.NET**。
1111
+
1112
+ ```txt
1113
+ /connect
1114
+ ```
1115
+
1116
+ 3. 输入你的 IO.NET API 密钥。
1117
+
1118
+ ```txt
1119
+ ┌ API key
1120
+
1121
+
1122
+ └ enter
1123
+ ```
1124
+
1125
+ 4. 执行 `/models` 命令选择模型。
1126
+
1127
+ ```txt
1128
+ /models
1129
+ ```
1130
+
1131
+ ---
1132
+
1133
+ ### LM Studio
1134
+
1135
+ 你可以通过 LM Studio 配置 OpenCode 使用本地模型。
1136
+
1137
+ ```json title="opencode.json" "lmstudio" {5, 6, 8, 10-14}
1138
+ {
1139
+ "$schema": "https://opencode.ai/config.json",
1140
+ "provider": {
1141
+ "lmstudio": {
1142
+ "npm": "@ai-sdk/openai-compatible",
1143
+ "name": "LM Studio (local)",
1144
+ "options": {
1145
+ "baseURL": "http://127.0.0.1:1234/v1"
1146
+ },
1147
+ "models": {
1148
+ "google/gemma-3n-e4b": {
1149
+ "name": "Gemma 3n-e4b (local)"
1150
+ }
1151
+ }
1152
+ }
1153
+ }
1154
+ }
1155
+ ```
1156
+
1157
+ 在这个示例中:
1158
+
1159
+ - `lmstudio` 是自定义的提供商 ID,可以是任意字符串。
1160
+ - `npm` 指定该提供商使用的包。这里使用 `@ai-sdk/openai-compatible` 来兼容任何 OpenAI 兼容的 API。
1161
+ - `name` 是该提供商在 UI 中显示的名称。
1162
+ - `options.baseURL` 是本地服务器的端点地址。
1163
+ - `models` 是模型 ID 到其配置的映射。模型名称会显示在模型选择列表中。
1164
+
1165
+ ---
1166
+
1167
+ ### Moonshot AI
1168
+
1169
+ 要使用 Moonshot AI 的 Kimi K2:
1170
+
1171
+ 1. 前往 [Moonshot AI 控制台](https://platform.moonshot.ai/console),创建账户并点击 **Create API key**。
1172
+
1173
+ 2. 执行 `/connect` 命令并搜索 **Moonshot AI**。
1174
+
1175
+ ```txt
1176
+ /connect
1177
+ ```
1178
+
1179
+ 3. 输入你的 Moonshot API 密钥。
1180
+
1181
+ ```txt
1182
+ ┌ API key
1183
+
1184
+
1185
+ └ enter
1186
+ ```
1187
+
1188
+ 4. 执行 `/models` 命令选择 _Kimi K2_。
1189
+
1190
+ ```txt
1191
+ /models
1192
+ ```
1193
+
1194
+ ---
1195
+
1196
+ ### MiniMax
1197
+
1198
+ 1. 前往 [MiniMax API 控制台](https://platform.minimax.io/login),创建账户并生成 API 密钥。
1199
+
1200
+ 2. 执行 `/connect` 命令并搜索 **MiniMax**。
1201
+
1202
+ ```txt
1203
+ /connect
1204
+ ```
1205
+
1206
+ 3. 输入你的 MiniMax API 密钥。
1207
+
1208
+ ```txt
1209
+ ┌ API key
1210
+
1211
+
1212
+ └ enter
1213
+ ```
1214
+
1215
+ 4. 执行 `/models` 命令选择模型,例如 _M2.1_。
1216
+
1217
+ ```txt
1218
+ /models
1219
+ ```
1220
+
1221
+ ---
1222
+
1223
+ ### Nebius Token Factory
1224
+
1225
+ 1. 前往 [Nebius Token Factory 控制台](https://tokenfactory.nebius.com/),创建账户并点击 **Add Key**。
1226
+
1227
+ 2. 执行 `/connect` 命令并搜索 **Nebius Token Factory**。
1228
+
1229
+ ```txt
1230
+ /connect
1231
+ ```
1232
+
1233
+ 3. 输入你的 Nebius Token Factory API 密钥。
1234
+
1235
+ ```txt
1236
+ ┌ API key
1237
+
1238
+
1239
+ └ enter
1240
+ ```
1241
+
1242
+ 4. 执行 `/models` 命令选择模型,例如 _Kimi K2 Instruct_。
1243
+
1244
+ ```txt
1245
+ /models
1246
+ ```
1247
+
1248
+ ---
1249
+
1250
+ ### Ollama
1251
+
1252
+ 你可以通过 Ollama 配置 OpenCode 使用本地模型。
1253
+
1254
+ :::tip
1255
+ Ollama 可以自动为 OpenCode 进行配置。详见 [Ollama 集成文档](https://docs.ollama.com/integrations/opencode)。
1256
+ :::
1257
+
1258
+ ```json title="opencode.json" "ollama" {5, 6, 8, 10-14}
1259
+ {
1260
+ "$schema": "https://opencode.ai/config.json",
1261
+ "provider": {
1262
+ "ollama": {
1263
+ "npm": "@ai-sdk/openai-compatible",
1264
+ "name": "Ollama (local)",
1265
+ "options": {
1266
+ "baseURL": "http://localhost:11434/v1"
1267
+ },
1268
+ "models": {
1269
+ "llama2": {
1270
+ "name": "Llama 2"
1271
+ }
1272
+ }
1273
+ }
1274
+ }
1275
+ }
1276
+ ```
1277
+
1278
+ 在这个示例中:
1279
+
1280
+ - `ollama` 是自定义的提供商 ID,可以是任意字符串。
1281
+ - `npm` 指定该提供商使用的包。这里使用 `@ai-sdk/openai-compatible` 来兼容任何 OpenAI 兼容的 API。
1282
+ - `name` 是该提供商在 UI 中显示的名称。
1283
+ - `options.baseURL` 是本地服务器的端点地址。
1284
+ - `models` 是模型 ID 到其配置的映射。模型名称会显示在模型选择列表中。
1285
+
1286
+ :::tip
1287
+ 如果工具调用不工作,请尝试增大 Ollama 中的 `num_ctx` 值。建议从 16k - 32k 左右开始。
1288
+ :::
1289
+
1290
+ ---
1291
+
1292
+ ### Ollama Cloud
1293
+
1294
+ 要在 OpenCode 中使用 Ollama Cloud:
1295
+
1296
+ 1. 前往 [https://ollama.com/](https://ollama.com/) 登录或创建账户。
1297
+
1298
+ 2. 导航到 **Settings** > **Keys**,点击 **Add API Key** 生成新的 API 密钥。
1299
+
1300
+ 3. 复制 API 密钥以便在 OpenCode 中使用。
1301
+
1302
+ 4. 执行 `/connect` 命令并搜索 **Ollama Cloud**。
1303
+
1304
+ ```txt
1305
+ /connect
1306
+ ```
1307
+
1308
+ 5. 输入你的 Ollama Cloud API 密钥。
1309
+
1310
+ ```txt
1311
+ ┌ API key
1312
+
1313
+
1314
+ └ enter
1315
+ ```
1316
+
1317
+ 6. **重要**:在 OpenCode 中使用云端模型之前,必须先将模型信息拉取到本地:
1318
+
1319
+ ```bash
1320
+ ollama pull gpt-oss:20b-cloud
1321
+ ```
1322
+
1323
+ 7. 执行 `/models` 命令选择你的 Ollama Cloud 模型。
1324
+
1325
+ ```txt
1326
+ /models
1327
+ ```
1328
+
1329
+ ---
1330
+
1331
+ ### OpenAI
1332
+
1333
+ 我们建议注册 [ChatGPT Plus 或 Pro](https://chatgpt.com/pricing)。
1334
+
1335
+ 1. 注册完成后,执行 `/connect` 命令并选择 OpenAI。
1336
+
1337
+ ```txt
1338
+ /connect
1339
+ ```
1340
+
1341
+ 2. 你可以选择 **ChatGPT Plus/Pro** 选项,浏览器会自动打开并要求你进行身份验证。
1342
+
1343
+ ```txt
1344
+ ┌ Select auth method
1345
+
1346
+ │ ChatGPT Plus/Pro
1347
+ │ Manually enter API Key
1348
+
1349
+ ```
1350
+
1351
+ 3. 现在使用 `/models` 命令即可看到所有 OpenAI 模型。
1352
+
1353
+ ```txt
1354
+ /models
1355
+ ```
1356
+
1357
+ ##### 使用 API 密钥
1358
+
1359
+ 如果你已经有 API 密钥,可以选择 **Manually enter API Key** 并将其粘贴到终端中。
1360
+
1361
+ ---
1362
+
1363
+ ### OpenCode Zen
1364
+
1365
+ OpenCode Zen 是由 OpenCode 团队提供的经过测试和验证的模型列表。[了解更多](/docs/zen)。
1366
+
1367
+ 1. 登录 **<a href={console}>OpenCode Zen</a>** 并点击 **Create API Key**。
1368
+
1369
+ 2. 执行 `/connect` 命令并搜索 **OpenCode Zen**。
1370
+
1371
+ ```txt
1372
+ /connect
1373
+ ```
1374
+
1375
+ 3. 输入你的 OpenCode API 密钥。
1376
+
1377
+ ```txt
1378
+ ┌ API key
1379
+
1380
+
1381
+ └ enter
1382
+ ```
1383
+
1384
+ 4. 执行 `/models` 命令选择模型,例如 _Qwen 3 Coder 480B_。
1385
+
1386
+ ```txt
1387
+ /models
1388
+ ```
1389
+
1390
+ ---
1391
+
1392
+ ### OpenRouter
1393
+
1394
+ 1. 前往 [OpenRouter 仪表盘](https://openrouter.ai/settings/keys),点击 **Create API Key** 并复制密钥。
1395
+
1396
+ 2. 执行 `/connect` 命令并搜索 OpenRouter。
1397
+
1398
+ ```txt
1399
+ /connect
1400
+ ```
1401
+
1402
+ 3. 输入该提供商的 API 密钥。
1403
+
1404
+ ```txt
1405
+ ┌ API key
1406
+
1407
+
1408
+ └ enter
1409
+ ```
1410
+
1411
+ 4. 默认已预加载了许多 OpenRouter 模型,执行 `/models` 命令选择你想要的模型。
1412
+
1413
+ ```txt
1414
+ /models
1415
+ ```
1416
+
1417
+ 你也可以通过 OpenCode 配置添加更多模型。
1418
+
1419
+ ```json title="opencode.json" {6}
1420
+ {
1421
+ "$schema": "https://opencode.ai/config.json",
1422
+ "provider": {
1423
+ "openrouter": {
1424
+ "models": {
1425
+ "somecoolnewmodel": {}
1426
+ }
1427
+ }
1428
+ }
1429
+ }
1430
+ ```
1431
+
1432
+ 5. 你还可以通过 OpenCode 配置自定义模型。以下是指定提供商的示例:
1433
+
1434
+ ```json title="opencode.json"
1435
+ {
1436
+ "$schema": "https://opencode.ai/config.json",
1437
+ "provider": {
1438
+ "openrouter": {
1439
+ "models": {
1440
+ "moonshotai/kimi-k2": {
1441
+ "options": {
1442
+ "provider": {
1443
+ "order": ["baseten"],
1444
+ "allow_fallbacks": false
1445
+ }
1446
+ }
1447
+ }
1448
+ }
1449
+ }
1450
+ }
1451
+ }
1452
+ ```
1453
+
1454
+ ---
1455
+
1456
+ ### SAP AI Core
1457
+
1458
+ SAP AI Core 通过统一平台提供对来自 OpenAI、Anthropic、Google、Amazon、Meta、Mistral 和 AI21 的 40+ 模型的访问。
1459
+
1460
+ 1. 前往 [SAP BTP Cockpit](https://account.hana.ondemand.com/),导航到你的 SAP AI Core 服务实例,并创建服务密钥。
1461
+
1462
+ :::tip
1463
+ 服务密钥是一个包含 `clientid`、`clientsecret`、`url` 和 `serviceurls.AI_API_URL` 的 JSON 对象。你可以在 BTP Cockpit 的 **Services** > **Instances and Subscriptions** 下找到你的 AI Core 实例。
1464
+ :::
1465
+
1466
+ 2. 执行 `/connect` 命令并搜索 **SAP AI Core**。
1467
+
1468
+ ```txt
1469
+ /connect
1470
+ ```
1471
+
1472
+ 3. 输入你的服务密钥 JSON。
1473
+
1474
+ ```txt
1475
+ ┌ Service key
1476
+
1477
+
1478
+ └ enter
1479
+ ```
1480
+
1481
+ 或者设置 `AICORE_SERVICE_KEY` 环境变量:
1482
+
1483
+ ```bash
1484
+ AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}' opencode
1485
+ ```
1486
+
1487
+ 或者添加到你的 bash 配置文件中:
1488
+
1489
+ ```bash title="~/.bash_profile"
1490
+ export AICORE_SERVICE_KEY='{"clientid":"...","clientsecret":"...","url":"...","serviceurls":{"AI_API_URL":"..."}}'
1491
+ ```
1492
+
1493
+ 4. 可选:设置部署 ID 和资源组:
1494
+
1495
+ ```bash
1496
+ AICORE_DEPLOYMENT_ID=your-deployment-id AICORE_RESOURCE_GROUP=your-resource-group opencode
1497
+ ```
1498
+
1499
+ :::note
1500
+ 这些设置是可选的,应根据你的 SAP AI Core 配置进行设置。
1501
+ :::
1502
+
1503
+ 5. 执行 `/models` 命令从 40+ 个可用模型中进行选择。
1504
+
1505
+ ```txt
1506
+ /models
1507
+ ```
1508
+
1509
+ ---
1510
+
1511
+ ### STACKIT
1512
+
1513
+ STACKIT AI Model Serving 提供完全托管的主权托管环境,专注于 Llama、Mistral 和 Qwen 等大语言模型,在欧洲基础设施上实现最大程度的数据主权。
1514
+
1515
+ 1. 前往 [STACKIT Portal](https://portal.stackit.cloud),导航到 **AI Model Serving**,为你的项目创建认证令牌。
1516
+
1517
+ :::tip
1518
+ 你需要先拥有 STACKIT 客户账户、用户账户和项目,才能创建认证令牌。
1519
+ :::
1520
+
1521
+ 2. 执行 `/connect` 命令并搜索 **STACKIT**。
1522
+
1523
+ ```txt
1524
+ /connect
1525
+ ```
1526
+
1527
+ 3. 输入你的 STACKIT AI Model Serving 认证令牌。
1528
+
1529
+ ```txt
1530
+ ┌ API key
1531
+
1532
+
1533
+ └ enter
1534
+ ```
1535
+
1536
+ 4. 执行 `/models` 命令选择模型,例如 _Qwen3-VL 235B_ 或 _Llama 3.3 70B_。
1537
+
1538
+ ```txt
1539
+ /models
1540
+ ```
1541
+
1542
+ ---
1543
+
1544
+ ### OVHcloud AI Endpoints
1545
+
1546
+ 1. 前往 [OVHcloud 管理面板](https://ovh.com/manager)。导航到 `Public Cloud` 部分,`AI & Machine Learning` > `AI Endpoints`,在 `API Keys` 标签页中点击 **Create a new API key**。
1547
+
1548
+ 2. 执行 `/connect` 命令并搜索 **OVHcloud AI Endpoints**。
1549
+
1550
+ ```txt
1551
+ /connect
1552
+ ```
1553
+
1554
+ 3. 输入你的 OVHcloud AI Endpoints API 密钥。
1555
+
1556
+ ```txt
1557
+ ┌ API key
1558
+
1559
+
1560
+ └ enter
1561
+ ```
1562
+
1563
+ 4. 执行 `/models` 命令选择模型,例如 _gpt-oss-120b_。
1564
+
1565
+ ```txt
1566
+ /models
1567
+ ```
1568
+
1569
+ ---
1570
+
1571
+ ### Scaleway
1572
+
1573
+ 要在 OpenCode 中使用 [Scaleway Generative APIs](https://www.scaleway.com/en/docs/generative-apis/):
1574
+
1575
+ 1. 前往 [Scaleway Console IAM 设置](https://console.scaleway.com/iam/api-keys)生成新的 API 密钥。
1576
+
1577
+ 2. 执行 `/connect` 命令并搜索 **Scaleway**。
1578
+
1579
+ ```txt
1580
+ /connect
1581
+ ```
1582
+
1583
+ 3. 输入你的 Scaleway API 密钥。
1584
+
1585
+ ```txt
1586
+ ┌ API key
1587
+
1588
+
1589
+ └ enter
1590
+ ```
1591
+
1592
+ 4. 执行 `/models` 命令选择模型,例如 _devstral-2-123b-instruct-2512_ 或 _gpt-oss-120b_。
1593
+
1594
+ ```txt
1595
+ /models
1596
+ ```
1597
+
1598
+ ---
1599
+
1600
+ ### Together AI
1601
+
1602
+ 1. 前往 [Together AI 控制台](https://api.together.ai),创建账户并点击 **Add Key**。
1603
+
1604
+ 2. 执行 `/connect` 命令并搜索 **Together AI**。
1605
+
1606
+ ```txt
1607
+ /connect
1608
+ ```
1609
+
1610
+ 3. 输入你的 Together AI API 密钥。
1611
+
1612
+ ```txt
1613
+ ┌ API key
1614
+
1615
+
1616
+ └ enter
1617
+ ```
1618
+
1619
+ 4. 执行 `/models` 命令选择模型,例如 _Kimi K2 Instruct_。
1620
+
1621
+ ```txt
1622
+ /models
1623
+ ```
1624
+
1625
+ ---
1626
+
1627
+ ### Venice AI
1628
+
1629
+ 1. 前往 [Venice AI 控制台](https://venice.ai),创建账户并生成 API 密钥。
1630
+
1631
+ 2. 执行 `/connect` 命令并搜索 **Venice AI**。
1632
+
1633
+ ```txt
1634
+ /connect
1635
+ ```
1636
+
1637
+ 3. 输入你的 Venice AI API 密钥。
1638
+
1639
+ ```txt
1640
+ ┌ API key
1641
+
1642
+
1643
+ └ enter
1644
+ ```
1645
+
1646
+ 4. 执行 `/models` 命令选择模型,例如 _Llama 3.3 70B_。
1647
+
1648
+ ```txt
1649
+ /models
1650
+ ```
1651
+
1652
+ ---
1653
+
1654
+ ### Vercel AI Gateway
1655
+
1656
+ Vercel AI Gateway 允许你通过统一端点访问来自 OpenAI、Anthropic、Google、xAI 等提供商的模型。模型按原价提供,不额外加价。
1657
+
1658
+ 1. 前往 [Vercel 仪表盘](https://vercel.com/),导航到 **AI Gateway** 标签页,点击 **API keys** 创建新的 API 密钥。
1659
+
1660
+ 2. 执行 `/connect` 命令并搜索 **Vercel AI Gateway**。
1661
+
1662
+ ```txt
1663
+ /connect
1664
+ ```
1665
+
1666
+ 3. 输入你的 Vercel AI Gateway API 密钥。
1667
+
1668
+ ```txt
1669
+ ┌ API key
1670
+
1671
+
1672
+ └ enter
1673
+ ```
1674
+
1675
+ 4. 执行 `/models` 命令选择模型。
1676
+
1677
+ ```txt
1678
+ /models
1679
+ ```
1680
+
1681
+ 你也可以通过 OpenCode 配置自定义模型。以下是指定提供商路由顺序的示例。
1682
+
1683
+ ```json title="opencode.json"
1684
+ {
1685
+ "$schema": "https://opencode.ai/config.json",
1686
+ "provider": {
1687
+ "vercel": {
1688
+ "models": {
1689
+ "anthropic/claude-sonnet-4": {
1690
+ "options": {
1691
+ "order": ["anthropic", "vertex"]
1692
+ }
1693
+ }
1694
+ }
1695
+ }
1696
+ }
1697
+ }
1698
+ ```
1699
+
1700
+ 一些常用的路由选项:
1701
+
1702
+ | 选项 | 描述 |
1703
+ | ------------------- | -------------------------------- |
1704
+ | `order` | 提供商尝试顺序 |
1705
+ | `only` | 限制为特定提供商 |
1706
+ | `zeroDataRetention` | 仅使用具有零数据留存策略的提供商 |
1707
+
1708
+ ---
1709
+
1710
+ ### xAI
1711
+
1712
+ 1. 前往 [xAI 控制台](https://console.x.ai/),创建账户并生成 API 密钥。
1713
+
1714
+ 2. 执行 `/connect` 命令并搜索 **xAI**。
1715
+
1716
+ ```txt
1717
+ /connect
1718
+ ```
1719
+
1720
+ 3. 输入你的 xAI API 密钥。
1721
+
1722
+ ```txt
1723
+ ┌ API key
1724
+
1725
+
1726
+ └ enter
1727
+ ```
1728
+
1729
+ 4. 执行 `/models` 命令选择模型,例如 _Grok Beta_。
1730
+
1731
+ ```txt
1732
+ /models
1733
+ ```
1734
+
1735
+ ---
1736
+
1737
+ ### Z.AI
1738
+
1739
+ 1. 前往 [Z.AI API 控制台](https://z.ai/manage-apikey/apikey-list),创建账户并点击 **Create a new API key**。
1740
+
1741
+ 2. 执行 `/connect` 命令并搜索 **Z.AI**。
1742
+
1743
+ ```txt
1744
+ /connect
1745
+ ```
1746
+
1747
+ 如果你订阅了 **GLM Coding Plan**,请选择 **Z.AI Coding Plan**。
1748
+
1749
+ 3. 输入你的 Z.AI API 密钥。
1750
+
1751
+ ```txt
1752
+ ┌ API key
1753
+
1754
+
1755
+ └ enter
1756
+ ```
1757
+
1758
+ 4. 执行 `/models` 命令选择模型,例如 _GLM-4.7_。
1759
+
1760
+ ```txt
1761
+ /models
1762
+ ```
1763
+
1764
+ ---
1765
+
1766
+ ### ZenMux
1767
+
1768
+ 1. 前往 [ZenMux 仪表盘](https://zenmux.ai/settings/keys),点击 **Create API Key** 并复制密钥。
1769
+
1770
+ 2. 执行 `/connect` 命令并搜索 ZenMux。
1771
+
1772
+ ```txt
1773
+ /connect
1774
+ ```
1775
+
1776
+ 3. 输入该提供商的 API 密钥。
1777
+
1778
+ ```txt
1779
+ ┌ API key
1780
+
1781
+
1782
+ └ enter
1783
+ ```
1784
+
1785
+ 4. 默认已预加载了许多 ZenMux 模型,执行 `/models` 命令选择你想要的模型。
1786
+
1787
+ ```txt
1788
+ /models
1789
+ ```
1790
+
1791
+ 你也可以通过 OpenCode 配置添加更多模型。
1792
+
1793
+ ```json title="opencode.json" {6}
1794
+ {
1795
+ "$schema": "https://opencode.ai/config.json",
1796
+ "provider": {
1797
+ "zenmux": {
1798
+ "models": {
1799
+ "somecoolnewmodel": {}
1800
+ }
1801
+ }
1802
+ }
1803
+ }
1804
+ ```
1805
+
1806
+ ---
1807
+
1808
+ ## 自定义提供商
1809
+
1810
+ 要添加 `/connect` 命令中未列出的任何 **OpenAI 兼容**提供商:
1811
+
1812
+ :::tip
1813
+ 你可以在 OpenCode 中使用任何 OpenAI 兼容的提供商。大多数现代 AI 提供商都提供 OpenAI 兼容的 API。
1814
+ :::
1815
+
1816
+ 1. 执行 `/connect` 命令,向下滚动到 **Other**。
1817
+
1818
+ ```bash
1819
+ $ /connect
1820
+
1821
+ ┌ Add credential
1822
+
1823
+ ◆ Select provider
1824
+ │ ...
1825
+ │ ● Other
1826
+
1827
+ ```
1828
+
1829
+ 2. 输入该提供商的唯一 ID。
1830
+
1831
+ ```bash
1832
+ $ /connect
1833
+
1834
+ ┌ Add credential
1835
+
1836
+ ◇ Enter provider id
1837
+ │ myprovider
1838
+
1839
+ ```
1840
+
1841
+ :::note
1842
+ 请选择一个容易记住的 ID,你将在配置文件中使用它。
1843
+ :::
1844
+
1845
+ 3. 输入该提供商的 API 密钥。
1846
+
1847
+ ```bash
1848
+ $ /connect
1849
+
1850
+ ┌ Add credential
1851
+
1852
+ ▲ This only stores a credential for myprovider - you will need to configure it in opencode.json, check the docs for examples.
1853
+
1854
+ ◇ Enter your API key
1855
+ │ sk-...
1856
+
1857
+ ```
1858
+
1859
+ 4. 在项目目录中创建或更新 `opencode.json` 文件:
1860
+
1861
+ ```json title="opencode.json" ""myprovider"" {5-15}
1862
+ {
1863
+ "$schema": "https://opencode.ai/config.json",
1864
+ "provider": {
1865
+ "myprovider": {
1866
+ "npm": "@ai-sdk/openai-compatible",
1867
+ "name": "My AI ProviderDisplay Name",
1868
+ "options": {
1869
+ "baseURL": "https://api.myprovider.com/v1"
1870
+ },
1871
+ "models": {
1872
+ "my-model-name": {
1873
+ "name": "My Model Display Name"
1874
+ }
1875
+ }
1876
+ }
1877
+ }
1878
+ }
1879
+ ```
1880
+
1881
+ 以下是配置选项说明:
1882
+ - **npm**:要使用的 AI SDK 包,对于 OpenAI 兼容的提供商使用 `@ai-sdk/openai-compatible`(适用于 `/v1/chat/completions`)。如果你的提供商/模型走 `/v1/responses`,请使用 `@ai-sdk/openai`。
1883
+ - **name**:在 UI 中显示的名称。
1884
+ - **models**:可用模型。
1885
+ - **options.baseURL**:API 端点 URL。
1886
+ - **options.apiKey**:可选,如果不使用 auth 认证,可直接设置 API 密钥。
1887
+ - **options.headers**:可选,设置自定义请求头。
1888
+
1889
+ 更多高级选项请参见下面的示例。
1890
+
1891
+ 5. 执行 `/models` 命令,你自定义的提供商和模型将出现在选择列表中。
1892
+
1893
+ ---
1894
+
1895
+ ##### 示例
1896
+
1897
+ 以下是设置 `apiKey`、`headers` 和模型 `limit` 选项的示例。
1898
+
1899
+ ```json title="opencode.json" {9,11,17-20}
1900
+ {
1901
+ "$schema": "https://opencode.ai/config.json",
1902
+ "provider": {
1903
+ "myprovider": {
1904
+ "npm": "@ai-sdk/openai-compatible",
1905
+ "name": "My AI ProviderDisplay Name",
1906
+ "options": {
1907
+ "baseURL": "https://api.myprovider.com/v1",
1908
+ "apiKey": "{env:ANTHROPIC_API_KEY}",
1909
+ "headers": {
1910
+ "Authorization": "Bearer custom-token"
1911
+ }
1912
+ },
1913
+ "models": {
1914
+ "my-model-name": {
1915
+ "name": "My Model Display Name",
1916
+ "limit": {
1917
+ "context": 200000,
1918
+ "output": 65536
1919
+ }
1920
+ }
1921
+ }
1922
+ }
1923
+ }
1924
+ }
1925
+ ```
1926
+
1927
+ 配置详情:
1928
+
1929
+ - **apiKey**:使用 `env` 变量语法设置,[了解更多](/docs/config#env-vars)。
1930
+ - **headers**:随每个请求发送的自定义请求头。
1931
+ - **limit.context**:模型接受的最大输入 Token 数。
1932
+ - **limit.output**:模型可生成的最大 Token 数。
1933
+
1934
+ `limit` 字段让 OpenCode 了解你还剩余多少上下文空间。标准提供商会自动从 models.dev 拉取这些信息。
1935
+
1936
+ ---
1937
+
1938
+ ## 故障排除
1939
+
1940
+ 如果你在配置提供商时遇到问题,请检查以下几点:
1941
+
1942
+ 1. **检查认证设置**:运行 `opencode auth list` 查看该提供商的凭据是否已添加到配置中。
1943
+
1944
+ 这不适用于 Amazon Bedrock 等依赖环境变量进行认证的提供商。
1945
+
1946
+ 2. 对于自定义提供商,请检查 OpenCode 配置并确认:
1947
+ - `/connect` 命令中使用的提供商 ID 与 OpenCode 配置中的 ID 一致。
1948
+ - 使用了正确的 npm 包。例如,Cerebras 应使用 `@ai-sdk/cerebras`。对于其他所有 OpenAI 兼容的提供商,使用 `@ai-sdk/openai-compatible`(`/v1/chat/completions`);如果模型走 `/v1/responses`,请使用 `@ai-sdk/openai`。同一 provider 混用时,可在模型下设置 `provider.npm` 覆盖默认值。
1949
+ - `options.baseURL` 字段中的 API 端点地址正确。