Title: How to configure Kimi K2 with the Moonshoot API? · Issue #340 · opencode-ai/opencode · GitHub
Open Graph Title: How to configure Kimi K2 with the Moonshoot API? · Issue #340 · opencode-ai/opencode
X Title: How to configure Kimi K2 with the Moonshoot API? · Issue #340 · opencode-ai/opencode
Description: As the title suggests. I updated the config.json as follows: { "data": { "directory": ".opencode" }, "providers": { "openai": { "apiKey": "your-openai-api-key", "disabled": false }, "anthropic": { "apiKey": "your-anthropic-api-key", "dis...
Open Graph Description: As the title suggests. I updated the config.json as follows: { "data": { "directory": ".opencode" }, "providers": { "openai": { "apiKey": "your-openai-api-key", "disabled": false }, "anthropic": { ...
X Description: As the title suggests. I updated the config.json as follows: { "data": { "directory": ".opencode" }, "providers": { "openai": { "apiKey":...
Opengraph URL: https://github.com/opencode-ai/opencode/issues/340
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to configure Kimi K2 with the Moonshoot API?","articleBody":"As the title suggests.\n\n\u003e I updated the `config.json` as follows:\n```\n{\n \"data\": {\n \"directory\": \".opencode\"\n },\n \"providers\": {\n \"openai\": {\n \"apiKey\": \"your-openai-api-key\",\n \"disabled\": false\n },\n \"anthropic\": {\n \"apiKey\": \"your-anthropic-api-key\",\n \"disabled\": false\n },\n \"copilot\": {\n \"disabled\": false\n },\n \"groq\": {\n \"apiKey\": \"your-groq-api-key\",\n \"disabled\": false\n },\n \"openrouter\": {\n \"apiKey\": \"your-openrouter-api-key\",\n \"disabled\": false\n },\n \"moonshot\": {\n \"npm\": \"@ai-sdk/openai-compatible\",\n \"name\": \"Kimi K2 (Moonshot)\",\n \"options\": {\n \"baseURL\": \"https://api.moonshot.ai/v1\",\n \"apiKey\": \"sk-your-moonshot-api-key\"\n },\n \"models\": {\n \"kimi-k2-0711-preview\": {\n \"name\": \"kimi-k2\"\n }\n }\n }\n },\n \"agents\": {\n \"coder\": {\n \"model\": \"moonshot/kimi-k2-0711-preview\",\n \"maxTokens\": 5000\n },\n \"task\": {\n \"model\": \"moonshot/kimi-k2-0711-preview\",\n \"maxTokens\": 5000\n },\n \"title\": {\n \"model\": \"moonshot/kimi-k2-0711-preview\",\n \"maxTokens\": 80\n }\n },\n \"shell\": {\n \"path\": \"/bin/bash\",\n \"args\": [\"-l\"]\n },\n \"lsp\": {\n \"go\": {\n \"disabled\": false,\n \"command\": \"gopls\"\n }\n },\n \"debug\": false,\n \"debugLSP\": false,\n \"autoCompact\": true\n}\n```\n\n\u003e Upon running `opencode` for the first time, I was prompted to select a model.\n\u003e Selected 'other' and added the provider name and API key.\n\u003e Got stuck in this process -\u003e `opencode` command would prompt to select a provider always.\n\u003e Selected OpenAI\n\u003e Now `opencode` opens with OpenAI configured.\n\n**How to revert this to configure to Moonshot AI as a provider?**\n\nThere seems to be a bug - upon selecting 'Other' as a provider, the opencode initial config seems to be stuck in a loop, i.e. you cannot configure 'Other' providers.\n\nEdit: \n\n\u003eHow to revert this........\nOpenAI auth was removed by removing the `auth.json` via `rm ~/.local/share/opencode/auth.json`\n","author":{"url":"https://github.com/hadikhantech","@type":"Person","name":"hadikhantech"},"datePublished":"2025-07-20T13:36:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/340/opencode/issues/340"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:96b888ee-62d1-6db1-9d79-d8efffc165b5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDBA:220FAF:192AA6F:2071464:69748E70 |
| html-safe-nonce | 0789468e36004a13d470926532ff3e8eac6ebb9d7ce78b68197ae40da3d9ebe7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREJBOjIyMEZBRjoxOTJBQTZGOjIwNzE0NjQ6Njk3NDhFNzAiLCJ2aXNpdG9yX2lkIjoiMjE4NjAyMzA2OTkyMTA4NzA4OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 10eb93c9c738d5320c9be4bfa3e4b1238394dea04307335010312ed7e0293ac8 |
| hovercard-subject-tag | issue:3246362129 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/opencode-ai/opencode/340/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3d20aa121acecbeb002724a97037b2931899932a27652ce4f4dcc737d6430508/opencode-ai/opencode/issues/340 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3d20aa121acecbeb002724a97037b2931899932a27652ce4f4dcc737d6430508/opencode-ai/opencode/issues/340 |
| og:image:alt | As the title suggests. I updated the config.json as follows: { "data": { "directory": ".opencode" }, "providers": { "openai": { "apiKey": "your-openai-api-key", "disabled": false }, "anthropic": { ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hadikhantech |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/opencode-ai/opencode git https://github.com/opencode-ai/opencode.git |
| octolytics-dimension-user_id | 208539476 |
| octolytics-dimension-user_login | opencode-ai |
| octolytics-dimension-repository_id | 949662713 |
| octolytics-dimension-repository_nwo | opencode-ai/opencode |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 949662713 |
| octolytics-dimension-repository_network_root_nwo | opencode-ai/opencode |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width