Skip to content

Commit 0e4703b

Browse files
xiaojiezjxiaojie.zj
andauthored
add: add zenmux doc and header (#3597)
Co-authored-by: xiaojie.zj <xiaojie.zj@antgroup.com>
1 parent 84e0232 commit 0e4703b

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

packages/opencode/src/provider/provider.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,17 @@ export namespace Provider {
209209
},
210210
}
211211
},
212+
zenmux: async () => {
213+
return {
214+
autoload: false,
215+
options: {
216+
headers: {
217+
"HTTP-Referer": "https://opencode.ai/",
218+
"X-Title": "opencode",
219+
},
220+
},
221+
}
222+
},
212223
}
213224

214225
const state = Instance.state(async () => {

packages/web/src/content/docs/providers.mdx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,58 @@ monitor and improve Grok Code.
957957

958958
---
959959

960+
### ZenMux
961+
962+
1. Head over to the [ZenMux dashboard](https://zenmux.ai/settings/keys), click **Create API Key**, and copy the key.
963+
964+
2. Run `opencode auth login` and select ZenMux.
965+
966+
```bash
967+
$ opencode auth login
968+
969+
┌ Add credential
970+
971+
◆ Select provider
972+
│ ● ZenMux
973+
│ ○ Zhipu AI
974+
│ ○ Zhipu AI Coding Plan
975+
│ ...
976+
977+
```
978+
979+
3. Enter the API key for the provider.
980+
981+
```bash
982+
$ opencode auth login
983+
984+
┌ Add credential
985+
986+
◇ Select provider
987+
│ ZenMux
988+
989+
◇ Enter your API key
990+
│ _
991+
992+
```
993+
994+
4. Many ZenMux models are preloaded by default, run the `/models` command to select the one you want.
995+
996+
You can also add additional models through your opencode config.
997+
998+
```json title="opencode.json" {6}
999+
{
1000+
"$schema": "https://opencode.ai/config.json",
1001+
"provider": {
1002+
"zenmux": {
1003+
"models": {
1004+
"somecoolnewmodel": {}
1005+
}
1006+
}
1007+
}
1008+
}
1009+
```
1010+
---
1011+
9601012
## Custom provider
9611013

9621014
To add any **OpenAI-compatible** provider that's not listed in `opencode auth login`:

0 commit comments

Comments
 (0)