mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
Merge 7883b2229e into 83397ebde2
This commit is contained in:
commit
e78ea6339d
1 changed files with 33 additions and 1 deletions
|
|
@ -1360,7 +1360,7 @@ You can use any OpenAI-compatible provider with opencode. Most modern AI provide
|
|||
|
||||
Here's an example setting the `apiKey`, `headers`, and model `limit` options.
|
||||
|
||||
```json title="opencode.json" {9,11,17-20}
|
||||
```json title="opencode.json"
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"provider": {
|
||||
|
|
@ -1377,6 +1377,9 @@ Here's an example setting the `apiKey`, `headers`, and model `limit` options.
|
|||
"models": {
|
||||
"my-model-name": {
|
||||
"name": "My Model Display Name",
|
||||
"options": {
|
||||
"reasoningEffort": "high"
|
||||
},
|
||||
"limit": {
|
||||
"context": 200000,
|
||||
"output": 65536
|
||||
|
|
@ -1388,6 +1391,35 @@ Here's an example setting the `apiKey`, `headers`, and model `limit` options.
|
|||
}
|
||||
```
|
||||
|
||||
For Anthropic-compatible providers:
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"provider": {
|
||||
"anthropic-provider": {
|
||||
"npm": "@ai-sdk/anthropic",
|
||||
"name": "My AI ProviderDisplay Name",
|
||||
"options": {
|
||||
"baseURL": "https://api.myprovider.com/v1",
|
||||
"apiKey": "{env:ANTHROPIC_API_KEY}"
|
||||
},
|
||||
"models": {
|
||||
"my-model-name": {
|
||||
"name": "My Model Display Name",
|
||||
"options": {
|
||||
"thinking": {
|
||||
"type": "enabled",
|
||||
"budgetTokens": 8000
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Configuration details:
|
||||
|
||||
- **apiKey**: Set using `env` variable syntax, [learn more](/docs/config#env-vars).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue