v15

latestOpenAPI 3.1.1raw.githubusercontent.com2026-06-05137173413.9 KB

Update configuration

Update OpenCode configuration settings and preferences.

patch/config

Query parameters

directorystring
workspacestring

Request body

$schemastring

JSON schema reference for configuration validation

shellstring

Default shell to use for terminal and bash tool

logLevel'DEBUG' | 'INFO' | 'WARN' | 'ERROR'

Log level

commandobject

Command configuration, see https://opencode.ai/docs/commands

snapshotboolean

Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.

pluginstring[]
share'manual' | 'auto' | 'disabled'

Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing

autoshareboolean

@deprecated Use 'share' field instead. Share newly created sessions automatically

disabled_providersstring[]

Disable providers that are loaded automatically

enabled_providersstring[]

When set, ONLY these providers will be enabled. All other providers will be ignored

modelstring

Model to use in the format of provider/model, eg anthropic/claude-2

small_modelstring

Small model to use for tasks like title generation in the format of provider/model

default_agentstring

Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.

usernamestring

Custom username to display in conversations instead of system username

providerobject

Custom provider configurations and model overrides

mcpobject

MCP (Model Context Protocol) server configurations

instructionsstring[]

Additional instruction files or patterns to include

layout'auto' | 'stretch'

@deprecated Always uses stretch layout.

toolsobject
artifact_allowed_pathsstring[]

允许创建 artifact 的文件路径前缀白名单。路径将被 resolve 为绝对路径后进行前缀匹配。默认允许 /tmp 路径。

custom_provider_npm_whiteliststring[]

自定义 provider 允许加载的 npm 包白名单。

Response

Successfully updated config

$schemastring

JSON schema reference for configuration validation

shellstring

Default shell to use for terminal and bash tool

logLevel'DEBUG' | 'INFO' | 'WARN' | 'ERROR'

Log level

commandobject

Command configuration, see https://opencode.ai/docs/commands

snapshotboolean

Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.

pluginstring[]
share'manual' | 'auto' | 'disabled'

Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing

autoshareboolean

@deprecated Use 'share' field instead. Share newly created sessions automatically

disabled_providersstring[]

Disable providers that are loaded automatically

enabled_providersstring[]

When set, ONLY these providers will be enabled. All other providers will be ignored

modelstring

Model to use in the format of provider/model, eg anthropic/claude-2

small_modelstring

Small model to use for tasks like title generation in the format of provider/model

default_agentstring

Default agent to use when none is specified. Must be a primary agent. Falls back to 'build' if not set or if the specified agent is invalid.

usernamestring

Custom username to display in conversations instead of system username

providerobject

Custom provider configurations and model overrides

mcpobject

MCP (Model Context Protocol) server configurations

instructionsstring[]

Additional instruction files or patterns to include

layout'auto' | 'stretch'

@deprecated Always uses stretch layout.

toolsobject
artifact_allowed_pathsstring[]

允许创建 artifact 的文件路径前缀白名单。路径将被 resolve 为绝对路径后进行前缀匹配。默认允许 /tmp 路径。

custom_provider_npm_whiteliststring[]

自定义 provider 允许加载的 npm 包白名单。