dotfiles/private_dot_config/opencode/opencode.json
Anton Volnuhin 2ba14d3e6d opencode: fix invalid config and externalize the bailian key
opencode rejected the config with "Unrecognized key: providers". The
file had both `provider` (opencode's schema: npm + options) and
`providers` (package: "aisdk:..." + settings, some other tool's shape,
left behind by an api-for-cursor script back in July). The Alibaba/Qwen
provider lived only under the rejected key, so it had never actually
reached opencode.

Translate it into the real schema -- package -> npm, settings -> options
at both provider and model level -- rather than dropping it, so those
five qwen models now work. The duplicate cursorapi under `providers` is
dropped: the existing provider.cursorapi is a superset, with four models
plus cost and limit metadata.

The 113-char bailian key moves to secrets/bailian-api-key (0600) and is
referenced as {file:./secrets/bailian-api-key}, which opencode resolves
relative to the config dir -- so no absolute home path, and no shell
export needed on ssh-only boxes. Verified by pointing it at a missing
file and getting "bad file reference".

With the key out, opencode.json can finally be tracked. Ignore the
secrets dir, the stale .bak copies that still contain it, and the
node/bun lockfiles.
2026-08-06 02:53:27 +03:00

171 lines
3.8 KiB
JSON

{
"$schema": "https://opencode.ai/config.json",
"model": "cursorapi/composer-2.5-fast",
"provider": {
"cursorapi": {
"models": {
"composer-2.5": {
"cost": {
"input": 0.5,
"output": 2.5
},
"limit": {
"context": 200000,
"output": 65536
},
"name": "Composer 2.5"
},
"composer-2.5-fast": {
"cost": {
"input": 3,
"output": 15
},
"limit": {
"context": 200000,
"output": 65536
},
"name": "Composer 2.5 Fast"
},
"grok-4.5": {
"cost": {
"input": 2,
"output": 6
},
"limit": {
"context": 200000,
"output": 65536
},
"name": "Grok 4.5"
},
"grok-4.5-fast": {
"cost": {
"input": 4,
"output": 18
},
"limit": {
"context": 200000,
"output": 65536
},
"name": "Grok 4.5 Fast"
}
},
"name": "API for Cursor",
"npm": "@ai-sdk/openai-compatible",
"options": {
"apiKey": "cursor-local",
"baseURL": "http://127.0.0.1:8788/v1"
}
},
"bailian-token-plan-personal": {
"models": {
"qwen3.6-flash": {
"capabilities": {
"input": [
"text",
"image"
],
"output": [
"text"
],
"tools": true
},
"name": "Qwen3.6 Flash",
"options": {
"thinking": {
"budgetTokens": 8192,
"type": "enabled"
}
}
},
"qwen3.6-plus": {
"capabilities": {
"input": [
"text",
"image"
],
"output": [
"text"
],
"tools": true
},
"name": "Qwen3.6 Plus",
"options": {
"thinking": {
"budgetTokens": 8192,
"type": "enabled"
}
}
},
"qwen3.7-max": {
"capabilities": {
"input": [
"text"
],
"output": [
"text"
],
"tools": true
},
"name": "Qwen3.7 Max",
"options": {
"thinking": {
"budgetTokens": 8192,
"type": "enabled"
}
}
},
"qwen3.7-plus": {
"capabilities": {
"input": [
"text",
"image"
],
"output": [
"text"
],
"tools": true
},
"name": "Qwen3.7 Plus",
"options": {
"thinking": {
"budgetTokens": 8192,
"type": "enabled"
}
}
},
"qwen3.8-max-preview": {
"body": {
"temperature": 0.6
},
"capabilities": {
"input": [
"text"
],
"output": [
"text"
],
"tools": true
},
"limit": {
"context": 983616,
"output": 131072
},
"name": "Qwen3.8 Max Preview",
"options": {
"thinking": {
"budgetTokens": 99072,
"type": "enabled"
}
}
}
},
"name": "Alibaba Cloud Model Studio",
"npm": "@ai-sdk/anthropic",
"options": {
"apiKey": "{file:./secrets/bailian-api-key}",
"baseURL": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic/v1"
}
}
}
}