---
title: "Get configuration"
method: GET
path: "/api/config"
tags: ["config"]
---

# Get configuration

`GET /api/config`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/config`
- Auth: none required

Return configuration documents and discovery sources for the requested location, from lowest to highest priority.

## Query parameters

- `location` object, nullable
  - `directory` string, nullable

## Response `200`

Success

- ConfigEntry[]
  - union
    - ConfigDocumentEncoded
      - `type` 'document', required
      - `path` string
      - `info` ConfigInfoEncoded, required
        - `$schema` string
        - `shell` string
        - `model` union
          - string
          - object
            - `providerID` string, required
            - `model` string, required
            - `variant` string
        - `default_agent` string
        - `update` 'disable' | 'notify' | 'auto'
        - `share` 'manual' | 'auto' | 'disabled'
        - `enterprise` object
          - `url` string
        - `username` string
        - `timezone` string
        - `permissions` PermissionRule[]
          - `action` string, required
          - `resource` string, required
          - `effect` 'allow' | 'deny' | 'ask', required
        - `policies` object[]
          - `action` 'provider.use' | 'tool.use' | 'integration.use', required
          - `resource` string, required
          - `effect` 'allow' | 'deny', required
        - `agents` object
        - `snapshots` boolean
        - `watcher` object
          - `ignore` string[]
        - `formatter` union
          - boolean
          - object
        - `lsp` union
          - boolean
          - object
        - `media` object
          - `image` object
            - `auto_resize` boolean
            - `max_width` integer
            - `max_height` integer
            - `max_base64_bytes` integer
        - `tool_output` object
          - `max_lines` integer
          - `max_bytes` integer
        - `mcp` object
          - `timeout` object
            - `startup` integer
            - `catalog` integer
            - `execution` integer
          - `servers` object
        - `compaction` object
          - `auto` boolean
          - `keep` object
            - `tokens` integer
          - `buffer` integer
        - `skills` string[]
        - `commands` object
        - `instructions` string[]
        - `references` object
        - `websearch` union
          - false
          - ConfigWebSearchInfoEncoded
            - `provider` union, required
              - …
        - `plugins` union[]
          - union
            - string
            - ConfigPluginEntryEncoded
              - …
        - `worktree` ConfigWorktree
          - `directory` string, required
        - `warming` union
          - boolean
          - ConfigWarmingEncoded
            - `prompt` string
            - `interval` string
            - `duration` string
        - `providers` object
        - `experimental` object
          - `portable_shell_scanner` boolean
          - `todo` boolean
          - `background_compaction` boolean
          - `media_blob` boolean
          - `image_generate` union
            - boolean
            - object
              - …
          - `schedules` boolean
          - `subagent_depth` integer
          - `location_idle_timeout` union
            - string
            - false
          - `policies` object[]
            - `action` 'provider.use' | 'tool.use' | 'integration.use', required
            - `resource` string, required
            - `effect` 'allow' | 'deny', required
    - ConfigDirectoryEncoded
      - `type` 'directory', required
      - `path` string, required

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: LocationNotFoundError

## Changes

> 50 revisions in range; 1 not diffed.

- **2026-10-29** `4e083d954707`: 1 warning, 1 info
  - removed the optional property `items/anyOf[#/components/schemas/Config.DocumentEncoded]/info/experimental/image_model` from the response with the `200` status
  - added the optional property `items/anyOf[#/components/schemas/Config.DocumentEncoded]/info/experimental/image_generate` to the response with the `200` status
- **2026-10-29** `dbd859e71b79`: 1 info
  - added the optional property `items/anyOf[#/components/schemas/Config.DocumentEncoded]/info/experimental/image_model` to the response with the `200` status
- **2026-10-28** `a0691362f520`: 2 info
  - added the optional property `items/anyOf[#/components/schemas/Config.DocumentEncoded]/info/experimental/schedules` to the response with the `200` status
  - added the optional property `items/anyOf[#/components/schemas/Config.DocumentEncoded]/info/timezone` to the response with the `200` status
- **2026-10-27** `d3e38b2cb625`: 1 warning
  - removed the optional property `items/anyOf[#/components/schemas/Config.DocumentEncoded]/info/providers/additionalProperties/models/additionalProperties/variants/items/settings/cache` from the response with the `200` status
- …earlier changes not shown

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/config/get.md)

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
