From 7883b2229e45b3549bb2b2d28759d3247a4b3846 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Mon, 1 Dec 2025 17:17:54 +0800 Subject: [PATCH] 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 --- packages/web/src/content/docs/providers.mdx | 34 ++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/web/src/content/docs/providers.mdx b/packages/web/src/content/docs/providers.mdx index 0e8019082..bf5969a35 100644 --- a/packages/web/src/content/docs/providers.mdx +++ b/packages/web/src/content/docs/providers.mdx @@ -1317,7 +1317,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": { @@ -1334,6 +1334,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 @@ -1345,6 +1348,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).