Skip to content

Commit 7883b22

Browse files
committed
docs: enhance provider configuration documentation with Anthropic examples
Add comprehensive examples for custom Anthropic-compatible provider configuration including thinking budget options and realistic configuration patterns. * Add Anthropic-compatible provider example with thinking configuration * Enhance existing custom provider example with reasoningEffort option * Remove unnecessary code block line highlighting for cleaner examples * Improve documentation coverage for advanced provider options
1 parent eeb0d2b commit 7883b22

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ You can use any OpenAI-compatible provider with opencode. Most modern AI provide
13171317
13181318
Here's an example setting the `apiKey`, `headers`, and model `limit` options.
13191319
1320-
```json title="opencode.json" {9,11,17-20}
1320+
```json title="opencode.json"
13211321
{
13221322
"$schema": "https://opencode.ai/config.json",
13231323
"provider": {
@@ -1334,6 +1334,9 @@ Here's an example setting the `apiKey`, `headers`, and model `limit` options.
13341334
"models": {
13351335
"my-model-name": {
13361336
"name": "My Model Display Name",
1337+
"options": {
1338+
"reasoningEffort": "high"
1339+
},
13371340
"limit": {
13381341
"context": 200000,
13391342
"output": 65536
@@ -1345,6 +1348,35 @@ Here's an example setting the `apiKey`, `headers`, and model `limit` options.
13451348
}
13461349
```
13471350
1351+
For Anthropic-compatible providers:
1352+
1353+
```json title="opencode.json"
1354+
{
1355+
"$schema": "https://opencode.ai/config.json",
1356+
"provider": {
1357+
"anthropic-provider": {
1358+
"npm": "@ai-sdk/anthropic",
1359+
"name": "My AI ProviderDisplay Name",
1360+
"options": {
1361+
"baseURL": "https://api.myprovider.com/v1",
1362+
"apiKey": "{env:ANTHROPIC_API_KEY}"
1363+
},
1364+
"models": {
1365+
"my-model-name": {
1366+
"name": "My Model Display Name",
1367+
"options": {
1368+
"thinking": {
1369+
"type": "enabled",
1370+
"budgetTokens": 8000
1371+
}
1372+
}
1373+
}
1374+
}
1375+
}
1376+
}
1377+
}
1378+
```
1379+
13481380
Configuration details:
13491381
13501382
- **apiKey**: Set using `env` variable syntax, [learn more](/docs/config#env-vars).

0 commit comments

Comments
 (0)