---
title: "Get default model"
method: GET
path: "/api/model/default"
tags: ["model"]
---

# Get default model

`GET /api/model/default`

## Request

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

Retrieve the model used when a session has no explicit model selection.

## Query parameters

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

## Response `200`

Success

- object
  - `location` LocationPublicRef, required
    - `directory` string, required
  - `data` ModelInfo, required
    - `id` string, required
    - `modelID` string, required
    - `providerID` string, required
    - `canonical` string
    - `type` union
      - 'chat' | 'decision' | 'image'
      - string
    - `family` string
    - `name` string, required
    - `compatibility` ModelCompatibility
      - `reasoningField` union
        - 'reasoning' | 'reasoning_content' | 'reasoning_text'
        - string
      - `requireReasoning` boolean
      - `maxTokensField` 'max_completion_tokens' | 'max_tokens'
      - `requireFinishReason` boolean
      - `requireAssistantAfterTool` boolean
      - `supportsPromptCacheKey` boolean
      - `streamUsage` boolean
      - `cacheFormat` 'anthropic' | 'alibaba'
      - `supportsThinkingBlockBinding` boolean
      - `supportsEffortUpdates` boolean
      - `mediaInput` 'assets' | 'state' | 'root'
    - `package` string
    - `settings` ModelSettings
      - `compaction` union
        - object
          - `type` 'summary', required
        - object
          - `type` 'native', required
      - `cache` ProviderCache
        - `ttl` string
      - `encoding` 'zstd' | 'gzip' | 'none'
    - `headers` object
    - `body` object
    - `capabilities` ModelCapabilities, required
      - `tools` boolean, required
      - `input` string[], required
      - `output` string[], required
      - `temperature` boolean
    - `variants` ModelVariant[], required
      - `id` string, required
      - `settings` ModelVariantSettings
        - `compaction` union
          - object
            - `type` 'summary', required
          - object
            - `type` 'native', required
        - `encoding` 'zstd' | 'gzip' | 'none'
      - `headers` object
      - `body` object
    - `time` object, required
      - `released` number, required
    - `cost` ModelCost[], required
      - `tier` object
        - `type` 'context', required
        - `size` integer, required
      - `input` number, required
      - `output` number, required
      - `cache` object, required
        - `read` number, required
        - `write` number, required
    - `status` 'alpha' | 'beta' | 'deprecated' | 'active', required
    - `enabled` boolean, required
    - `limit` object, required
      - `context` integer, required
      - `input` integer
      - `output` integer, required

## Other responses

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

## Changes

> 50 revisions in range; 1 not diffed.

- **2026-10-27** `d3e38b2cb625`: 1 warning
  - removed the optional property `data/anyOf[#/components/schemas/Model.Info]/variants/items/settings/cache` from the response with the `200` status
- **2026-10-27** `d6d739fceba2`: 1 info
  - added the optional property `data/anyOf[#/components/schemas/Model.Info]/compatibility/mediaInput` to the response with the `200` status
- **2026-10-26** `0478c2c0429f`: 1 info
  - added the optional property `data/anyOf[#/components/schemas/Model.Info]/type` to the response with the `200` status
- **2026-10-26** `612fd3a75a0b`: 2 info
  - added the optional property `data/anyOf[#/components/schemas/Model.Info]/settings/cache` to the response with the `200` status
  - added the optional property `data/anyOf[#/components/schemas/Model.Info]/variants/items/settings/cache` to the response with the `200` status
- **2026-10-20** `7e00fc7f9cae`: 1 info
  - added the optional property `data/anyOf[#/components/schemas/Model.Info]/compatibility/streamUsage` to the response with the `200` status

[Operation history](https://skmtc.dev/kaaass/apis/opencode/changes/api/model/default/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)
